~ubuntu-branches/ubuntu/karmic/sbuild/karmic

« back to all changes in this revision

Viewing changes to bin/checkchroot

  • Committer: Bazaar Package Importer
  • Author(s): Rick Younie
  • Date: 2002-03-03 21:51:51 UTC
  • Revision ID: james.westby@ubuntu.com-20020303215151-50oderv821xp634e
Tags: 0.4
made /etc/sbuild.conf a conffile - thanks Gergely Nagy.
(Closes: #136374)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
 
 
3
# check the package list in a chroot against a reference.
 
4
# reference files: ppack -r un -Iq '*' >/usr/local/chroot/ref-un (& -st, -fr)
 
5
 
 
6
case $1 in
 
7
        -s|st|stable )
 
8
                DIST=stable ;;
 
9
        -f|fr|frozen )
 
10
                DIST=frozen ;;
 
11
        -u|un|unstable )
 
12
                DIST=unstable ;;
 
13
         * )
 
14
                echo "Usage: checkchroot stable|frozen|unstable" >&2
 
15
                echo "(can abbr. chroot name to first 2 letters or -X)" >&2
 
16
                exit 1 ;;
 
17
esac
 
18
 
 
19
# see if the chroot root directory is set in environment, else use default
 
20
if [ ! -z "$SBUILD_CHROOT_ROOT" ]; then
 
21
        CHROOT_ROOT=$SBUILD_CHROOT_ROOT
 
22
else
 
23
        CHROOT_ROOT=/usr/local/chroot
 
24
fi
 
25
CHROOT=$CHROOT_ROOT/$DIST
 
26
 
 
27
tfile=$(tempfile)
 
28
 
 
29
#ppack -Iq '*' -r $CHROOT >$tfile
 
30
COLUMNS=200 dpkg 2>/dev/null --root=$CHROOT --list |
 
31
        awk '/^i/ {print $2}' >$tfile
 
32
 
 
33
echo "DELETE             ADD"
 
34
echo "============================"
 
35
diff -u $tfile $CHROOT_ROOT/ref-$DIST |
 
36
        tail +3 |
 
37
        grep ^[+-] |
 
38
        sed -e 's/^-//' -e "s/^+/                   /" |
 
39
        sort
 
40
 
 
41
rm $tfile
 
42