~ubuntu-core-dev/update-notifier/ubuntu

« back to all changes in this revision

Viewing changes to data/cddistupgrader

  • Committer: dann frazier
  • Date: 2020-02-04 02:27:07 UTC
  • Revision ID: dannf@ubuntu.com-20200204022707-37vu1ltkpx2m2t5x
tests/test_motd.py: Fix cut & paste error in comment.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
 
 
4
CDROM_MOUNT="$1"
 
5
 
 
6
for d in "$CDROM_MOUNT"/dists/*/main/dist-upgrader/binary-all/; do
 
7
    if [ -d "$d" ]; then
 
8
        UPGRADER_DIR="$d"
 
9
        break
 
10
    fi
 
11
done
 
12
 
 
13
TAR=$(basename "$UPGRADER_DIR"/*.tar.gz)
 
14
CODENAME=${TAR%.tar.gz}
 
15
 
 
16
# get a tempdir
 
17
TMPDIR=$(mktemp -t -d distupgrade.XXXXXX)
 
18
cd $TMPDIR
 
19
 
 
20
# extract the tar
 
21
tar xzf "$UPGRADER_DIR"/"$TAR"
 
22
 
 
23
# apply any patches needed before running the upgrade
 
24
for apatch in /usr/share/update-notifier/upgrader-patches/*.diff; do
 
25
    if patch --dry-run < "$apatch"; then
 
26
        patch < "$apatch"
 
27
    fi
 
28
done
 
29
 
 
30
# run it
 
31
"$TMPDIR"/"$CODENAME" --cdrom "$CDROM_MOUNT"