From fdada4a45fcf8905b61448094f4de388a89fb444 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Fri, 3 May 2019 12:56:44 -0400 Subject: nukeReferences: fix for store paths with special characters (like '+' or '.') This introduces extra escaping for $NIX_STORE that gets interpolated into a PCRE. The escaping is performed using a standard Perl function "quotemeta" (see "perldoc -f quotemeta" for reference). The same value is also used in sed regex which uses POSIX basic regular expressions instead of PCRE, so it needs fewer characters to be escaped. It should not cause much problem to not change sed invocation, but I replace it with equivalent Perl expression (actually the behavior is changed to not output a newline character after the matched output). --- pkgs/build-support/nuke-references/builder.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/build-support/nuke-references') diff --git a/pkgs/build-support/nuke-references/builder.sh b/pkgs/build-support/nuke-references/builder.sh index 02eac664d4371..7da322032185d 100644 --- a/pkgs/build-support/nuke-references/builder.sh +++ b/pkgs/build-support/nuke-references/builder.sh @@ -7,7 +7,7 @@ cat > $out/bin/nuke-refs < "\$i.tmp" + cat "\$i" | $perl/bin/perl -pe "s|\Q$NIX_STORE\E/\$excludes[a-z0-9]{32}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" > "\$i.tmp" if test -x "\$i"; then chmod +x "\$i.tmp"; fi mv "\$i.tmp" "\$i" fi -- cgit 1.4.1