aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-updatebuildenv
blob: d53510b199023002965a9a8017c8033ad02058b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#! /bin/bash

set -e 

. /usr/lib/pbuilder/pbuilder-checkparams
. /usr/lib/pbuilder/pbuilder-runhooks

function abortprocess () {
# function to do the aborting process in pbuilder-updatebuildenv
    umountproc
    cleanbuildplace    
}

CHROOTEXEC="chroot $BUILDPLACE "

test -n "$DISTRIBUTION" && echo "Upgrading for distribution $DISTRIBUTION" 

extractbuildplace

if [ -n "$HOOKDIR" ]; then
    loadhooks
fi
echo "Refreshing the base.tgz "
echo " -> upgrading packages"
$CHROOTEXEC /usr/bin/apt-get update || abortprocess
$CHROOTEXEC /usr/bin/dpkg --purge lilo || abortprocess
$CHROOTEXEC /usr/bin/apt-get -y dist-upgrade || abortprocess
$CHROOTEXEC /usr/bin/apt-get -y install build-essential dpkg-dev apt $EXTRAPACKAGES || abortprocess
$CHROOTEXEC /usr/bin/apt-get clean || abortprocess

if [ -n "$HOOKDIR" ]; then
    executehooks "X"
    unloadhooks
fi

umountproc
echo " -> creating base.tgz"
(cd "$BUILDPLACE"; tar cfz "$BASETGZ" *)
cleanbuildplace