summary refs log tree commit diff
path: root/maintainers
diff options
context:
space:
mode:
authornicoo <nicoo@mur.at>2023-09-12 11:41:36 +0000
committernicoo <nicoo@mur.at>2023-09-12 11:41:36 +0000
commit8dcbced52ae7973a28193d89bbb105a1522230a7 (patch)
treea93c4ecb31a8246d74e98b2582f0553621603e49 /maintainers
parent78058d810644f5ed276804ce7ea9e82d92bee293 (diff)
downloadnixpkgs-8dcbced52ae7973a28193d89bbb105a1522230a7.tar
nixpkgs-8dcbced52ae7973a28193d89bbb105a1522230a7.tar.gz
nixpkgs-8dcbced52ae7973a28193d89bbb105a1522230a7.tar.bz2
nixpkgs-8dcbced52ae7973a28193d89bbb105a1522230a7.tar.lz
nixpkgs-8dcbced52ae7973a28193d89bbb105a1522230a7.tar.xz
nixpkgs-8dcbced52ae7973a28193d89bbb105a1522230a7.tar.zst
nixpkgs-8dcbced52ae7973a28193d89bbb105a1522230a7.zip
maintainers/scripts/remove-old-aliases: Drop `pkgs.` prefix if present
This should provide nicer `throw` messages, and avoid back-and-forth like
	https://github.com/NixOS/nixpkgs/pull/254418#discussion_r1322076574
Diffstat (limited to 'maintainers')
-rwxr-xr-xmaintainers/scripts/remove-old-aliases.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/maintainers/scripts/remove-old-aliases.py b/maintainers/scripts/remove-old-aliases.py
index 8f04a9be4f1..3c5f8edc50a 100755
--- a/maintainers/scripts/remove-old-aliases.py
+++ b/maintainers/scripts/remove-old-aliases.py
@@ -102,12 +102,13 @@ def convert_to_throw(date_older_list: list[str]) -> list[tuple[str, str]]:
 
         alias = before_equal
         alias_unquoted = before_equal.strip('"')
-        after_equal_list = [x.strip(";:") for x in after_equal.split()]
+        replacement = next(x.strip(";:") for x in after_equal.split())
+        replacement = replacement.removeprefix("pkgs.")
 
         converted = (
-            f"{indent}{alias} = throw \"'{alias_unquoted}' has been renamed to/replaced by"
-            f" '{after_equal_list.pop(0)}'\";"
-            f' # Converted to throw {datetime.today().strftime("%Y-%m-%d")}'
+            f"{indent}{alias} = throw \"'{alias_unquoted}' has been"
+            f" renamed to/replaced by '{replacement}'\";"
+            f" # Converted to throw {datetime.today().strftime('%Y-%m-%d')}"
         )
         converted_list.append((line, converted))