diff --git a/maintainers/scripts/remove-old-aliases.py b/maintainers/scripts/remove-old-aliases.py index 3c5f8edc50adf..24129afd2a9b9 100755 --- a/maintainers/scripts/remove-old-aliases.py +++ b/maintainers/scripts/remove-old-aliases.py @@ -42,11 +42,12 @@ def process_args() -> argparse.Namespace: def get_date_lists( txt: list[str], cutoffdate: datetimedate, only_throws: bool -) -> tuple[list[str], list[str], list[str]]: +) -> tuple[list[str], list[str], list[str], list[str]]: """get a list of lines in which the date is older than $cutoffdate""" date_older_list: list[str] = [] date_older_throw_list: list[str] = [] date_sep_line_list: list[str] = [] + date_too_complex_list: list[str] = [] for lineno, line in enumerate(txt, start=1): line = line.rstrip() @@ -69,12 +70,21 @@ def get_date_lists( ): continue - if "=" not in line: - date_sep_line_list.append(f"{lineno} {line}") + if line.lstrip().startswith("inherit (") and ";" in line: + if not only_throws: + date_older_list.append(line) + elif "=" not in line: + date_sep_line_list.append(f"{lineno:>5} {line}") # 'if' lines could be complicated elif "if " in line and "if =" not in line: - print(f"RESOLVE MANUALLY {line}") - elif "throw" in line: + date_too_complex_list.append(f"{lineno:>5} {line}") + elif "= with " in line: + date_too_complex_list.append(f"{lineno:>5} {line}") + elif "lib.warnOnInstantiate" in line: + date_too_complex_list.append(f"{lineno:>5} {line}") + elif '"' in line: + date_too_complex_list.append(f"{lineno:>5} {line}") + elif " = throw" in line: date_older_throw_list.append(line) elif not only_throws: date_older_list.append(line) @@ -82,6 +92,7 @@ def get_date_lists( return ( date_older_list, date_sep_line_list, + date_too_complex_list, date_older_throw_list, ) @@ -91,18 +102,31 @@ def convert_to_throw(date_older_list: list[str]) -> list[tuple[str, str]]: converted_list = [] for line in date_older_list.copy(): indent: str = " " * (len(line) - len(line.lstrip())) - before_equal = "" - after_equal = "" - try: - before_equal, after_equal = (x.strip() for x in line.split("=", maxsplit=2)) - except ValueError as err: - print(err, line, "\n") - date_older_list.remove(line) - continue - alias = before_equal - alias_unquoted = before_equal.strip('"') - replacement = next(x.strip(";:") for x in after_equal.split()) + if "=" not in line: + assert "inherit (" in line + before, sep, after = line.partition("inherit (") + inside, sep, after = after.partition(")") + if not sep: + print(f"FAILED ON {line}") + continue + alias, *_ = after.strip().split(";")[0].split() + replacement = f"{inside.strip()}.{alias}" + + else: + before_equal = "" + after_equal = "" + try: + before_equal, after_equal = (x.strip() for x in line.split("=", maxsplit=2)) + except ValueError as err: + print(err, line, "\n") + date_older_list.remove(line) + continue + + alias = before_equal + replacement = next(x.strip(";:") for x in after_equal.split()) + + alias_unquoted = alias.strip('"') replacement = replacement.removeprefix("pkgs.") converted = ( @@ -180,8 +204,14 @@ def main() -> None: date_older_list: list[str] = [] date_sep_line_list: list[str] = [] date_older_throw_list: list[str] = [] + date_too_complex_list: list[str] = [] - date_older_list, date_sep_line_list, date_older_throw_list = get_date_lists( + ( + date_older_list, + date_sep_line_list, + date_too_complex_list, + date_older_throw_list + ) = get_date_lists( txt, cutoffdate, only_throws ) @@ -197,6 +227,11 @@ def main() -> None: for l_n in date_older_throw_list: print(l_n) + if date_too_complex_list: + print(" Too complex, resolve manually. ".center(100, "-")) + for l_n in date_too_complex_list: + print(l_n) + if date_sep_line_list: print(" On separate line, resolve manually. ".center(100, "-")) for l_n in date_sep_line_list: diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 5c0c8f40b8a08..76ce281aad35d 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -297,7 +297,7 @@ mapAliases { appimagekit = throw "'appimagekit' has been removed as it was broken in nixpkgs and archived upstream"; # Added 2025-04-19 apple-sdk_10_12 = throw "apple-sdk_10_12 was removed as Nixpkgs no longer supports macOS 10.12; see the 25.05 release notes"; # Added 2024-10-27 apple-sdk_10_13 = throw "apple-sdk_10_13 was removed as Nixpkgs no longer supports macOS 10.13; see the 25.05 release notes"; # Added 2024-10-27 - apple-sdk_10_14 = throw "apple-sdk_10_14 was removed as Nixpkgs no longer supprots macOS 10.14; see the 25.05 release notes"; # Added 2024-10-27 + apple-sdk_10_14 = throw "apple-sdk_10_14 was removed as Nixpkgs no longer supports macOS 10.14; see the 25.05 release notes"; # Added 2024-10-27 apple-sdk_10_15 = throw "apple-sdk_10_15 was removed as Nixpkgs no longer supports macOS 10.15; see the 25.05 release notes"; # Added 2024-10-27 appthreat-depscan = dep-scan; # Added 2024-04-10 arb = throw "'arb' has been removed as it has been merged into 'flint3'"; # Added 2025-03-28 @@ -637,7 +637,7 @@ mapAliases { est-sfs = throw "'est-sfs' has been removed as it was unmaintained in Nixpkgs"; # Added 2025-05-18 - ethabi = throw "ethabi has been removed due to lack of maintainence upstream and no updates in Nixpkgs"; # Added 2024-07-16 + ethabi = throw "ethabi has been removed due to lack of maintenance upstream and no updates in Nixpkgs"; # Added 2024-07-16 eww-wayland = lib.warnOnInstantiate "eww now can build for X11 and wayland simultaneously, so `eww-wayland` is deprecated, use the normal `eww` package instead." eww; ### F ### @@ -754,7 +754,7 @@ mapAliases { gnome-latex = throw "'gnome-latex' has been superseded by 'enter-tex'"; # Added 2024-09-18 gnome-settings-daemon43 = throw "'gnome-settings-daemon43' has been removed since it is no longer used by Pantheon."; # Added 2024-09-22 gnu-cobol = gnucobol; # Added 2024-09-17 - gnupg1orig = throw "'gnupg1orig' has been removed due to lack of active upstream maintainance. Consider using 'gnupg' instead"; # Added 2025-01-11 + gnupg1orig = throw "'gnupg1orig' has been removed due to lack of active upstream maintenance. Consider using 'gnupg' instead"; # Added 2025-01-11 gnupg22 = throw "'gnupg22' is end-of-life. Consider using 'gnupg24' instead"; # Added 2025-01-05 go_1_22 = throw "Go 1.22 is end-of-life and 'go_1_22' has been removed. Please use a newer Go toolchain."; # Added 2024-03-28 gogs = throw '' @@ -871,7 +871,7 @@ mapAliases { hacksaw = throw "'hacksaw' has been removed due to lack of upstream maintenance"; # Added 2025-01-25 haka = throw "haka has been removed because it failed to build and was unmaintained for 9 years"; # Added 2025-03-11 hardinfo = throw "'hardinfo' has been removed as it was abandoned upstream. Consider using 'hardinfo2' instead."; # added 2025-04-17 - hasura-graphql-engine = throw "hasura-graphql-engine has been removed because was broken and its packaging severly out of date"; # Added 2025-02-14 + hasura-graphql-engine = throw "hasura-graphql-engine has been removed because was broken and its packaging severely out of date"; # Added 2025-02-14 haven-cli = throw "'haven-cli' has been removed due to the official announcement of the project closure. Read more at https://havenprotocol.org/2024/12/12/project-closure-announcement"; # Added 2025-02-25 hawknl = throw "'hawknl' has been removed as it was unmaintained and the upstream unavailable"; # Added 2025-05-07 HentaiAtHome = hentai-at-home; # Added 2024-06-12 @@ -954,7 +954,7 @@ mapAliases { keepkey_agent = keepkey-agent; # added 2024-01-06 kerberos = throw "'kerberos' has been renamed to/replaced by 'krb5'"; # Converted to throw 2024-10-17 kexectools = throw "'kexectools' has been renamed to/replaced by 'kexec-tools'"; # Converted to throw 2024-10-17 - keyfinger = throw "keyfinder has been removed as it was abandoned upstream and did not build; consider using mixxx or keyfinder-cli"; # Addd 2024-08-25 + keyfinger = throw "keyfinder has been removed as it was abandoned upstream and did not build; consider using mixxx or keyfinder-cli"; # Added 2024-08-25 keysmith = throw "'keysmith' has been renamed to/replaced by 'libsForQt5.kdeGear.keysmith'"; # Converted to throw 2024-10-17 kgx = gnome-console; # Added 2022-02-19 kibana7 = throw "Kibana 7.x has been removed from nixpkgs as it depends on an end of life Node.js version and received no maintenance in time."; # Added 2023-30-10 @@ -1037,7 +1037,7 @@ mapAliases { libseat = throw "'libseat' has been renamed to/replaced by 'seatd'"; # Converted to throw 2024-10-17 libsForQt515 = libsForQt5; # Added 2022-11-24 libsoup = lib.warnOnInstantiate "‘libsoup’ has been renamed to ‘libsoup_2_4’" libsoup_2_4; # Added 2024-12-02 - libstdcxx5 = throw "libstdcxx5 is severly outdated and has been removed"; # Added 2024-11-24 + libstdcxx5 = throw "libstdcxx5 is severely outdated and has been removed"; # Added 2024-11-24 libtensorflow-bin = libtensorflow; # Added 2022-09-25 libtorrentRasterbar = throw "'libtorrentRasterbar' has been renamed to/replaced by 'libtorrent-rasterbar'"; # Converted to throw 2024-10-17 libtorrentRasterbar-1_2_x = throw "'libtorrentRasterbar-1_2_x' has been renamed to/replaced by 'libtorrent-rasterbar-1_2_x'"; # Converted to throw 2024-10-17 @@ -1053,7 +1053,7 @@ mapAliases { licensor = throw "'licensor' has been removed due to lack of upstream maintenance"; # Added 2025-01-25 lightdm_gtk_greeter = lightdm-gtk-greeter; # Added 2022-08-01 lightstep-tracer-cpp = throw "lightstep-tracer-cpp is deprecated since 2022-08-29; the upstream recommends migration to opentelemetry projects."; - ligo = throw "ligo has been removed from nixpkgs for lack of maintainance"; # Added 2025-06-03 + ligo = throw "ligo has been removed from nixpkgs for lack of maintenance"; # Added 2025-06-03 lima-bin = lib.warnOnInstantiate "lima-bin has been replaced by lima" lima; # Added 2025-05-13 lime3ds = throw "lime3ds is deprecated, use 'azahar' instead."; # Added 2025-03-22 limesctl = throw "limesctl has been removed because it is insignificant."; # Added 2024-11-25 @@ -1237,7 +1237,7 @@ mapAliases { micropad = throw "micropad has been removed, since it was unmaintained and blocked the Electron 27 removal."; # Added 2025-02-24 microsoft-edge = throw "microsoft-edge has been removed due to lack of maintenance in nixpkgs"; # Added 2025-05-19 microsoft_gsl = microsoft-gsl; # Added 2023-05-26 - midori = throw "'midori' original project has been abandonned upstream and the package was broken for a while in nixpkgs"; # Added 2025-05-19 + midori = throw "'midori' original project has been abandoned upstream and the package was broken for a while in nixpkgs"; # Added 2025-05-19 midori-unwrapped = midori; # Added 2025-05-19 MIDIVisualizer = midivisualizer; # Added 2024-06-12 mikutter = throw "'mikutter' has been removed because the package was broken and had no maintainers"; # Added 2024-10-01 @@ -1913,7 +1913,7 @@ mapAliases { tomcat_connectors = apacheHttpdPackages.mod_jk; # Added 2024-06-07 ton = throw "'ton' has been removed as there were insufficient maintainer resources to keep up with updates"; # Added 2025-04-27 tor-browser-bundle-bin = tor-browser; # Added 2023-09-23 - torrenttools = throw "torrenttools has been removed due to lack of maintanance upstream"; # Added 2025-04-06 + torrenttools = throw "torrenttools has been removed due to lack of maintenance upstream"; # Added 2025-04-06 torq = throw "torq has been removed because the project went closed source"; # Added 2024-11-24 torzu = throw "torzu has been removed from nixpkgs, as it is subject to a DMCA takedown"; # Added 2025-05-12 transmission = lib.warnOnInstantiate (transmission3Warning { }) transmission_3; # Added 2024-06-10 @@ -1985,7 +1985,7 @@ mapAliases { ### V ### - v8 = throw "`v8` has been removed as it's unmaintained for several years and has vulnerabilites. Please migrate to `nodejs.libv8`"; # Added 2024-12-21 + v8 = throw "`v8` has been removed as it's unmaintained for several years and has vulnerabilities. Please migrate to `nodejs.libv8`"; # Added 2024-12-21 validphys2 = throw "validphys2 has been removed, since it has a broken dependency that was removed"; # Added 2024-08-21 vamp = { vampSDK = vamp-plugin-sdk;