summaryrefslogtreecommitdiff
path: root/functions/exit.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2011-07-19 11:13:17 +0200
committerDaniel Baumann <daniel@debian.org>2011-07-19 11:13:17 +0200
commiteb2a305a5f692a1661001bae1c8e6d202f4280e9 (patch)
tree866057eafab09594f33b849b4c754f55bbe2854b /functions/exit.sh
parent691b06f7a6f08e82967b188cc31d1dcb6737bce5 (diff)
downloadvyos-live-build-eb2a305a5f692a1661001bae1c8e6d202f4280e9.tar.gz
vyos-live-build-eb2a305a5f692a1661001bae1c8e6d202f4280e9.zip
Saving packages in cache even when failing or interrupting a build (Closes: #586929).
Diffstat (limited to 'functions/exit.sh')
-rwxr-xr-xfunctions/exit.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/functions/exit.sh b/functions/exit.sh
index b6f2e2bfe..ad17c1e50 100755
--- a/functions/exit.sh
+++ b/functions/exit.sh
@@ -35,6 +35,19 @@ Exit ()
done
fi
+ Echo_message "Saving chaches..."
+
+ # We can't really know at which part we're failing,
+ # but let's assume that if there's any binary stage file arround
+ # we are in binary stage.
+
+ if ls .stage/binary* > /dev/null 2>&1
+ then
+ Save_cache cache/packages_binary
+ else
+ Save_cache cache/packages_chroot
+ fi
+
return ${VALUE}
}