mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 23:51:08 +00:00
Fixes (presumably) in pbuilder-dist and comment the code better. Fix a regression in update-maintainer. Other changes?
This commit is contained in:
parent
5eb5427dc2
commit
1db357f778
6
404main
6
404main
@ -31,7 +31,7 @@ def find_main(pack):
|
||||
global packages
|
||||
|
||||
# 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:
|
||||
packages[pack] = True
|
||||
@ -41,12 +41,12 @@ def find_main(pack):
|
||||
packages[pack] = False
|
||||
|
||||
# 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)
|
||||
|
||||
# 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 = []
|
||||
|
||||
for builddep in deps1:
|
||||
|
2
debian/changelog
vendored
2
debian/changelog
vendored
@ -18,6 +18,8 @@ ubuntu-dev-tools (0.27) UNRELEASED; urgency=low
|
||||
remove it's shabang.
|
||||
* submittodebian:
|
||||
- Check if reportbug is installed and if it isn't throw an error.
|
||||
* suspicious-sources:
|
||||
- Ignore .in files.
|
||||
* 404main:
|
||||
- Filter out entries from Debian, thanks to Adrien Cunin! (LP: #194704)
|
||||
* debian/copyright.
|
||||
|
4
debian/copyright
vendored
4
debian/copyright
vendored
@ -20,7 +20,7 @@ Upstream Authors:
|
||||
|
||||
Copyright:
|
||||
|
||||
Copyright 2006-2007 (C) Canonical Ltd.
|
||||
Canonical Ltd. 2006-2007
|
||||
Albert Damen <albrt@gmx.net> 2007
|
||||
Albin Tonnerre <lut1n.tne@gmail.com> 2006-2007
|
||||
Daniel Holbach <daniel.holbach@ubuntu.com> 2006-2007
|
||||
@ -29,7 +29,7 @@ Copyright:
|
||||
Michael Bienia <geser@ubuntu.com> 2006-2007
|
||||
Kees Cook <kees@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
|
||||
|
||||
Licenses:
|
||||
|
207
pbuilder-dist
207
pbuilder-dist
@ -1,8 +1,9 @@
|
||||
#!/bin/sh
|
||||
# Copyright by:
|
||||
# Jamin W. Collins <jcollins@asgardsrealm.net>
|
||||
# Jordan Mantha <mantha@ubuntu.com>
|
||||
# Siegfried-A. Gevatter <rainct@ubuntu.com>
|
||||
#
|
||||
# Copyright (C) Jamin W. Collins <jcollins@asgardsrealm.net>
|
||||
# Copyright (C) Jordan Mantha <mantha@ubuntu.com>
|
||||
# Copyright (C) 2007-2008 Siegfried-A. Gevatter <rainct@ubuntu.com>
|
||||
#
|
||||
# License: GPLv2 or later
|
||||
#
|
||||
# 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
|
||||
# that the target distribution is always Ubuntu Hardy.
|
||||
|
||||
######################################################################
|
||||
|
||||
# Base directory where pbuilder will put all the files it creates.
|
||||
# This is overriden by the global variable $PBUILDFOLDER
|
||||
BASE_DIR="$HOME/pbuilder"
|
||||
|
||||
# Change this to 0 if you don't want additional components to be used.
|
||||
# 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
|
||||
|
||||
# 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').
|
||||
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 ]
|
||||
then
|
||||
SYSCACHE=1
|
||||
fi
|
||||
|
||||
######################################################################
|
||||
|
||||
################################
|
||||
# Detect system architecture
|
||||
REALARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
|
||||
|
||||
ARCH=`dpkg-architecture -qDEB_HOST_ARCH`
|
||||
SYSDIST=`lsb_release -cs`
|
||||
# Detect Ubuntu distribution (wheter it is gutsy, hardy, etc.)
|
||||
SYSDIST=$(lsb_release -cs 2>/dev/null)
|
||||
|
||||
# Overwrite hardcoded base directory by that one in the global variable
|
||||
if [ $PBUILDFOLDER ] && [ $PBUILDFOLDER != "" ]
|
||||
then
|
||||
BASE_DIR=$PBUILDFOLDER
|
||||
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
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
help
|
||||
fi
|
||||
|
||||
BINARCH=`basename $0 | cut -f3 -d '-'`
|
||||
DISTRIBUTION=`basename $0 | cut -f2 -d '-'`
|
||||
echo "Error: " $(basename $0) " is not a valid name for a pbuilder-dist executable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Detect if the script has it's original name or if a symlink is being used,
|
||||
# and if it's a symlink extract the information that it contains.
|
||||
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
|
||||
if [ $# -lt 2 ]
|
||||
then
|
||||
help show-dist-flag
|
||||
fi
|
||||
|
||||
BINARCH=$ARCH ##
|
||||
DISTRIBUTION=$1
|
||||
shift 1
|
||||
ORIGINAL_NAME=1
|
||||
DISTRIBUTION=$1
|
||||
ARCHITECTURE=$REALARCH
|
||||
shift 1
|
||||
fi
|
||||
|
||||
|
||||
if [ $1 = "i386" ] || [ $1 = "amd64" ]
|
||||
# Check if the choosen architecture is supported on the user's system.
|
||||
if [ "$1" = 'i386' ] || [ "$1" = 'amd64' ]
|
||||
then
|
||||
if [ $ARCH = "amd64" ]; then
|
||||
BINARCH=$1
|
||||
else
|
||||
echo "Warning: Architecture switching is not supported on your system; ignoring argument."
|
||||
fi
|
||||
|
||||
shift 1
|
||||
if [ $REALARCH = 'amd64' ]; then
|
||||
ARCHITECTURE=$1
|
||||
else
|
||||
echo "Warning: Architecture switching is not supported on your system; ignoring argument '$1'."
|
||||
fi
|
||||
|
||||
shift 1
|
||||
fi
|
||||
|
||||
|
||||
if [ $1 = "mainonly" ]; then
|
||||
# Check if there's a component modifier
|
||||
if [ "$1" = 'mainonly' ]; then
|
||||
EXTRACOMP=0
|
||||
shift 1
|
||||
elif [ $1 = "allcomp" ]; then
|
||||
elif [ "$1" = 'allcomp' ]; then
|
||||
EXTRACOMP=1
|
||||
shift 1
|
||||
fi
|
||||
|
||||
|
||||
if [ $1 = "withlog" ]; then
|
||||
# Check if the default logging preferences should be overwriten
|
||||
if [ "$1" = 'withlog' ]; then
|
||||
SAVELOG=1
|
||||
shift 1
|
||||
elif [ $1 = "nolog" ]; then
|
||||
elif [ "$1" = 'nolog' ]; then
|
||||
SAVELOG=0
|
||||
shift 1
|
||||
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()
|
||||
{
|
||||
if [ "$1" = "debian" ]
|
||||
then
|
||||
# Set Debian specific data
|
||||
ISDEBIAN=True
|
||||
if [ -z $ARCHIVE ]
|
||||
# Populate variables with Debian / Ubuntu specific data
|
||||
if [ "$1" = "debian" ]
|
||||
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
|
||||
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
|
||||
dapper|edgy|feisty|gutsy|hardy) # warty|hoary|breezy
|
||||
dapper|edgy|feisty|gutsy|hardy)
|
||||
distdata ubuntu
|
||||
;;
|
||||
|
||||
@ -144,20 +184,20 @@ case $DISTRIBUTION in
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
distdata
|
||||
|
||||
distdata ubuntu
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# Check if the selected operation is correct
|
||||
OPERATION=$1
|
||||
|
||||
case $OPERATION in
|
||||
case "$OPERATION" in
|
||||
create|update|build|clean|login|execute)
|
||||
shift 1
|
||||
;;
|
||||
|
||||
*)
|
||||
if [ ${1##*.} = 'dsc' ]
|
||||
if [ ${OPERATION##*.} = 'dsc' ]
|
||||
then
|
||||
OPERATION=build
|
||||
else
|
||||
@ -173,28 +213,21 @@ case $OPERATION in
|
||||
;;
|
||||
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 ]
|
||||
then
|
||||
mkdir -p $BASE_DIR/${FOLDERBASE}_result
|
||||
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
|
||||
DEBCACHE='/var/cache/apt/archives/'
|
||||
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" ]
|
||||
then
|
||||
if [ ! -d $BASE_DIR/etc/$DISTRIBUTION/apt.conf/ ]
|
||||
@ -243,11 +276,11 @@ sudo pbuilder $OPERATION \
|
||||
--basetgz "$BASE_DIR/${FOLDERBASE}-base.tgz" \
|
||||
--distribution "$DISTRIBUTION" \
|
||||
--debootstrapopts --arch \
|
||||
--debootstrapopts "$BINARCH" \
|
||||
$( [ $SAVELOG = 0 ] || echo "--logfile $BASE_DIR/.lastlog" ) \
|
||||
$( [ -z $PROXY ] || echo "--http-proxy $PROXY" ) \
|
||||
$( [ -z $DEBCACHE ] || echo "--aptcache $DEBCACHE" ) \
|
||||
--buildresult "$BASE_DIR/${FOLDERBASE}_result" \
|
||||
--mirror "$ARCHIVE" \
|
||||
--aptconfdir "$BASE_DIR/etc/$DISTRIBUTION/apt.conf/" \
|
||||
--debootstrapopts "$ARCHITECTURE" \
|
||||
$( [ "$SAVELOG" = 0 ] || echo "--logfile ${BASE_DIR}/.lastlog" ) \
|
||||
$( [ -z "$PROXY" ] || echo "--http-proxy ${PROXY}" ) \
|
||||
$( [ -z "$DEBCACHE" ] || echo "--aptcache ${DEBCACHE}" ) \
|
||||
--buildresult "${BASE_DIR}/${FOLDERBASE}_result" \
|
||||
--mirror "${ARCHIVE}" \
|
||||
--aptconfdir "${BASE_DIR}/etc/${DISTRIBUTION}/apt.conf/" \
|
||||
$@
|
||||
|
@ -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 \
|
||||
depcomp *.docbook *.desktop *.menu AUTHORS INSTALL NEWS README TODO \
|
||||
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"
|
||||
|
||||
|
@ -75,7 +75,7 @@ if [ -z "$section" ]; then
|
||||
echo "--section argument. Run $0 --help for more information." >&2
|
||||
exit 1
|
||||
fi
|
||||
section=$(echo $pkgline | grep -Eo "main|universe|multiverse|restricted") || section=universe
|
||||
section=$(echo $pkgline | grep -Eo "main|universe|multiverse|restricted") || section=main
|
||||
fi
|
||||
|
||||
case $section in
|
||||
|
Loading…
x
Reference in New Issue
Block a user