~ubuntu-core-dev/ubuntu-release-upgrader/trunk

« back to all changes in this revision

Viewing changes to DistUpgrade/cdromupgrade

  • Committer: Balint Reczey
  • Date: 2019-12-17 20:29:55 UTC
  • Revision ID: balint.reczey@canonical.com-20191217202955-nqe4xz2c54s60y59
Moved to git at https://git.launchpad.net/ubuntu-release-upgrader

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
#
3
 
# "cdromupgrade" is a shell script wrapper around the dist-upgrader
4
 
# to make it possible to put it onto the top-level dir of a CD and
5
 
# run it from there
6
 
7
 
# Not that useful unfortunately when the CD is mounted "noexec".
8
 
#
9
 
 
10
 
# the codename is AUTO-GENERATED from the build-host relase codename
11
 
CODENAME=vivid
12
 
UPGRADER_DIR=dists/$CODENAME/main/dist-upgrader/binary-all/
13
 
 
14
 
# this script can be called in three ways:
15
 
#   sh /cdrom/cdromugprade
16
 
#   sh ./cdromupgrade
17
 
#   sh cdromupgrade
18
 
# the sh below is needed to figure out the cdromdirname
19
 
case "$0" in
20
 
/*)  cddirname="${0%\/*}" ;;
21
 
*/*) cddirname="$(pwd)/${0%\/*}" ;;
22
 
*)   cddirname="$(pwd)/" ;;
23
 
esac
24
 
 
25
 
fullpath="$cddirname/$UPGRADER_DIR"
26
 
 
27
 
# extract the tar to a TMPDIR and run it from there
28
 
if [ ! -f "$fullpath/$CODENAME.tar.gz" ]; then
29
 
    echo "Could not find the upgrade application archive, exiting"
30
 
    exit 1
31
 
fi
32
 
 
33
 
TMPDIR=$(mktemp -d)
34
 
cd $TMPDIR
35
 
tar xzf "$fullpath/$CODENAME.tar.gz"
36
 
if [ ! -x $TMPDIR/$CODENAME ]; then
37
 
    echo "Could not find the upgrade application in the archive, exiting"
38
 
    exit 1
39
 
fi
40
 
$TMPDIR/$CODENAME --cdrom "$cddirname" $@