Skip to content
Snippets Groups Projects
Commit 937ce0cd authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

* Flag `--no-link' suppresses symlinking to the output path.

* Handle multiple derivations correctly.
parent 966bd9d1
No related branches found
No related tags found
No related merge requests found
......@@ -8,27 +8,35 @@ if test -z "$nixExpr"; then
fi
extraArgs=
noLink=
for i in "$@"; do
case "$i" in
--no-link)
noLink=1
;;
-*)
extraArgs="$extraArgs $i"
;;
*)
storeExpr=$(nix-instantiate "$i")
for j in $storeExpr; do
storeExprs=$(nix-instantiate "$i")
for j in $storeExprs; do
echo "store expression is $j" >&2
done
outPath=$(nix-store -qnfv $extraArgs $storeExpr)
echo $outPath
if test -e result; then
if ! test -L result; then
echo "cannot remove \`result\' (not a symlink)"
exit 1
outPaths=$(nix-store -qnfv $extraArgs $storeExprs)
for j in $outPaths; do
echo "$j"
if test -z "$noLink"; then
if test -e result; then
if ! test -L result; then
echo "cannot remove \`result\' (not a symlink)"
exit 1
fi
rm result
fi
ln -s "$j" result
fi
rm result
fi
ln -s $outPath result
done
;;
esac
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment