2004-06-22 17:12:34 +02:00
|
|
|
#! @shell@ -e
|
|
|
|
|
|
|
|
nixExpr=$1
|
|
|
|
|
|
|
|
if test -z "$nixExpr"; then
|
|
|
|
echo "syntax: $0 NIX-EXPR..." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
extraArgs=
|
|
|
|
|
|
|
|
for i in "$@"; do
|
|
|
|
case "$i" in
|
|
|
|
-*)
|
|
|
|
extraArgs="$extraArgs $i"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
storeExpr=$(nix-instantiate "$i")
|
2004-06-22 17:17:04 +02:00
|
|
|
for j in $storeExpr; do
|
|
|
|
echo "store expression is $j" >&2
|
|
|
|
done
|
2004-07-28 15:32:45 +02:00
|
|
|
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
|
|
|
|
fi
|
|
|
|
rm result
|
|
|
|
fi
|
|
|
|
ln -s $outPath result
|
2004-06-22 17:12:34 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|