Report abuse

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
#!/bin/sh
# script from Jamin W. Collins  BTS: #255165
# use ~/bin/ubuntu.sh create/build hardy/jaunty somefile.dsc
# Mahyuddin Susanto (2009) udienz@unej.ac.id

OPERATION=$1
DISTRIBUTION=$2
PROCEED=false
BASE_DIR="$HOME/pbuilder"
RESULT="$BASE_DIR/result/$DISTRIBUTION/`date +%d%m%y`"
if [ ! -d "$BASE_DIR" ] || [ ! -d "$RESULT" ] || [ ! -d $BASE_DIR/apt-cache/$DISTRIBUTION/ ] ; then
sudo mkdir -p "$BASE_DIR" "$RESULT" "$BASE_DIR/apt-cache/$DISTRIBUTION/"
fi

sudo mkdir -p $BASE_DIR/$DISTRIBUIOTN/result/`date +%d%m%y`
case $OPERATION in
   create|update|build|clean|login|execute )
      PROCEED=true
      ;;      
esac

if ( $PROCEED == true ) then
   shift 

sudo pbuilder $OPERATION \
	--basetgz $BASE_DIR/$DISTRIBUTION-base.tgz \
	--distribution $DISTRIBUTION --aptcache "$BASE_DIR/apt-cache/$DISTRIBUTION/" \
	--mirror "http://mirror.unej.ac.id/ubuntu" --components "main restricted universe multiverse" \
	--othermirror "deb http://mirror.unej.ac.id/ubuntu/ $DISTRIBUTION-updates main restricted universe multiverse | deb http://mirror.unej.ac.id/ubuntu/ $DISTRIBUTION-security main restricted universe | deb http://mirror.unej.ac.id/ubuntu/ $DISTRIBUTION-backports main restricted universe multiverse" \
	--buildresult $RESULT "$@"
else
   echo "Invalid command..."
   echo "Valid commands are:"
   echo "   create"
   echo "   update"
   echo "   build"
   echo "   clean"
   echo "   login"
   echo "   execute"
   exit 1
fi