Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #45285 from kini/makeself

makeself: backport megastep/makeself#142

authored by

Jörg Thalheim and committed by
GitHub
4e18bc85 807d73c3

+47 -1
+43
pkgs/applications/misc/makeself/Use-rm-from-PATH.patch
··· 1 + From 81cf57e4653360af7f1718391e424fa05d8ea000 Mon Sep 17 00:00:00 2001 2 + From: Keshav Kini <keshav.kini@gmail.com> 3 + Date: Thu, 9 Aug 2018 18:36:15 -0700 4 + Subject: [PATCH] Use `rm` from PATH 5 + 6 + On NixOS (a Linux distribution), there is no `/bin/rm`, but an `rm` 7 + command will generally be available in one's path when running shell 8 + scripts. Here, I change a couple of invocations of `/bin/rm` into 9 + invocations of `rm` to deal with this issue. 10 + 11 + Since `rm` is already called elsewhere in the script without an 12 + absolute path, I assume this change will not cause any 13 + regressions. Still, I've tested this on a CentOS machine and a NixOS 14 + machine, though not other platforms. 15 + --- 16 + makeself-header.sh | 4 ++-- 17 + 1 file changed, 2 insertions(+), 2 deletions(-) 18 + 19 + diff --git a/makeself-header.sh b/makeself-header.sh 20 + index 4d2c005..2babf34 100755 21 + --- a/makeself-header.sh 22 + +++ b/makeself-header.sh 23 + @@ -515,7 +515,7 @@ if test x"\$quiet" = xn; then 24 + fi 25 + res=3 26 + if test x"\$keep" = xn; then 27 + - trap 'echo Signal caught, cleaning up >&2; cd \$TMPROOT; /bin/rm -rf "\$tmpdir"; eval \$finish; exit 15' 1 2 3 15 28 + + trap 'echo Signal caught, cleaning up >&2; cd \$TMPROOT; rm -rf "\$tmpdir"; eval \$finish; exit 15' 1 2 3 15 29 + fi 30 + 31 + if test x"\$nodiskspace" = xn; then 32 + @@ -581,7 +581,7 @@ if test x"\$script" != x; then 33 + fi 34 + if test x"\$keep" = xn; then 35 + cd "\$TMPROOT" 36 + - /bin/rm -rf "\$tmpdir" 37 + + rm -rf "\$tmpdir" 38 + fi 39 + eval \$finish; exit \$res 40 + EOF 41 + -- 42 + 2.14.1 43 +
+4 -1
pkgs/applications/misc/makeself/default.nix
··· 11 11 sha256 = "1lw3gx1zpzp2wmzrw5v7k31vfsrdzadqha9ni309fp07g8inrr9n"; 12 12 }; 13 13 14 - patchPhase = '' 14 + # backported from https://github.com/megastep/makeself/commit/77156e28ff21231c400423facc7049d9c60fd1bd 15 + patches = [ ./Use-rm-from-PATH.patch ]; 16 + 17 + postPatch = '' 15 18 sed -e "s|^HEADER=.*|HEADER=$out/share/${name}/makeself-header.sh|" -i makeself.sh 16 19 ''; 17 20