dagger: Keep abandoned generations around for debugging

When evolving to a new generation fails, users will typically abandon
it (so that a new attempt can be made).  However, the generated
scripts and the logged output is very valuable from a debugging
perspective.

Therefore, keep the data around by just renaming the generation
directory.

Later, we can include these directories in the garbage collecting
process, if we want to.
This commit is contained in:
Tobias Waldekranz
2023-06-01 15:16:39 +02:00
parent af298a0a05
commit a9c5fccd47
+2 -1
View File
@@ -78,7 +78,8 @@ do_abandon()
[ "$next" ] && [ -d "$basedir/$next" ] \
|| abort "Next generation does not exist"
rm -rf "$basedir/$next" "$basedir/next"
mv "$basedir/$next" "$basedir/$next-ABANDONED-$(date +%F-%T)"
rm "$basedir/next"
inform info "Abandoned generation $next"
}