File: cdromupgrade

package info (click to toggle)
update-manager 0.68.debian-7
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,796 kB
  • ctags: 814
  • sloc: python: 5,646; xml: 1,571; sh: 433; makefile: 356; ansic: 264
file content (32 lines) | stat: -rwxr-xr-x 933 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
#
# "cdromupgrade" is a shell script wrapper around the dist-upgrader
# to make it possible to put it onto the top-level dir of a CD and
# run it from there
# 
# Not that useful unfortunately when the CD is mounted "noexec".
#
# WARNING: make sure to call it with a absolute path!
#          (e.g. /cdrom/cdromugprade)

# the codename is AUTO-GENERATED from the build-host relase codename
CODENAME=feisty
UPGRADER_DIR=dists/stable/main/dist-upgrader/binary-all/

cddirname=${0%\/*}
fullpath=$cddirname/$UPGRADER_DIR

# extrace the tar to a TMPDIR and run it from there
if [ ! -f $fullpath/$CODENAME.tar.gz ]; then
    echo "Could not find the upgrade application archive, exiting"
    exit 1
fi

TMPDIR=$(mktemp -d)
cd $TMPDIR
tar xzf $fullpath/$CODENAME.tar.gz
if [ ! -x $TMPDIR/$CODENAME ]; then
    echo "Could not find the upgrade application in the archive, exiting"
    exit 1
fi
$TMPDIR/$CODENAME --cdrom $cddirname