1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00
nixpkgs/pkgs/stdenv/generic
Bjørn Forsman f4f0d2ecb9 stdenv/setup.sh: fix breakage when shebang contains '\'
Some programs, e.g. guile-config, has a shebang that ends in '\':

  #!/usr/bin/guile-1.8 \
  -e main -s
  !#
  ;;;; guile-config --- utility for linking programs with Guile
  ;;;; Jim Blandy <jim@red-bean.com> --- September 1997

This currently breaks patchShebangs:

  $ read oldPath arg0 args <<< 'shebang \'; echo $?
  1
  $ echo $oldPath
  shebang
  $ echo $arg0

  $ echo $args

(And setup.sh/patchShebangs is run with 'set -e' so any command that
return non-zero aborts the build.)

Fix by telling 'read' to not interpret backslashes (with the -r flag):

  $ read -r oldPath arg0 args <<< 'shebang \'; echo $?
  0
  $ echo $oldPath
  shebang
  $ echo $arg0
  \
  $ echo $args

Also needed: escape the escape characters so that sed doesn't interpret
them.
2014-01-03 14:47:39 +01:00
..
builder.sh Revert "Merge pull request #229 from viric/niximpure2-stdenv-updates" 2012-12-28 15:46:45 +01:00
default-builder.sh * "." -> "source". 2005-12-05 14:11:09 +00:00
default.nix Merge remote-tracking branch 'origin/master' into stdenv-updates. 2013-12-04 18:33:52 +01:00
setup-repeatable.sh Kindly ask strip to not mess up timestamps in static libraries 2013-06-25 11:15:45 +03:00
setup.sh stdenv/setup.sh: fix breakage when shebang contains '\' 2014-01-03 14:47:39 +01:00