[ "$check" != "true" ] && checkmsg="if '$check'"
if eval $check; then
log "$(printf 'action %02d' $lineno) starting: '${action}' $checkmsg "
- eval $action
- log "$(printf 'action %02d' $lineno) finished: '${action}' $checkmsg"
+ if ! eval $action; then
+ log "$(printf 'action %02d' $lineno) failed: '${action}' $checkmsg "
+ display_action_failure "$action"
+ exit 1
+ else
+ log "$(printf 'action %02d' $lineno) finished: '${action}' $checkmsg"
+ fi
else
log "$(printf 'action %02d' $lineno) skipping: '${action}' $checkmsg"
fi
log "-----"
}
+# report action failure
+display_action_failure () {
+ local action=$1
+
+ notice "
+Doslo je do greske prilikom izvrsavanja akcije '$action'. Detalje problema moguce je vidjeti u log datotekama:
+
+ /var/log/carnet-upgrade.log
+ /var/log/carnet-upgrade.typescript
+
+Da bi dovrsili zapocete operacije nad paketima pokrenite:
+
+ # dpkg --configure -a
+ # apt-get -f install
+
+Nakon toga ponovno pozovite carnet-upgrade skriptu."
+}
+
# funkcija vraca popis paketa koje treba upgradeati
what_upgrade () {
local IFSOLD name version package