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

« back to all changes in this revision

Viewing changes to data/apt-cdrom-check

  • Committer: Michael Vogt
  • Date: 2008-11-10 18:04:02 UTC
  • Revision ID: michael.vogt@ubuntu.com-20081110180402-lvolg0ct1xr4vqoi
* debian/update-notifier-common.install:
  - move apt-check, apt-cdrom-check and cdromdistupgrade
    into update-notifier-common

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
#
3
 
# helper to check if we actually have an ubuntu CD
 
3
# helper to check if we actually have a ubuntu CD
4
4
#
5
5
# Returncode:
6
6
# 0 - no ubuntu CD
8
8
# 2 - dist-upgrader CD
9
9
# 3 - addon CD
10
10
# 4 - aptoncd media
11
 
# (if the returncodes change, make sure to update src/gdu.c)
 
11
# (if the returncodes change, make sure to update src/hal.c)
12
12
13
13
 
14
14
mount_point="$1"
33
33
# debian-installer dir)
34
34
find "$mount_point/dists/"  -name "Packages.gz" | grep -q -v debian-installer
35
35
 
36
 
# 1 means "no lines were selected" in grep (no Packages file but the 
 
36
# 1 means "no lines where selected" in grep (no Packages file but the 
37
37
# debian-installer ones)
38
38
if [ $? -eq 1 ]; then
39
39
    exit 0
55
55
# identifying ... [afkdsjaf] line
56
56
line=$(apt-cdrom -d="$1" -m ident|grep "\[.*\]")
57
57
 
58
 
# remove the stuff before "Identifying... [dasjflkd]" -> "dasjflkd"
 
58
# remove the stuff before "Identifiyng... [dasjflkd]" -> "dasjflkd"
59
59
line=${line%]*}
60
60
cdrom_id=${line#*\[}
61
61
 
62
62
if [ -z "$cdrom_id" ]; then
63
 
    # something bad happened here, we return "not yet scanned" as 
 
63
    # something bad happend here, we return "not yet scanned" as 
64
64
    # fallback (because we are cheap)
65
65
    return 1
66
66
fi
67
67
 
68
68
# we always return ADDON cd regardless if we know it already or not
69
 
# the rationale is that it easier for people this way and less 
 
69
# the rational is that it easier for people this way and less 
70
70
# confusing
71
 
if [ -d "$addon_dir" ] && [ -x /usr/bin/gnome-app-install ]; then
 
71
if [ -d "$addon_dir" ]; then
72
72
    exit 3
73
73
fi
74
74
 
91
91
    fi
92
92
fi
93
93
 
94
 
# we got an ubuntu CD with packages
 
94
# we got a ubuntu CD with packages
95
95
exit 1