summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-07-28 04:20:26 +0300
committerArtturin <Artturin@artturin.com>2023-07-28 04:20:26 +0300
commit9816ca55c2fd0619542f420f8e6cfaa8ebaf4ea8 (patch)
tree069fc3a6b9ef58d8e2179328adcef9e5c180c323 /pkgs/stdenv/generic
parent1fb560746e1f06f4f32b0ff76da3309f9284e618 (diff)
downloadnixpkgs-9816ca55c2fd0619542f420f8e6cfaa8ebaf4ea8.tar
nixpkgs-9816ca55c2fd0619542f420f8e6cfaa8ebaf4ea8.tar.gz
nixpkgs-9816ca55c2fd0619542f420f8e6cfaa8ebaf4ea8.tar.bz2
nixpkgs-9816ca55c2fd0619542f420f8e6cfaa8ebaf4ea8.tar.lz
nixpkgs-9816ca55c2fd0619542f420f8e6cfaa8ebaf4ea8.tar.xz
nixpkgs-9816ca55c2fd0619542f420f8e6cfaa8ebaf4ea8.tar.zst
nixpkgs-9816ca55c2fd0619542f420f8e6cfaa8ebaf4ea8.zip
stdenv: Make condition clearer
-z checks for a empty string
-n checks for a not empty string

It makes more sense to run the chmod if the string is not empty
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/setup.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 1f596ada5a0..7fe5f67b14d 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -1594,7 +1594,7 @@ genericBuild() {
 
         if [ "$curPhase" = unpackPhase ]; then
             # make sure we can cd into the directory
-            [ -z "${sourceRoot}" ] || chmod +x "${sourceRoot}"
+            [ -n "${sourceRoot:-}" ] && chmod +x "${sourceRoot}"
 
             cd "${sourceRoot:-.}"
         fi