Fixes (presumably) in pbuilder-dist and comment the code better. Fix a regression in update-maintainer. Other changes?

This commit is contained in:
Siegfried-Angel Gevatter Pujals 2008-02-23 21:40:39 +01:00
parent 5eb5427dc2
commit 1db357f778
6 changed files with 129 additions and 94 deletions

View File

@ -31,7 +31,7 @@ def find_main(pack):
global packages global packages
# Retrieve information about the package # Retrieve information about the package
out = subprocess.Popen('apt-cache madison ' + pack + ' | grep hardy | grep Packages | head -n 1', shell=True, stdout=subprocess.PIPE).stdout.read() out = subprocess.Popen('apt-cache madison ' + pack + ' | grep hardy | grep -m 1 Packages', shell=True, stdout=subprocess.PIPE).stdout.read()
if out.find("/main") != -1: if out.find("/main") != -1:
packages[pack] = True packages[pack] = True
@ -41,12 +41,12 @@ def find_main(pack):
packages[pack] = False packages[pack] = False
# Retrive package dependencies # Retrive package dependencies
deps = subprocess.Popen("apt-cache show " + pack + " | grep ^Depends | head -n 1", shell=True, stdout=subprocess.PIPE).stdout.read().split('\n')[0].replace('Depends: ', '').split(', ') deps = subprocess.Popen("apt-cache show " + pack + " | grep -m 1 ^Depends", shell=True, stdout=subprocess.PIPE).stdout.read().split('\n')[0].replace('Depends: ', '').split(', ')
process_deps(deps) process_deps(deps)
# Retrieve package build dependencies # Retrieve package build dependencies
deps1 = subprocess.Popen("apt-cache showsrc " + pack + " | grep ^Build-Depends | head -n 1", shell=True, stdout=subprocess.PIPE).stdout.readlines() deps1 = subprocess.Popen("apt-cache showsrc " + pack + " | grep -m 1 ^Build-Depends", shell=True, stdout=subprocess.PIPE).stdout.readlines()
deps = [] deps = []
for builddep in deps1: for builddep in deps1:

2
debian/changelog vendored
View File

@ -18,6 +18,8 @@ ubuntu-dev-tools (0.27) UNRELEASED; urgency=low
remove it's shabang. remove it's shabang.
* submittodebian: * submittodebian:
- Check if reportbug is installed and if it isn't throw an error. - Check if reportbug is installed and if it isn't throw an error.
* suspicious-sources:
- Ignore .in files.
* 404main: * 404main:
- Filter out entries from Debian, thanks to Adrien Cunin! (LP: #194704) - Filter out entries from Debian, thanks to Adrien Cunin! (LP: #194704)
* debian/copyright. * debian/copyright.

4
debian/copyright vendored
View File

@ -20,7 +20,7 @@ Upstream Authors:
Copyright: Copyright:
Copyright 2006-2007 (C) Canonical Ltd. Canonical Ltd. 2006-2007
Albert Damen <albrt@gmx.net> 2007 Albert Damen <albrt@gmx.net> 2007
Albin Tonnerre <lut1n.tne@gmail.com> 2006-2007 Albin Tonnerre <lut1n.tne@gmail.com> 2006-2007
Daniel Holbach <daniel.holbach@ubuntu.com> 2006-2007 Daniel Holbach <daniel.holbach@ubuntu.com> 2006-2007
@ -29,7 +29,7 @@ Copyright:
Michael Bienia <geser@ubuntu.com> 2006-2007 Michael Bienia <geser@ubuntu.com> 2006-2007
Kees Cook <kees@ubuntu.com> 2006-2007 Kees Cook <kees@ubuntu.com> 2006-2007
Pete Savage <petesavage@ubuntu.com> 2006-2007 Pete Savage <petesavage@ubuntu.com> 2006-2007
Siegfried-A. Gevatter <rainct@ubuntu.com> 2007 Siegfried-A. Gevatter <rainct@ubuntu.com> 2007-2008
Terence Simpson <stdin@stdin.me.uk> 2007 Terence Simpson <stdin@stdin.me.uk> 2007
Licenses: Licenses:

View File

@ -1,8 +1,9 @@
#!/bin/sh #!/bin/sh
# Copyright by: #
# Jamin W. Collins <jcollins@asgardsrealm.net> # Copyright (C) Jamin W. Collins <jcollins@asgardsrealm.net>
# Jordan Mantha <mantha@ubuntu.com> # Copyright (C) Jordan Mantha <mantha@ubuntu.com>
# Siegfried-A. Gevatter <rainct@ubuntu.com> # Copyright (C) 2007-2008 Siegfried-A. Gevatter <rainct@ubuntu.com>
#
# License: GPLv2 or later # License: GPLv2 or later
# #
# This script is a wrapper to be able to easily use pbuilder with # This script is a wrapper to be able to easily use pbuilder with
@ -12,119 +13,158 @@
# configurations. For example, a symlink called pbuilder-hardy will assume # configurations. For example, a symlink called pbuilder-hardy will assume
# that the target distribution is always Ubuntu Hardy. # that the target distribution is always Ubuntu Hardy.
######################################################################
# Base directory where pbuilder will put all the files it creates. # Base directory where pbuilder will put all the files it creates.
# This is overriden by the global variable $PBUILDFOLDER # This is overriden by the global variable $PBUILDFOLDER
BASE_DIR="$HOME/pbuilder" BASE_DIR="$HOME/pbuilder"
# Change this to 0 if you don't want additional components to be used. # Change this to 0 if you don't want additional components to be used.
# That is, 'universe' and 'multiverse' for Ubuntu chroots and 'contrib' # That is, 'universe' and 'multiverse' for Ubuntu chroots and 'contrib'
# and 'non-free' for Debian. # and 'non-free' for Debian. (This option can be overwriten at runtime).
EXTRACOMP=1 EXTRACOMP=1
# Change this to 1 if you want the log for the last operation to be saved # Change this to 1 if you want the log for the last operation to be saved
# in the base directory by default (it will be named '.lastlog'). # in the base directory by default (it will be named '.lastlog').
SAVELOG=0 SAVELOG=0
# Allow this script to use /var/cache/apt/archives/ when possible # Allow this script to use /var/cache/apt/archives/ when possible.
if [ -z $SYSCACHE ] if [ -z $SYSCACHE ]
then then
SYSCACHE=1 SYSCACHE=1
fi fi
######################################################################
################################ # Detect system architecture
REALARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
ARCH=`dpkg-architecture -qDEB_HOST_ARCH` # Detect Ubuntu distribution (wheter it is gutsy, hardy, etc.)
SYSDIST=`lsb_release -cs` SYSDIST=$(lsb_release -cs 2>/dev/null)
# Overwrite hardcoded base directory by that one in the global variable
if [ $PBUILDFOLDER ] && [ $PBUILDFOLDER != "" ] if [ $PBUILDFOLDER ] && [ $PBUILDFOLDER != "" ]
then then
BASE_DIR=$PBUILDFOLDER BASE_DIR=$PBUILDFOLDER
fi fi
help() ######################################################################
{
echo "Insufficient number of arguments."
echo "Usage: $0 "$( [ "$1" != 'show-dist-flag' ] || echo "<distribution> " )$( [ $ARCH != "amd64" ] || echo "[i386|amd64] " )"[mainonly|allcomp] [withlog|nolog] <operation>"
exit 1
}
if [ ! -z `echo \`basename $0\` | grep -- '-'` ] && [ `basename $0` != 'pbuilder-dist' ] # Abort if the name of the executable has hypens but it doesn't
# start with "pbuilder-".
if [ -n $(basename $0 | grep '-') ] && [ $(basename $0 | cut -d'-' -f1) != 'pbuilder' ]
then then
if [ $# -lt 1 ] echo "Error: " $(basename $0) " is not a valid name for a pbuilder-dist executable."
then exit 1
help fi
fi
# Detect if the script has it's original name or if a symlink is being used,
BINARCH=`basename $0 | cut -f3 -d '-'` # and if it's a symlink extract the information that it contains.
DISTRIBUTION=`basename $0 | cut -f2 -d '-'` if [ -n $(basename $0 | grep '-') ] && [ `basename $0` != 'pbuilder-dist' ]
then
ORIGINAL_NAME=0
DISTRIBUTION=$(basename $0 | cut -d'-' -f2)
ARCHITECTURE=$(basename $0 | cut -d'-' -f3)
else else
if [ $# -lt 2 ] ORIGINAL_NAME=1
then DISTRIBUTION=$1
help show-dist-flag ARCHITECTURE=$REALARCH
fi shift 1
BINARCH=$ARCH ##
DISTRIBUTION=$1
shift 1
fi fi
# Check if the choosen architecture is supported on the user's system.
if [ $1 = "i386" ] || [ $1 = "amd64" ] if [ "$1" = 'i386' ] || [ "$1" = 'amd64' ]
then then
if [ $ARCH = "amd64" ]; then if [ $REALARCH = 'amd64' ]; then
BINARCH=$1 ARCHITECTURE=$1
else else
echo "Warning: Architecture switching is not supported on your system; ignoring argument." echo "Warning: Architecture switching is not supported on your system; ignoring argument '$1'."
fi fi
shift 1 shift 1
fi fi
# Check if there's a component modifier
if [ $1 = "mainonly" ]; then if [ "$1" = 'mainonly' ]; then
EXTRACOMP=0 EXTRACOMP=0
shift 1 shift 1
elif [ $1 = "allcomp" ]; then elif [ "$1" = 'allcomp' ]; then
EXTRACOMP=1 EXTRACOMP=1
shift 1 shift 1
fi fi
# Check if the default logging preferences should be overwriten
if [ $1 = "withlog" ]; then if [ "$1" = 'withlog' ]; then
SAVELOG=1 SAVELOG=1
shift 1 shift 1
elif [ $1 = "nolog" ]; then elif [ "$1" = 'nolog' ]; then
SAVELOG=0 SAVELOG=0
shift 1 shift 1
fi fi
# Check if some proxy should be used.
if [ -n "$http_proxy" ]
then
PROXY=$http_proxy
fi
if [ -z "$PROXY" ] && [ -n "$HTTP_PROXY" ]
then
PROXY=$HTTP_PROXY
fi
######################################################################
usage()
{
echo "Usage: $0 "$( [ $ORIGINAL_NAME = 0 ] || echo "<distribution> " )$( [ $ARCHITECTURE != "amd64" ] || echo "[i386|amd64] " )"[mainonly|allcomp] [withlog|nolog] <operation>"
}
distdata() distdata()
{ {
if [ "$1" = "debian" ] # Populate variables with Debian / Ubuntu specific data
then if [ "$1" = "debian" ]
# Set Debian specific data
ISDEBIAN=True
if [ -z $ARCHIVE ]
then then
ARCHIVE="http://ftp.debian.org" # Set Debian specific data
ISDEBIAN=True
if [ -z $ARCHIVE ]
then
ARCHIVE="http://ftp.debian.org"
fi
COMPONENTS="main"$( [ $EXTRACOMP = 0 ] || echo " contrib non-free" )
else
# Set Ubuntu specific data
ISDEBIAN=False
if [ -z $ARCHIVE ]
then
ARCHIVE="http://archive.ubuntu.com/ubuntu"
fi
COMPONENTS="main restricted"$( [ $EXTRACOMP = 0 ] || echo " universe multiverse" )
fi fi
COMPONENTS="main"$( [ $EXTRACOMP = 0 ] || echo " contrib non-free" )
else
# Set Ubuntu specific data
ISDEBIAN=False
if [ -z $ARCHIVE ]
then
ARCHIVE="http://archive.ubuntu.com/ubuntu"
fi
COMPONENTS="main restricted"$( [ $EXTRACOMP = 0 ] || echo " universe multiverse" )
fi
} }
######################################################################
# Check if there is at least one argument remaining.
if [ $# -lt 1 ]
then
echo "You provided an insufficent number of arguments."
usage
exit 1
fi
######################################################################
# Check if the distribution exists, and fill the variables that change
# depending on wheter the target distribution is Ubuntu or Debian.
case $DISTRIBUTION in case $DISTRIBUTION in
dapper|edgy|feisty|gutsy|hardy) # warty|hoary|breezy dapper|edgy|feisty|gutsy|hardy)
distdata ubuntu distdata ubuntu
;; ;;
@ -144,20 +184,20 @@ case $DISTRIBUTION in
exit 1 exit 1
fi fi
fi fi
distdata
distdata ubuntu
;; ;;
esac esac
# Check if the selected operation is correct
OPERATION=$1 OPERATION=$1
case "$OPERATION" in
case $OPERATION in
create|update|build|clean|login|execute) create|update|build|clean|login|execute)
shift 1 shift 1
;; ;;
*) *)
if [ ${1##*.} = 'dsc' ] if [ ${OPERATION##*.} = 'dsc' ]
then then
OPERATION=build OPERATION=build
else else
@ -173,28 +213,21 @@ case $OPERATION in
;; ;;
esac esac
FOLDERBASE="${DISTRIBUTION}-$( ([ "$BINARCH" != "" ] && echo $BINARCH) || echo $ARCH )" FOLDERBASE="${DISTRIBUTION}-$ARCHITECTURE"
# Create the folder where the resulting files will be placed (if the
# option is build), if it doesn't exist yet.
if [ ! -d $BASE_DIR/${FOLDERBASE}_result ] if [ ! -d $BASE_DIR/${FOLDERBASE}_result ]
then then
mkdir -p $BASE_DIR/${FOLDERBASE}_result mkdir -p $BASE_DIR/${FOLDERBASE}_result
fi fi
if [ $SYSCACHE != 0 ] && [ "$SYSDIST" = "$DISTRIBUTION" ] && [ "$ARCH" = "$BINARCH" -o -z $BINARCH ] # Determine wheter system cache should be used or not.
if [ $SYSCACHE = 1 ] && [ "$SYSDIST" = "$DISTRIBUTION" ] && [ "$REALARCH" = "$ARCHITECTURE"]
then then
DEBCACHE='/var/cache/apt/archives/' DEBCACHE='/var/cache/apt/archives/'
fi fi
if [ -n $http_proxy ] || [ -n $HTTP_PROXY ]
then
if [ -n $http_proxy ]
then
PROXY=$http_proxy
else
PROXY=$HTTP_PROXY
fi
fi
if [ $ISDEBIAN = "False" ] if [ $ISDEBIAN = "False" ]
then then
if [ ! -d $BASE_DIR/etc/$DISTRIBUTION/apt.conf/ ] if [ ! -d $BASE_DIR/etc/$DISTRIBUTION/apt.conf/ ]
@ -243,11 +276,11 @@ sudo pbuilder $OPERATION \
--basetgz "$BASE_DIR/${FOLDERBASE}-base.tgz" \ --basetgz "$BASE_DIR/${FOLDERBASE}-base.tgz" \
--distribution "$DISTRIBUTION" \ --distribution "$DISTRIBUTION" \
--debootstrapopts --arch \ --debootstrapopts --arch \
--debootstrapopts "$BINARCH" \ --debootstrapopts "$ARCHITECTURE" \
$( [ $SAVELOG = 0 ] || echo "--logfile $BASE_DIR/.lastlog" ) \ $( [ "$SAVELOG" = 0 ] || echo "--logfile ${BASE_DIR}/.lastlog" ) \
$( [ -z $PROXY ] || echo "--http-proxy $PROXY" ) \ $( [ -z "$PROXY" ] || echo "--http-proxy ${PROXY}" ) \
$( [ -z $DEBCACHE ] || echo "--aptcache $DEBCACHE" ) \ $( [ -z "$DEBCACHE" ] || echo "--aptcache ${DEBCACHE}" ) \
--buildresult "$BASE_DIR/${FOLDERBASE}_result" \ --buildresult "${BASE_DIR}/${FOLDERBASE}_result" \
--mirror "$ARCHIVE" \ --mirror "${ARCHIVE}" \
--aptconfdir "$BASE_DIR/etc/$DISTRIBUTION/apt.conf/" \ --aptconfdir "${BASE_DIR}/etc/${DISTRIBUTION}/apt.conf/" \
$@ $@

View File

@ -13,7 +13,7 @@ FILES="*.h *.c *.cc *.cpp *.py *.sh *.txt *.text *.3 *.m4 *.xml *.html *.php \
configure.ac *.diff *.debdiff *.patch *.dpatch config.sub config.guess \ configure.ac *.diff *.debdiff *.patch *.dpatch config.sub config.guess \
depcomp *.docbook *.desktop *.menu AUTHORS INSTALL NEWS README TODO \ depcomp *.docbook *.desktop *.menu AUTHORS INSTALL NEWS README TODO \
COPYING LICENSE ChangeLog *.ui *.glade *.gladep *.po *.pot *.ts *.pro \ COPYING LICENSE ChangeLog *.ui *.glade *.gladep *.po *.pot *.ts *.pro \
*.svg *.png *.bmp *.gif *.xpm *.hh" *.svg *.png *.bmp *.gif *.xpm *.hh *.in"
IGNORE=".bzr CVS .svn debian" IGNORE=".bzr CVS .svn debian"

View File

@ -75,7 +75,7 @@ if [ -z "$section" ]; then
echo "--section argument. Run $0 --help for more information." >&2 echo "--section argument. Run $0 --help for more information." >&2
exit 1 exit 1
fi fi
section=$(echo $pkgline | grep -Eo "main|universe|multiverse|restricted") || section=universe section=$(echo $pkgline | grep -Eo "main|universe|multiverse|restricted") || section=main
fi fi
case $section in case $section in