mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-14 15:17:50 +00:00
generic/setup.sh: handle $sourceRoot that starts with dash
Without the change `runPhase` fails on tarballs like `diffoscope-269` that contain single top-level `-269` root as: diffoscope> unpacking source archive /nix/store/p620nidkm73vrp0z6kk5krmrm4vg7bxd-diffoscope-269.tar.bz2 diffoscope> source root is -269 diffoscope> setting SOURCE_DATE_EPOCH to timestamp 1717143039 of file ./-269/tests/utils/versions.py diffoscope> chmod: invalid mode: ‘-269’ diffoscope> Try 'chmod --help' for more information. Currently `diffoscope-269` has a `sourceRoot = "./-269";` workaround to bypass the failure.
This commit is contained in:
parent
a3f1b476c7
commit
193fd8a237
@ -1577,9 +1577,9 @@ runPhase() {
|
||||
|
||||
if [ "$curPhase" = unpackPhase ]; then
|
||||
# make sure we can cd into the directory
|
||||
[ -n "${sourceRoot:-}" ] && chmod +x "${sourceRoot}"
|
||||
[ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"
|
||||
|
||||
cd "${sourceRoot:-.}"
|
||||
cd -- "${sourceRoot:-.}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user