@@ -121,7 +121,7 @@ let
121121 if [ -f "${src}" ]
122122 then
123123 # Figure out what directory has been unpacked
124− packageDir=$(find . -type d -maxdepth 1 | tail -1)
124+ packageDir="$(find . -type d -maxdepth 1 | tail -1)"
125125
126126 # Restore write permissions to make building work
127127 find "$packageDir" -type d -print0 | xargs -0 chmod u+x
@@ -131,6 +131,8 @@ let
131131 mv "$packageDir" "$DIR/${packageName}"
132132 elif [ -d "${src}" ]
133133 then
134+ strippedName="$(stripHash ${src})"
135+
134136 # Restore write permissions to make building work
135137 chmod -R u+w $strippedName
136138
@@ -138,9 +140,6 @@ let
138140 mv $strippedName "$DIR/${packageName}"
139141 fi
140142
141− # Unset the stripped name to not confuse the next unpack step
142− unset strippedName
143−
144143 # Some version specifiers (latest, unstable, URLs, file paths) force NPM to make remote connections or consult paths outside the Nix store.
145144 # The following JavaScript replaces these by * to prevent that
146145 cd "$DIR/${packageName}"