From: Arne Fitzenreiter Date: Tue, 8 Mar 2016 18:31:49 +0000 (+0100) Subject: core100: add function to set last correct installed core on update. X-Git-Tag: v2.19-core100~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f83c50537bcb4b74bebcff83f86f69b60def544f;p=ipfire-2.x.git core100: add function to set last correct installed core on update. Signed-off-by: Arne Fitzenreiter --- diff --git a/config/rootfiles/core/100/update.sh b/config/rootfiles/core/100/update.sh index 8745ff1427..6b17a65b53 100644 --- a/config/rootfiles/core/100/update.sh +++ b/config/rootfiles/core/100/update.sh @@ -24,8 +24,17 @@ . /opt/pakfire/lib/functions.sh /usr/local/bin/backupctrl exclude >/dev/null 2>&1 -# Remove old core updates from pakfire cache to save space... core=100 + +function exit_with_error() { + # Set last succesfull installed core. + echo $(($core-1)) > /opt/pakfire/db/core/mine + /usr/bin/logger -p syslog.emerg -t ipfire \ + "core-update-${core}: $1" + exit $2 +} + +# Remove old core updates from pakfire cache to save space... for (( i=1; i<=$core; i++ )) do rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire