From e18caa0c79d0a7961bf5e9bfaf8e0f615baaea1a Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Sat, 20 Feb 2021 00:36:10 +0000 Subject: [PATCH] Fix interrupted cache dir for projects without a version --- rbm.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rbm.conf b/rbm.conf index 4ea1ab0..cd2f037 100644 --- a/rbm.conf +++ b/rbm.conf @@ -506,13 +506,13 @@ runc: set -e # Handle SIGINT case - if [ -d '[% c("rbm_tmp_dir") %]'/../interrupted_dirs/'[% c("var/build_id") %]' ] + if [ -d '[% c("rbm_tmp_dir") %]'/../interrupted_dirs/'[% sha256(dest_dir _ '/' _ c("filename")) %]' ] then # We previously did this build but it was manually interrupted. # Restore the container's saved state instead of making a new container. mkdir -p '[% c("var/container/dir") %]' rmdir '[% c("var/container/dir") %]' - mv '[% c("rbm_tmp_dir") %]'/../interrupted_dirs/'[% c("var/build_id") %]' '[% c("var/container/dir") %]' + mv '[% c("rbm_tmp_dir") %]'/../interrupted_dirs/'[% sha256(dest_dir _ '/' _ c("filename")) %]' '[% c("var/container/dir") %]' exit fi @@ -600,7 +600,7 @@ runc: # Save the container's state instead of deleting, so we can resume # the build later. mkdir -p '[% c("rbm_tmp_dir") %]'/../interrupted_dirs - mv '[% c("var/container/dir") %]' '[% c("rbm_tmp_dir") %]'/../interrupted_dirs/'[% c("var/build_id") %]' + mv '[% c("var/container/dir") %]' '[% c("rbm_tmp_dir") %]'/../interrupted_dirs/'[% sha256(dest_dir _ '/' _ c("filename")) %]' rm '[% c("rbm_tmp_dir") %]'/../interrupted exit fi