Commit 69995cff authored by Mattia Rizzolo's avatar Mattia Rizzolo

completely rewrite pbuilder scripts, making symlinks to a pbuilder-common file

parent f11ea3ec
#!/bin/bash
debians=(squeezy wheezy jessie sid testing unstable experimental)
ubuntus=(natty oneiric precise quantal raring saucy trusty)
DIST=`basename $0 | cut -f2 -d '-'`
ARCH=`basename $0 | cut -f3 -d '-'`
OPERATION=$1
BASE_DIR="$HOME/pbuilder"
APTCACHE="$BASE_DIR/cache/apt/$DIST-$ARCH"
type() {
contains() {
local n=$#
local value=${!n}
for ((i=1; i < $#; i++)) {
if [ "${!i}" == "${value}" ]; then
return 0
fi
}
return 1
}
if (contains "${debians[@]}" "$DIST") ; then
TYPE=debian
else
if (contains "${ubuntus[@]}" "$DIST") ; then
TYPE=ubuntu
fi
fi
}
sett() {
case $TYPE in
debian)
MIRROR="http://http.debian.net/debian"
COMPONENTS="main contrib"
OTHER='--debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg"'
;;
ubuntu)
MIRROR="http://archive.ubuntu.com/ubuntu"
COMPONENTS="main universe multiverse"
;;
esac
if [ ! -d $APTCACHE ] ; then
mkdir -p $APTCACHE
fi
}
execute() {
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DIST-$ARCH-base.tgz \
--distribution $DIST \
--components "$COMPONENTS" \
--aptcache $APTCACHE \
--buildresult $BASE_DIR/result/$DIST/$ARCH \
--mirror $MIRROR \
$OTHER \
"$@"
}
case $OPERATION in
create|update|build|clean|login|execute )
execute
;;
*)
echo "Invalid command."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
;;
esac
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DIST=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
APTCACHE="$BASE_DIR/cache/apt/$DIST-$ARCH"
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if [ ! -d $APTCACHE ] ; then
mkdir -p $APTCACHE
fi
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DIST-$ARCH-base.tgz \
--distribution $DIST \
--components "main contrib" \
--aptcache $APTCACHE \
--buildresult $BASE_DIR/result/$DIST/$ARCH \
"$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main universe" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH "$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main universe" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH "$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main universe" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH "$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main universe" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH "$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main universe" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH "$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main universe" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH "$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
MIRROR="http://http.debian.net/debian" #for debian
#MIRROR="http://archive.ubuntu.com/ubuntu" #for ubuntu
APTCACHE="$BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH"
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if [ ! -d $APTCACHE ] ; then
mkdir -p $APTCACHE
fi
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main contrib" \
--aptcache $APTCACHE \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH \
--mirror $MIRROR \
--debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg" \
"$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
MIRROR="http://http.debian.net/debian" #for debian
#MIRROR="http://archive.ubuntu.com/ubuntu" #for ubuntu
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main contrib" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH \
--mirror $MIRROR \
--debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg" \
"$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main contrib" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH "$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main universe" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH "$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main universe" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH "$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
#!/bin/sh
# script from Jamin W. Collins BTS: #255165
# name this script 'pbuilder-woody', 'pbuilder-sid', 'pbuilder-sarge', 'pbuilder-experimental' etc.
OPERATION=$1
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
PROCEED=false
BASE_DIR="$HOME/pbuilder"
ARCH=`basename $0 | cut -f3 -d '-'`
case $OPERATION in
create|update|build|clean|login|execute )
PROCEED=true
;;
esac
if ( $PROCEED == true ) then
shift
sudo pbuilder $OPERATION \
--architecture $ARCH \
--basetgz $BASE_DIR/$DISTRIBUTION-$ARCH-base.tgz \
--distribution $DISTRIBUTION \
--components "main universe" \
--aptcache $BASE_DIR/cache/apt/$DISTRIBUTION-$ARCH \
--buildresult $BASE_DIR/result/$DISTRIBUTION/$ARCH "$@"
else
echo "Invalid command..."
echo "Valid commands are:"
echo " create"
echo " update"
echo " build"
echo " clean"
echo " login"
echo " execute"
exit 1
fi
pbuilder-common
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment