tvl-depot/scripts/nix-build.in
Eelco Dolstra 3d1b2101cc * Place manifests in /nix/var/nix/manifests.
* Use the new patch downloader.
2004-12-20 16:38:50 +00:00

41 lines
964 B
Text

#! @shell@ -e
nixExpr=$1
if test -z "$nixExpr"; then
echo "syntax: $0 NIX-EXPR..." >&2
exit 1
fi
extraArgs=
noLink=
for i in "$@"; do
case "$i" in
--no-link)
noLink=1
;;
-*)
extraArgs="$extraArgs $i"
;;
*)
storeExprs=$(nix-instantiate "$i")
for j in $storeExprs; do
echo "store expression is $j" >&2
done
outPaths=$(nix-store -qnfv $extraArgs $storeExprs)
for j in $outPaths; do
echo "$j"
if test -z "$noLink"; then
if test -L result; then
rm result
elif test -e result; then
echo "cannot remove \`result' (not a symlink)"
exit 1
fi
ln -s "$j" result
fi
done
;;
esac
done