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:
parent
b96c39e0ba
commit
26e3a86c78
@ -105,6 +105,10 @@ do_fetch() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unitNameList=$(grep '^/nix/store/.*-unit$' $experiment |\
|
||||||
|
sort -u |\
|
||||||
|
sed 's@^/nix/store/@@')
|
||||||
|
|
||||||
cwd=$(pwd)
|
cwd=$(pwd)
|
||||||
|
|
||||||
repeat=1
|
repeat=1
|
||||||
@ -113,17 +117,21 @@ do_fetch() {
|
|||||||
cd $exp
|
cd $exp
|
||||||
test $verbose && >&2 echo "$exp: checking units"
|
test $verbose && >&2 echo "$exp: checking units"
|
||||||
|
|
||||||
for unit in *-unit; do
|
for unit in $unitNameList; do
|
||||||
cd $exp/$unit
|
if [ ! -e $exp/$unit ]; then
|
||||||
if [ ! -e status ]; then
|
test $verbose && >&2 echo "$unit: missing unit"
|
||||||
|
|
||||||
test $verbose && >&2 echo "$unit: no status"
|
|
||||||
repeat=1
|
repeat=1
|
||||||
else
|
else
|
||||||
st=$(cat status)
|
cd $exp/$unit
|
||||||
test $verbose && >&2 echo "$unit: $st"
|
if [ ! -e status ]; then
|
||||||
if [ "$st" != "completed" ]; then
|
test $verbose && >&2 echo "$unit: no status"
|
||||||
repeat=1
|
repeat=1
|
||||||
|
else
|
||||||
|
st=$(cat status)
|
||||||
|
test $verbose && >&2 echo "$unit: $st"
|
||||||
|
if [ "$st" != "completed" ]; then
|
||||||
|
repeat=1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user