aboutsummaryrefslogtreecommitdiff
path: root/pbuilder
blob: 1f9df25706c87ae6bfa7f23af0e96c826359f039 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /bin/bash
# pbuilder by Junichi Uekawa <dancer@debian.org> 2001 Aug 25
# Copyright 2001,2002 Junichi Uekawa
#Distributed under GPL version 2 or later

set -e 

# export this so that programs know which command line
# operation is currently done
export PBCURRENTCOMMANDLINEOPERATION="$1"

case "$1" in
    create)
	shift;
	/usr/lib/pbuilder/pbuilder-createbuildenv "$@"
	;;
    update)
	shift ;
	/usr/lib/pbuilder/pbuilder-updatebuildenv "$@"
	;;
    build)
	shift ;
	/usr/lib/pbuilder/pbuilder-buildpackage "$@"
	;;
    clean)
	shift;
	. /usr/lib/pbuilder/pbuilder-checkparams
	if [ -n "$BASEBUILDPLACE" ]; then 
	    echo "Cleaning [$BASEBUILDPLACE]"
	    rm -rf "$BASEBUILDPLACE"/* || true
	fi
	if [ -n "$APTCACHE" ]; then
	    echo "Cleaning [$APTCACHE]"
	    rm -rf "$APTCACHE"/* || true
	fi
	;;
    login)
	shift 
	. /usr/lib/pbuilder/pbuilder-checkparams
	extractbuildplace
	trap umountproc_cleanbuildplace exit
	echo " -> entering the shell
DO NOT bind mount file system inside, they will be cleaned.
File extracted to: $BUILDPLACE
"
	chroot "$BUILDPLACE" bin/bash
	;;
    *)
	. /usr/lib/pbuilder/pbuilder-modules
	showhelp
	;;
esac