Skip to content

Commit

Permalink
treewide: String escape fixes (NixOS#365186)
Browse files Browse the repository at this point in the history
  • Loading branch information
philiptaron authored Dec 15, 2024
2 parents e89a8d5 + 591861f commit 4d263e0
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 27 deletions.
2 changes: 1 addition & 1 deletion pkgs/applications/science/logic/klee/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ llvmPackages.stdenv.mkDerivation rec {
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"v(\d\.\d)"
"v(\\d\\.\\d)"
];
};
# Let the user access the chosen uClibc outside the derivation.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/science/logic/klee/klee-uclibc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ llvmPackages.stdenv.mkDerivation rec {
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"v(\d\.\d)"
"v(\\d\\.\\d)"
];
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/trivial-builders/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ rec {
(name: value:
{
inherit value;
name = lib.head (builtins.match "${builtins.storeDir}/[${nixHashChars}]+-(.*)\.drv" name);
name = lib.head (builtins.match "${builtins.storeDir}/[${nixHashChars}]+-(.*)\\.drv" name);
})
derivations;
# The syntax of output paths differs between outputs named `out`
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/av/av1an-unwrapped/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ rustPlatform.buildRustPackage rec {
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"'^(\d*\.\d*\.\d*)$'"
"'^(\\d*\\.\\d*\\.\\d*)$'"
];
};
};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/aw/awscli2/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ py.pkgs.buildPythonApplication rec {
# Excludes 1.x versions from the Github tags list
extraArgs = [
"--version-regex"
"^(2\.(.*))"
"^(2\\.(.*))"
];
};
tests.version = testers.testVersion {
Expand Down
14 changes: 7 additions & 7 deletions pkgs/by-name/ci/circt/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ stdenv.mkDerivation rec {
# https://github.com/NixOS/nixpkgs/issues/214945 discusses this issue.
#
# As a temporary fix, we disabled these tests when using clang stdenv
lib.optionals stdenv.cc.isClang [ "CIRCT :: Target/ExportSystemC/.*\.mlir" ]
lib.optionals stdenv.cc.isClang [ "CIRCT :: Target/ExportSystemC/.*\\.mlir" ]
# Disable some tests on x86_64-darwin
++ lib.optionals (stdenv.hostPlatform.system == "x86_64-darwin") [
# These test seem to pass on hydra (rosetta) but not on x86_64-darwin machines
"CIRCT :: Target/ExportSMTLIB/.*\.mlir"
"CIRCT :: circt-bmc/.*\.mlir"
"CIRCT :: Target/ExportSMTLIB/.*\\.mlir"
"CIRCT :: circt-bmc/.*\\.mlir"
# These tests were having issues on rosetta
"CIRCT :: Dialect/.*/Reduction/.*\.mlir"
"CIRCT :: Dialect/SMT/.*\.mlir"
"CIRCT :: circt-as-dis/.*\.mlir"
"CIRCT :: circt-reduce/.*\.mlir"
"CIRCT :: Dialect/.*/Reduction/.*\\.mlir"
"CIRCT :: Dialect/SMT/.*\\.mlir"
"CIRCT :: circt-as-dis/.*\\.mlir"
"CIRCT :: circt-reduce/.*\\.mlir"
"CIRCT :: circt-test/basic.mlir"
];
in
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/du/duplicity/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ let
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"rel\.(.*)"
"rel\\.(.*)"
];
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/ma/mattermost/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ buildGoModule rec {

passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version-regex" "^v(9\.11\.[0-9]+)$" ];
extraArgs = [ "--version-regex" "^v(9\\.11\\.[0-9]+)$" ];
};
tests.mattermost = nixosTests.mattermost;
};
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/pa/paperjam/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ stdenv.mkDerivation (finalAttrs: {
makeFlags = [
"PREFIX=$(out)"
# prevent real build date which is impure
"BUILD_DATE=\<unknown\>"
"BUILD_COMMIT=\<unknown\>"
"BUILD_DATE=\\<unknown\\>"
"BUILD_COMMIT=\\<unknown\\>"
];

# provide backward compatible PointerHolder, suppress deprecation warnings
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/pk/pkcs11-provider/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ stdenv.mkDerivation rec {
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"v(\d\.\d)"
"v(\\d\\.\\d)"
];
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/re/renode-unstable/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ renode.overrideAttrs (

passthru.updateScript =
let
versionRegex = "[0-9\.\+]+[^\+]*.";
versionRegex = "[0-9\\.\\+]+[^\\+]*.";
in
writeScript "${finalAttrs.pname}-updater" ''
#!/usr/bin/env nix-shell
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/te/teams/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ stdenv.mkDerivation {
zcat < Teams_osx_app.pkg/Payload | cpio -i
'';

sourceRoot = "Microsoft\ Teams.app";
sourceRoot = "Microsoft\\ Teams.app";
dontPatch = true;
dontConfigure = true;
dontBuild = true;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/tu/turbo-unwrapped/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ rustPlatform.buildRustPackage rec {
updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"'v(\d+\.\d+\.\d+)'"
"'v(\\d+\\.\\d+\\.\\d+)'"
];
};
};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/uu/uuu/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ stdenv.mkDerivation (finalAttrs: {
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"uuu_\([0-9.]+\)"
"uuu_\\([0-9.]+\\)"
];
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/vs/vscode-js-debug/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ buildNpmPackage rec {
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"v((?!\d{4}\.\d\.\d{3}).*)"
"v((?!\\d{4}\\.\\d\\.\\d{3}).*)"
];
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/mlton/20210117-binary.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
(fetchpatch {
name = "remove-duplicate-if.patch";
url = "https://github.com/MLton/mlton/commit/22002cd0a53a1ab84491d74cb8dc6a4e50c1f7b7.patch";
decode = "sed -e 's|Makefile\.binary|Makefile|g'";
decode = "sed -e 's|Makefile\\.binary|Makefile|g'";
hash = "sha256-Gtmc+OIh+m7ordSn74fpOKVDQDtYyLHe6Le2snNCBYQ=";
})
];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/pkgs-lib/formats/hocon/test/comprehensive/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let
"b"
]
];
nasty_string = "\"@\n\\\t^*\b\f\n\0\";'''$";
nasty_string = "\"@\n\\\t^*bf\n0\";'''$";

"misc attrs" = {
x = 1;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/pkgs-lib/formats/java-properties/test/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ stdenv.mkDerivation {
);

src = lib.sourceByRegex ./. [
".*\.java"
".*\\.java"
];
# On Linux, this can be C.UTF-8, but darwin + zulu requires en_US.UTF-8
LANG = "en_US.UTF-8";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let
1
])
];
nasty_string = "\"@\n\\\t^*\b\f\n\0\";'''$";
nasty_string = "\"@\n\\\t^*bf\n0\";'''$";

weirderTypes = {
_includes = [ include_file ];
Expand Down
3 changes: 2 additions & 1 deletion pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,8 @@ mapAliases {
nextcloud27Packages = throw "Nextcloud27 is EOL!"; # Added 2024-06-25
nagiosPluginsOfficial = monitoring-plugins;
neochat = libsForQt5.kdeGear.neochat; # added 2022-05-10
nerdfonts = throw ''nerdfonts has been separated into individual font packages under the namespace nerd-fonts.
nerdfonts = throw ''
nerdfonts has been separated into individual font packages under the namespace nerd-fonts.
For example change:
fonts.packages = [
...
Expand Down

0 comments on commit 4d263e0

Please sign in to comment.