1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-08 02:38:11 +09:00
nixpkgs/pkgs/common-updater
Ulysses Zhan dfb8bf17cf
update-source-version: escape special characters when replacing url
URLs can contain characters that sed would consider special in the context of the regex pattern.

Let’s switch the URL replacement `sed` command to use POSIX Basic Regular Expression syntax to reduce the number of characters that need to be escaped:
https://www.gnu.org/software/sed/manual/html_node/BRE-syntax.html

Then, let’s escape all BRE special characters, plus the separator character `|` of the `s` command in the old URL pattern.

Similarly, the replacement part of the `s` command (new URL) can also contain special characters (e.g. the `&` character would be replaced with the whole matched expression), so we need to escape it as well:
https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html

Co-Authored-By: Jan Tojnar <jtojnar@gmail.com>
2025-05-17 13:33:36 +02:00
..
scripts update-source-version: escape special characters when replacing url 2025-05-17 13:33:36 +02:00
combinators.nix _experimental-update-script-combinators.sequence: Loosen attrPath constraint 2025-03-03 00:46:17 +01:00
directory-listing-updater.nix generic-updater: Allow filtering tags ending with suffix 2025-05-06 23:01:16 +02:00
generic-updater.nix generic-updater: Allow filtering tags ending with suffix 2025-05-06 23:01:16 +02:00
git-updater.nix generic-updater: Allow filtering tags ending with suffix 2025-05-06 23:01:16 +02:00
http-two-levels-updater.nix generic-updater: Allow filtering tags ending with suffix 2025-05-06 23:01:16 +02:00
scripts.nix treewide: format all inactive Nix files 2024-12-10 20:26:33 +01:00
unstable-updater.nix treewide: format all inactive Nix files 2024-12-10 20:26:33 +01:00