2 # last update: 2005-01-07
3 # Zoran 'jelly' Dzelajlija <jelly@srce.hr>
4 # Ivan 'ico' Rako <irako@srce.hr>
5 version="carnet-upgrade v4.0.0"
7 # restart upgrade under script for logging purposes
8 if [ "$1" == "--no-script" ]; then
10 elif [ -x /usr/bin/script ]; then
11 exec /usr/bin/script -a -t -f -c "$0 --no-script $@" \
12 /var/log/carnet-upgrade.typescript 2>>/var/log/carnet-upgrade.timing
19 #ROOT=/home/jelly/work/src/carnet-upgrade
20 # make apt-get simulate-only for debug
26 cnup="/usr/share/carnet-upgrade"
28 . ${ROOT}${cnup}/data.sh
29 . ${ROOT}${cnup}/messages.sh
30 . ${ROOT}${cnup}/functions.sh
32 main_queuetab="${cnup}/actions/main.queue"
33 post_upgrade_queuetab="/var/lib/carnet-upgrade/post_upgrade.queue"
35 # logika kako slijedi:
36 # imamo popis testova i akcija koje ce se izvrsiti svakog testa
37 # ("queuetab" datoteka)
39 # akcije se izvrsavaju redoslijedom iz popisa
41 # neke akcije imaju dio koji se izvrsava prije i dio koji se izvrsava nakon
42 # upgradea, svaka takva akcija dodaje svoj post-upgrade dio akcije u
43 # zasebni red akcija, i onda se to izvrsava nakon upgradea na isti nacin
44 # kao glavni red akcija.
46 # queuetab file format:
49 # eg. "pkg xinetd-cn lt 2:0 do_xinetd" means:
50 # if there is a version of xinetd-cn lower than 2:0 installed,
51 # invoke do_xinetd function
53 # pkg tests if a package is installed, optional arguments like
54 # dpkg --compare-versions
56 # Sanitize environment
60 PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/share/carnet-upgrade/scripts
61 unset LC_CTYPE LC_COLLATE LC_TIME LC_NUMERIC || true
65 queuetab="$main_queuetab"
67 elif [ -f "${cnup}/actions/$1.queue" ]; then
68 queuetab="${cnup}/actions/$1.queue"
71 elif [ -f "$1" ]; then
75 elif [ "x$1" = "x-h" -o "x$1" = "x--help" ]; then
80 echo "Nepoznati argumenti: $*" 1>&2
85 # need this to get custom msg_finished for "sarge" run
89 run_actions "$queuename" "$queuetab"