garlic tool: check the presence of all the units

This check prevents a user from removing units between the
execution of the experiment and the fetch.
This commit is contained in:
Rodrigo Arias 2021-04-07 11:49:35 +02:00
parent b96c39e0ba
commit 26e3a86c78

View File

@ -105,6 +105,10 @@ do_fetch() {
exit 1
fi
unitNameList=$(grep '^/nix/store/.*-unit$' $experiment |\
sort -u |\
sed 's@^/nix/store/@@')
cwd=$(pwd)
repeat=1
@ -113,10 +117,13 @@ do_fetch() {
cd $exp
test $verbose && >&2 echo "$exp: checking units"
for unit in *-unit; do
for unit in $unitNameList; do
if [ ! -e $exp/$unit ]; then
test $verbose && >&2 echo "$unit: missing unit"
repeat=1
else
cd $exp/$unit
if [ ! -e status ]; then
test $verbose && >&2 echo "$unit: no status"
repeat=1
else
@ -126,6 +133,7 @@ do_fetch() {
repeat=1
fi
fi
fi
done
if [ $repeat -eq 0 ]; then