mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-09 16:01:28 +00:00
pbuilder-dist: added an option to disable universe/multiverse
This commit is contained in:
parent
b6435c4685
commit
e2bbdb1bb6
@ -5,7 +5,8 @@
|
|||||||
# License: GPLv2 or later
|
# License: GPLv2 or later
|
||||||
#
|
#
|
||||||
# This script is a wrapper to use pbuilder with many different
|
# This script is a wrapper to use pbuilder with many different
|
||||||
# distributions / versions.
|
# distributions / versions. (It was originally created because of
|
||||||
|
# bug #255165 in Debian.)
|
||||||
#
|
#
|
||||||
# If you want to use this copy of the script only for a single distribution
|
# If you want to use this copy of the script only for a single distribution
|
||||||
# / version, rename it to 'pbuilder-dapper', 'pbuilder-feisty', 'pbuilder-gutsy',
|
# / version, rename it to 'pbuilder-dapper', 'pbuilder-feisty', 'pbuilder-gutsy',
|
||||||
@ -14,20 +15,29 @@
|
|||||||
#
|
#
|
||||||
# The only variable you really might need to change is BASE_DIR, if you
|
# The only variable you really might need to change is BASE_DIR, if you
|
||||||
# don't want pbuilder stuff in your home directory.
|
# don't want pbuilder stuff in your home directory.
|
||||||
#
|
|
||||||
# BTS: #255165
|
|
||||||
|
|
||||||
|
# Base directory where pbuilder will put all the files it creates
|
||||||
BASE_DIR="$HOME/pbuilder"
|
BASE_DIR="$HOME/pbuilder"
|
||||||
|
|
||||||
|
# Enable additional repositories by default? (universe and multiverse in Ubuntu,
|
||||||
|
# contrib and non-free in Debian.)
|
||||||
|
EXTRACOMP=1
|
||||||
|
|
||||||
|
|
||||||
ARCH=`dpkg-architecture | grep "DEB_HOST_ARCH=" | cut -f2 -d '='`
|
ARCH=`dpkg-architecture | grep "DEB_HOST_ARCH=" | cut -f2 -d '='`
|
||||||
|
|
||||||
|
help()
|
||||||
|
{
|
||||||
|
echo "Insufficient number of arguments."
|
||||||
|
echo "Usage: $0 "$( [ "$1" != 'show-dist-flag' ] || echo "<distribution> " )$( [ $ARCH != "amd64" ] || echo "[i386|amd64] " )"[mainonly|allcomp] <operation>"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
if [ ! -z `echo \`basename $0\` | grep -- '-'` ] && [ `basename $0` != 'pbuilder-dist' ]
|
if [ ! -z `echo \`basename $0\` | grep -- '-'` ] && [ `basename $0` != 'pbuilder-dist' ]
|
||||||
then
|
then
|
||||||
if [ $# -lt 1 ]
|
if [ $# -lt 1 ]
|
||||||
then
|
then
|
||||||
echo "Insufficient number of arguments."
|
help
|
||||||
echo "Usage: $0 "$( [ $ARCH != "amd64" ] || echo "[i386|amd64] " )"<operation>"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BINARCH=`basename $0 | cut -f3 -d '-'`
|
BINARCH=`basename $0 | cut -f3 -d '-'`
|
||||||
@ -35,15 +45,14 @@ then
|
|||||||
else
|
else
|
||||||
if [ $# -lt 2 ]
|
if [ $# -lt 2 ]
|
||||||
then
|
then
|
||||||
echo "Insufficient number of arguments."
|
help show-dist-flag
|
||||||
echo "Usage: $0 <distribution> ""$( [ $ARCH != "amd64" ] || echo "[i386|amd64] " )""<operation>"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DISTRIBUTION=$1
|
DISTRIBUTION=$1
|
||||||
shift 1
|
shift 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ $1 = "i386" ] || [ $1 = "amd64" ]
|
if [ $1 = "i386" ] || [ $1 = "amd64" ]
|
||||||
then
|
then
|
||||||
if [ $ARCH = "amd64" ]
|
if [ $ARCH = "amd64" ]
|
||||||
@ -56,18 +65,41 @@ then
|
|||||||
shift 1
|
shift 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
OPERATION=$1
|
|
||||||
|
if [ $1 = "mainonly" ]
|
||||||
|
then
|
||||||
|
EXTRACOMP=0
|
||||||
|
shift 1
|
||||||
|
elif [ $1 = "allcomp" ]
|
||||||
|
then
|
||||||
|
EXTRACOMP=1
|
||||||
|
shift 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
distdata()
|
||||||
|
{
|
||||||
|
if [ "$1" = "debian" ]
|
||||||
|
then
|
||||||
|
# Set Debian specific data
|
||||||
|
ARCHIVE="http://ftp.debian.org"
|
||||||
|
COMPONENTS="main"$( [ $EXTRACOMP = 0 ] || echo " contrib non-free" )
|
||||||
|
else
|
||||||
|
# Set Ubuntu specific data
|
||||||
|
ARCHIVE="http://archive.ubuntu.com/ubuntu"
|
||||||
|
COMPONENTS="main restricted"$( [ $EXTRACOMP = 0 ] || echo " universe multiverse" )
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
case $DISTRIBUTION in
|
case $DISTRIBUTION in
|
||||||
#warty|hoary|breezy)
|
#warty|hoary|breezy)
|
||||||
dapper|edgy|feisty|gutsy)
|
dapper|edgy|feisty|gutsy)
|
||||||
ARCHIVE="http://archive.ubuntu.com/ubuntu"
|
distdata ubuntu
|
||||||
COMPONENTS="universe multiverse"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
oldstable|sarge|stable|etch|testing|lenny|unstable|sid|experimental)
|
oldstable|sarge|stable|etch|testing|lenny|unstable|sid|experimental)
|
||||||
ARCHIVE="http://ftp.debian.org"
|
distdata debian
|
||||||
COMPONENTS="main contrib non-free"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
@ -77,16 +109,17 @@ case $DISTRIBUTION in
|
|||||||
|
|
||||||
if [ "$continue" != 'y' ] && [ "$continue" != 'Y' ]
|
if [ "$continue" != 'y' ] && [ "$continue" != 'Y' ]
|
||||||
then
|
then
|
||||||
echo " Aborting..."
|
echo "Aborting..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ARCHIVE="http://archive.ubuntu.com/ubuntu"
|
distdata
|
||||||
COMPONENTS="universe multiverse"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
OPERATION=$1
|
||||||
|
|
||||||
case $OPERATION in
|
case $OPERATION in
|
||||||
create|update|build|clean|login|execute)
|
create|update|build|clean|login|execute)
|
||||||
;;
|
;;
|
||||||
@ -113,5 +146,5 @@ sudo pbuilder $OPERATION \
|
|||||||
--basetgz $BASE_DIR/$DISTRIBUTION-base.tgz \
|
--basetgz $BASE_DIR/$DISTRIBUTION-base.tgz \
|
||||||
--distribution $DISTRIBUTION \
|
--distribution $DISTRIBUTION \
|
||||||
$( [ -z $BINARCH ] || echo "--binary-arch $BINARCH" ) \
|
$( [ -z $BINARCH ] || echo "--binary-arch $BINARCH" ) \
|
||||||
--buildresult $BASE_DIR/$DISTRIBUTION_result \
|
--buildresult $BASE_DIR/${DISTRIBUTION}_result \
|
||||||
--othermirror "deb $ARCHIVE $DISTRIBUTION $COMPONENTS" $@
|
--othermirror "deb $ARCHIVE $DISTRIBUTION $COMPONENTS" $@
|
||||||
|
Loading…
x
Reference in New Issue
Block a user