Re: [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts.

2016-02-10 Thread Ludovic Courtès
Jan Nieuwenhuizen skribis: > Ludovic Courtès writes: > >> How does the script determines its location? Using $0 is unreliable, >> and using /proc/self/exe is non portable. > > It uses node.js's __dirname. I would have to dive into node.js > internals to figure that out... I would think it does

Re: [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts.

2016-02-09 Thread Jan Nieuwenhuizen
Ludovic Courtès writes: > How does the script determines its location? Using $0 is unreliable, > and using /proc/self/exe is non portable. It uses node.js's __dirname. I would have to dive into node.js internals to figure that out... I would think it does /proc/self/exe and has fallbacks for o

Re: [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts.

2016-02-09 Thread Jan Nieuwenhuizen
Ludovic Courtès writes: > Out of curiosity, what package was this? I encountered it first in jison, a javascript parser generator. > Since this is a rebuild-the-world change, I applied to to a new > ‘core-updates’ branch (and adjusted the commit log.) Yes, I got bitten by that, trying to test i

Re: [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts.

2016-02-09 Thread Ludovic Courtès
Jan Nieuwenhuizen skribis: > Ludovic Courtès writes: > >> Out of curiosity, what package was this? > > I encountered it first in jison, a javascript parser generator. How does the script determines its location? Using $0 is unreliable, and using /proc/self/exe is non portable. >> Since this is

Re: [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts.

2016-02-09 Thread Ludovic Courtès
Jan Nieuwenhuizen skribis: > When patch-shebang encounters a script that is a symlink, say > > bin/script -> ../lib/foo/thescript > > it will change it into a file with rewritten #! . That breaks whenever > `thescript' assumes it lives in lib/foo. Out of curiosity, what package was this? >