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

« back to all changes in this revision

Viewing changes to tests/test-data-cdrom/cdromupgrade

  • Committer: Balint Reczey
  • Date: 2019-12-17 20:29:52 UTC
  • Revision ID: balint.reczey@canonical.com-20191217202952-ci93ah9xs51wnf0b
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
 
# WARNING: make sure to call it with a absolute path!
10
 
#          (e.g. /cdrom/cdromupgrade)
11
 
 
12
 
# the codename is AUTO-GENERATED from the build-host relase codename
13
 
CODENAME=intrepid
14
 
UPGRADER_DIR=dists/stable/main/dist-upgrader/binary-all/
15
 
 
16
 
cddirname="${0%\/*}"
17
 
fullpath="$cddirname/$UPGRADER_DIR"
18
 
 
19
 
# extrace the tar to a TMPDIR and run it from there
20
 
if [ ! -f "$fullpath/$CODENAME.tar.gz" ]; then
21
 
    echo "Could not find the upgrade application archive, exiting"
22
 
    exit 1
23
 
fi
24
 
 
25
 
TMPDIR=$(mktemp -d)
26
 
cd $TMPDIR
27
 
tar xzf "$fullpath/$CODENAME.tar.gz"
28
 
if [ ! -x $TMPDIR/$CODENAME ]; then
29
 
    echo "Could not find the upgrade application in the archive, exiting"
30
 
    exit 1
31
 
fi
32
 
$TMPDIR/$CODENAME --cdrom "$cddirname" $@