diff -Nru ubuntu-dev-tools-0.30/AUTHORS ubuntu-dev-tools-0.35~ppa1~hardy1/AUTHORS --- ubuntu-dev-tools-0.30/AUTHORS 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/AUTHORS 2008-08-09 13:25:31.000000000 +0100 @@ -1,5 +1,6 @@ Albert Damen Albin Tonnerre +Daniel Hahler Daniel Holbach Jamin W. Collins Jordan Mantha diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/check-symbols /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/check-symbols --- ubuntu-dev-tools-0.30/check-symbols 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/check-symbols 2008-08-09 13:25:31.000000000 +0100 @@ -13,30 +13,40 @@ DEBUG=False if [[ -z $1 ]]; then - echo "Missing argument: source package name."; - exit; + echo "Missing argument: source package name." + exit 1 fi if [[ -z $2 ]]; then - DEBDIR="/var/cache/pbuilder/result"; + DEBDIR="/var/cache/pbuilder/result" else - DEBDIR="$2"; + DEBDIR="$2" +fi + +if [ `id -u` != "0" ] +then + echo + echo -n "You might now be asked for your password, as this script requires" + echo " sudo privilegies in order to install the packages you want to check." + echo fi sudo apt-get install $PACKAGES +echo for pack in $PACKAGES; do - for lib in `dpkg -L $pack | grep -E "\.so$" | sort -u`; + for lib in `dpkg -L $pack | grep -E "\.so$" | sort -u` do - LIBNAME=$(basename $lib); - nm -D $lib | cut -d' ' -f3 | sort -u > /tmp/$LIBNAME.old; + LIBNAME=$(basename $lib) + nm -D $lib | cut -d' ' -f3 | sort -u > /tmp/$LIBNAME.old done; - DEBLINE="$DEBLINE $DEBDIR/$pack*.deb "; + DEBLINE="$DEBLINE $DEBDIR/$pack*.deb " done if [[ -z $DEBLINE ]]; then - echo "Package doesn't exist: $1."; exit + echo "Package doesn't exist: $1." + exit 1 fi NOFILE=True @@ -48,19 +58,21 @@ done if [[ $NOFILE == True ]]; then - echo "No matching binary files found in «$DEBDIR»."; exit + echo "No matching binary files found in «$DEBDIR»." + exit 1 fi sudo dpkg -i $DEBLINE; +echo for pack in $PACKAGES; do - for lib in `dpkg -L $pack | grep -E "\.so$" | sort -u`; + for lib in `dpkg -L $pack | grep -E "\.so$" | sort -u` do - LIBNAME=$(basename $lib); - nm -D $lib | cut -d' ' -f3 | sort -u > /tmp/$LIBNAME.new; - echo "Checking: $lib"; - diff -u /tmp/$LIBNAME.{old,new}; - rm /tmp/$LIBNAME.{old,new}; + LIBNAME=$(basename $lib) + nm -D $lib | cut -d' ' -f3 | sort -u > /tmp/$LIBNAME.new + echo "Checking: $lib" + diff -u /tmp/$LIBNAME.{old,new} + rm /tmp/$LIBNAME.{old,new} done; done diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/dch-repeat /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/dch-repeat --- ubuntu-dev-tools-0.30/dch-repeat 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/dch-repeat 2008-08-09 13:25:31.000000000 +0100 @@ -1,5 +1,6 @@ #!/usr/bin/perl -# Copyright 2007 (C) Kees Cook +# Copyright 2007-2008 (C) Canonical, Ltd +# Author: Kees Cook # License: GPLv2 # # This script is used to repeat a change log into an older release. It @@ -30,7 +31,7 @@ exit(0); } -my @releases = ('dapper', 'edgy', 'feisty', 'gutsy', 'hardy'); +my @releases = ('dapper', 'feisty', 'gutsy', 'hardy', 'intrepid'); #Getopt::Long::Configure("bundling", "no_ignore_case"); our $opt_build_tree = "/scratch/ubuntu/build"; diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/debian/changelog /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/debian/changelog --- ubuntu-dev-tools-0.30/debian/changelog 2008-04-08 15:38:48.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/debian/changelog 2008-08-09 13:26:57.000000000 +0100 @@ -1,3 +1,113 @@ +ubuntu-dev-tools (0.35~ppa1~hardy1) hardy; urgency=low + + [ Siegfried-Angel Gevatter Pujals ] + * doc/update-maintainer.1: + - Remove the reference to the --no-changelog option from the manpage. + * requestsync: + - If the email interface is used, check if DEBEMAIL is set before anything + else (LP: #254632). + * massfile, examples/massfile.instructions: + - Make it possible to give the created bugs a determined status. + * debian/control: + - Bump Standards Version to 3.8.0. + * debian/rules: + - It's not necessary anymore to remove usr/lib. + * setup.py: + - Order the scripts list alphabetically and add pull-lp-source. + + [ Iain Lane ] + * Add pull-lp-source, which get source packages from LP to avoid mirror lag. + * pbuilder-dist.new: + - Set mirror and component for Debian distros. + - Use local apt cache if available. + * massfile: + - Modify it to work with Firefox 3 cookies, taking code from requestsync. + - Set the status to Confirmed, by default. + + -- Siegfried-Angel Gevatter Pujals Sat, 09 Aug 2008 13:58:23 +0200 + +ubuntu-dev-tools (0.34) intrepid; urgency=low + + * update-maintainer: Remove dangling reference to --nochangelog + in usage function. + + -- Luke Yelavich Mon, 28 Jul 2008 15:50:38 +1000 + +ubuntu-dev-tools (0.33) intrepid; urgency=low + + * update-maintainer: Stop mentioning "Modify Maintainer: value blabla" since + it is a required global policy anyway and totally pointless changelog + noise. + + -- Martin Pitt Fri, 18 Jul 2008 12:29:57 +0100 + +ubuntu-dev-tools (0.32) intrepid; urgency=low + + [ Iain Lane ] + * requestsync: Fix bug where requestsync would fall over when requesting + sync for package with no local changes. + + [ Kees Cook ] + * dch-repeat: drop edgy, add intrepid. Update Copyright years. + + [ Mario Limonciello ] + * mk-sbuild-lv: Add lpia build support. + * mk-sbuild-lv: Copy mirror used for debootstrap into chroot too. + + -- Mario Limonciello Thu, 17 Jul 2008 11:20:49 -0500 + +ubuntu-dev-tools (0.31) intrepid; urgency=low + + [ Siegfried-Angel Gevatter Pujals (RainCT) ] + * pbuilder-dist.new: + - Rewrite the script in Python to make it more robust and faster. + * what-patch: + - If cdbs-edit-patch is used, output "cdbs (patchsys.mk)" instead of + just "cdbs" (LP: #195795). + * check-symbols: + - Add a brief explanation about why sudo privilegies are required + in order to run this script (LP: #194622). + - End with exit code 1 if there's an error. + * suspicious-source: + - Whitelist C# files (LP: #225691): *.cs. + - Whitelist manpages: *.[0-9]. + + [ Daniel Hahler ] + * requestsync: + - Use debian_bundle.changelog.Version for version comparison in + debian_changelog. + - Fix --lp for Firefox 3 (LP: #208808): + It now tries ~/.lpcookie.txt, ~/.mozilla/*/*/cookies.sqlite and + ~/.mozilla/*/*/cookies.txt to find a Launchpad cookie file. + Also added a hint that you can create a valid file, by logging into + Launchpad with Firefox. + - Added confirm loops, which displays the message to be send/posted and + either allows to edit (or forces to, in case of Ubuntu changes). + (LP: #194613, #194615) + This adds a convient edit_report method, which gets used both from the + Launchpad and mail code path. + - Do not fallback to submitting by email, if posting to Launchpad failed. + This hasn't been requested and therefore should not get done. + - post_bug: Catch IOError when setting bug importance (LP: #190061) + - mail_bug: Catch socket.error (LP: #190739) + + [ Kees Cook ] + * mk-sbuild-lv + - don't install recommended packages during chroot install. + - allow customization of schroot.conf suffix and LV/snapshot sizes. + * what-patch: + - restore previous output behavior, added logic to verbose test instead. + - added details for each patch system report. + * pull-debian-debdiff: + - parse .dsc file for required source files. + - switch to GPLv3 + * debian/control: add Depends needed for pull-debian-debdiff. + * debian/copyright: + - updated pull-debian-debdiff, which is now GPLv3. + - adjusted Copyright lines to make lintian happy. + + -- Kees Cook Fri, 13 Jun 2008 11:43:24 -0700 + ubuntu-dev-tools (0.30) hardy; urgency=low [ Siegfried-Angel Gevatter Pujals (RainCT) ] diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/debian/control /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/debian/control --- ubuntu-dev-tools-0.30/debian/control 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/debian/control 2008-08-09 13:25:31.000000000 +0100 @@ -8,12 +8,12 @@ Build-Depends-Indep: python-central (>= 0.5) XS-Python-Version: all Homepage: https://launchpad.net/ubuntu-dev-tools/ -Standards-Version: 3.7.3 +Standards-Version: 3.8.0 Package: ubuntu-dev-tools Architecture: all Section: devel -Depends: ${python:Depends}, binutils, devscripts, sudo, python-launchpad-bugs (>= 0.2.25), python-debian, dctrl-tools, lsb-release +Depends: ${python:Depends}, binutils, devscripts, sudo, python-launchpad-bugs (>= 0.2.25), python-debian, dctrl-tools, lsb-release, diffstat, dpkg-dev Recommends: bzr, pbuilder, reportbug (>= 3.39ubuntu1) Conflicts: devscripts (<< 2.10.7ubuntu5) Replaces: devscripts (<< 2.10.7ubuntu5) diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/debian/copyright /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/debian/copyright --- ubuntu-dev-tools-0.30/debian/copyright 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/debian/copyright 2008-08-09 13:25:31.000000000 +0100 @@ -5,6 +5,7 @@ Albert Damen Albin Tonnerre + Daniel Hahler Daniel Holbach Jamin W. Collins Jordan Mantha @@ -17,26 +18,28 @@ Soren Hansen Steve Kowalik Terence Simpson + Iain Lane Copyright: - Canonical Ltd. 2006-2008 - Albert Damen 2007 - Albin Tonnerre 2006-2007 - Daniel Holbach 2006-2007 - Luke Yelavich 2006-2007 - Martin Pitt 2007 - Michael Bienia 2006-2007 - Kees Cook 2006-2008 - Pete Savage 2006-2007 - Siegfried-A. Gevatter 2007-2008 - Terence Simpson 2007 + (C) 2006-2008, Canonical Ltd. + (C) 2007, Albert Damen + (C) 2006-2007, Albin Tonnerre + (C) 2006-2007, Daniel Holbach + (C) 2006-2007, Luke Yelavich + (C) 2007, Martin Pitt + (C) 2006-2007, Michael Bienia + (C) 2006-2008, Kees Cook + (C) 2006-2007, Pete Savage + (C) 2007-2008, Siegfried-A. Gevatter + (C) 2007, Terence Simpson + (C) 2008, Iain Lane Licenses: 404main, check-symbols, dch-repeat, dgetlp, mk-sbuild-lv, pbuilder-dist, -pull-debian-debdiff, requestsync, reverse-build-depends, submittodebian, -update-maintainer and what-patch are licensed under GPLv2: +requestsync, reverse-build-depends, submittodebian, update-maintainer +and what-patch are licensed under GPLv2: This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -50,8 +53,8 @@ On Debian systems, the complete text of the GNU General Public License v2 can be found in `/usr/share/common-licenses/GPL-2'. -get-branches, get-build-deps, massfile, ppaput and suspicious-source -are licensed under GPLv3: +get-branches, get-build-deps, debian-pull-debdiff, massfile, ppaput, +suspicious-source and pull-lp-source are licensed under GPLv3: This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -67,4 +70,5 @@ The following of the scripts can be used, at your option, regarding any later version of the previously specified license: 404main, pbuilder-dist, -dgetlp, reverse-build-depends, suspicious-source and get-build-deps. +dgetlp, reverse-build-depends, suspicious-source, pull-lp-source and +get-build-deps. diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/debian/rules /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/debian/rules --- ubuntu-dev-tools-0.30/debian/rules 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/debian/rules 2008-08-09 13:25:31.000000000 +0100 @@ -6,6 +6,3 @@ include /usr/share/cdbs/1/class/python-distutils.mk DEB_INSTALL_MANPAGES_ubuntu-dev-tools = doc/*.1 - -binary-install/ubuntu-dev-tools:: - rm -rf debian/ubuntu-dev-tools/usr/lib diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/doc/pull-lp-source.1 /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/doc/pull-lp-source.1 --- ubuntu-dev-tools-0.30/doc/pull-lp-source.1 1970-01-01 01:00:00.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/doc/pull-lp-source.1 2008-08-09 13:25:31.000000000 +0100 @@ -0,0 +1,39 @@ +.TH PULL-LP-SOURCE "1" "4 August 2008" "ubuntu-dev-tools" + +.SH NAME +pull-lp-source \- download a source package from Launchpad + +.SH SYNOPSIS +.B pull-lp-source [-h] <\fBsource package\fR> [\fItarget release\fR] + +.SH DESCRIPTION +.PP +\fBpull-lp-source\fR downloads and extracts the latest version of +<\fBsource package\fR> from Launchpad. If the optional parameter +[\fItarget release\fR] is specified, the latest version in that release +will be downloaded instead. + +.SH OPTIONS +.PP +Listed below are the command line options for requestsync: +.TP +.B \-h, --help +Display a help message and exit. +.TP +.B +This is the source package that you would like to be downloaded from Launchpad. +.TP +.B [target release] +This is the release that you would like the source package to be downloaded from. +This value defaults to the current development release. + +.SH ENVIRONMENT VARIABLES +.TP +DIST +Specifies the default target. + +.SH AUTHOR +.PP +\fBpull-lp-source\fR and this manual page were written by Iain Lane +. Both are released under the GNU General Public +License, version 3 or later. diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/doc/requestsync.1 /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/doc/requestsync.1 --- ubuntu-dev-tools-0.30/doc/requestsync.1 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/doc/requestsync.1 2008-08-09 13:25:31.000000000 +0100 @@ -50,7 +50,7 @@ .B This is the release that you would like the source package to be synced into. -This should always be the latest development release of Ubuntu, i.e.: hardy. +This should always be the latest development release of Ubuntu. .TP .B [base version] In some cases, the base version (where the Ubuntu package started differing diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/doc/update-maintainer.1 /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/doc/update-maintainer.1 --- ubuntu-dev-tools-0.30/doc/update-maintainer.1 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/doc/update-maintainer.1 2008-08-09 13:25:31.000000000 +0100 @@ -1,16 +1,14 @@ -.TH UPDATE\-MAINTAINER "1" "February 17, 2008" "ubuntu-dev-tools" +.TH UPDATE\-MAINTAINER "1" "August 04, 2008" "ubuntu-dev-tools" .SH NAME -update\-maintainer \- change Maintainer field in a Debian source package +update\-maintainer \- change the Maintainer field in a Debian source package .SH SYNOPSIS -.B update\-maintainer [\fI\-\-path=\fR] [\fI\-\-section=
\fR] [\fI\-\-nochangelog\fR] +.B update\-maintainer [\fB\-\-path=\fP] [\fB\-\-section=
\fP] .SH DESCRIPTION \fBupdate\-maintainer\fP updates the Maintainer field in the source of an Ubuntu package to match the DebianMaintainerField specification. -.PP -See https://wiki.ubuntu.com/DebianMaintainerField for more information. .SH OPTIONS .TP @@ -21,11 +19,9 @@ Manually specify the section of the package. This is necessary if the package is not yet in the archive or if you don't have an Internet connection available when you run \fBupdate\-maintainer\fP. -.TP -\fB\-\-nochangelog\fP, \fB\-\-no\-changelog\fP -By default, \fBupdate\-maintainer\fP adds an entry to the changelog -explaining that it changed the Maintainer field. If you don't want -that to happen, use this option. + +.SH SEE ALSO +See https://wiki.ubuntu.com/DebianMaintainerField for more information. .SH AUTHOR \fBupdate-maintainer\fP has been written by Albin Tonnerre diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/examples/massfile.instructions /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/examples/massfile.instructions --- ubuntu-dev-tools-0.30/examples/massfile.instructions 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/examples/massfile.instructions 2008-08-09 13:25:31.000000000 +0100 @@ -1,5 +1,6 @@ subject: [UNMETDEPS] $pack has unmet dependencies assignee: +status: confirmed subscribers: motu tags: unmetdeps buglist-url: http://bugs.launchpad.net/ubuntu/+bugs?field.tag=unmetdeps @@ -13,4 +14,3 @@ installable (on AMD64) at the moment. . Please have a look and make sure it's installable again. - diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/massfile /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/massfile --- ubuntu-dev-tools-0.30/massfile 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/massfile 2008-08-09 13:25:31.000000000 +0100 @@ -2,11 +2,15 @@ # -*- coding: utf-8 -*- # # (C) Canonical, 2007, GPL v3 +# +# Modified by Iain Lane , taking some code written by +# Daniel Hahler import os import sys import email import subprocess +import glob import launchpadbugs.connector as Connector @@ -18,7 +22,7 @@ instr = dict() for field in "subject", "assignee", "subscribers", "tags", "text", \ - "buglist-url": + "buglist-url", "status": instr[field] = instructions.get(field) return instr @@ -66,7 +70,7 @@ def file_bug(config): Bug = Connector.ConnectBug() - Bug.authentication = os.path.expanduser("~/.lpcookie") + Bug.authentication = cookie try: summary = config["subject"].replace("$pack", config["sourcepackage"]) @@ -85,6 +89,10 @@ if tag.strip("\n").strip(): bug.tags.append(tag.strip("\n").strip()) bug.assignee = config["assignee"] + if config["status"]: + bug.status = config["status"].capitalize() + else: + bug.status = "Confirmed" bug.commit() except: "Bug for '%s' was not filed." % config["sourcepackage"] @@ -100,16 +108,38 @@ return packages - +def lp_cookie(): + global cookie + cookie = None + + # Search cookiefile (for authentication to lp) + if cookie == None: + try_globs = ('~/.lpcookie.txt', '~/.mozilla/*/*/cookies.sqlite', '~/.mozilla/*/*/cookies.txt') + for try_glob in try_globs: + try: + cookiefile = glob.glob(os.path.expanduser(try_glob))[0] + except IndexError: + continue + # Found: + print "Using cookie file at «%s».\n" % cookiefile + cookie = cookiefile + break + + if cookie == None: + raise RuntimeError("Could not find cookie file for Launchpad \ +(looked in %s). You should be able to create a valid file by logging into \ +Launchpad with Firefox") % ", ".join(try_globs) + def main(): if not check_configfiles(): sys.exit(1) - if not os.path.exists(os.path.expanduser("~/.lpcookie")): - print >> sys.stderr, \ - "Launchpad cookie not found in ~/.lpcookie." + try: + lp_cookie() + except RuntimeError, e: + print e sys.exit(1) - + config = read_config() pack_list = read_list() buglist = read_buglist(config["buglist-url"]) diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/mk-sbuild-lv /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/mk-sbuild-lv --- ubuntu-dev-tools-0.30/mk-sbuild-lv 2008-04-08 15:28:39.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/mk-sbuild-lv 2008-08-09 13:25:31.000000000 +0100 @@ -19,8 +19,6 @@ # to do i386 builds on amd64, you will need to patch "sbuild" to correctly # detect the chroot architecture: # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392992 -# -# Version: 0.12 set -e @@ -81,6 +79,10 @@ exit 1 fi +# Set up configurable defaults (loaded after option processing) +LV_SIZE="5G" +SNAPSHOT_SIZE="4G" + function usage() { echo "Usage: $0 [OPTIONS] VG Release" >&2 @@ -91,6 +93,11 @@ echo " --debug Turn on script debugging" echo " --source-template=FILE Use FILE as the sources.list template" echo " --debootstrap-mirror=URL Use URL as the debootstrap source" + echo "" + echo "Configuration (via ~/.mk-sbuild-lv.rc)" + echo " LV_SIZE Size of source LVs (default ${LV_SIZE})" + echo " SNAPSHOT_SIZE Size of snapshot LVs (default ${SNAPSHOT_SIZE})" + echo " SCHROOT_CONF_SUFFIX Lines to append to schroot.conf entries" exit 1 } @@ -112,7 +119,7 @@ # By default, use the native architecture. arch_opt="--arch $2" arch_suffix="-$2" - if [ -z "$personality" -a "$2" = "i386" ] + if [ "$2" = "i386" ] || [ "$2" = "lpia" ] && [ -z "$personality" ]; then personality="linux32" fi @@ -126,18 +133,18 @@ name="$2" shift 2 ;; - --source-template) - TEMPLATE_SOURCES="$2" - shift 2 - if [ ! -r $TEMPLATE_SOURCES ]; then - echo "W: Template file $TEMPLATE_SOURCES is not readable" - echo "W: Continuing with default sources!" - fi - ;; - --debootstrap-mirror) - DEBOOTSTRAP_MIRROR="$2" - shift 2 - ;; + --source-template) + TEMPLATE_SOURCES="$2" + shift 2 + if [ ! -r $TEMPLATE_SOURCES ]; then + echo "W: Template file $TEMPLATE_SOURCES is not readable" + echo "W: Continuing with default sources!" + fi + ;; + --debootstrap-mirror) + DEBOOTSTRAP_MIRROR="$2" + shift 2 + ;; --) shift break @@ -166,6 +173,11 @@ CHROOT_PATH="/dev/$VG/$CHROOT_LV" CHROOT_NAME="${name}${arch_suffix}" +# Load customizations +if [ -r ~/.mk-sbuild-lv.rc ]; then + . ~/.mk-sbuild-lv.rc +fi + # Does the specified VG exist? (vgdisplay doesn't set error codes...) if [ `sudo vgdisplay -c "$VG" | wc -l` -eq 0 ]; then exit 1 @@ -179,8 +191,13 @@ variant_opt="--variant=buildd" fi +# are we doing an lpia build? +if [ -z "$DEBOOTSTRAP_MIRROR" ] && [ "$arch_opt" = "--arch lpia" ]; then + DEBOOTSTRAP_MIRROR="http://ports.ubuntu.com/" +fi + # Allocate the "golden" chroot LV -sudo lvcreate -n "$CHROOT_LV" -L 5G "$VG" +sudo lvcreate -n "$CHROOT_LV" -L "$LV_SIZE" "$VG" sudo mkfs -t ext3 "$CHROOT_PATH" # Mount and debootstrap the chroot @@ -196,10 +213,10 @@ cat "$TEMPLATE_SOURCES" > "$TEMP_SOURCES" else cat > "$TEMP_SOURCES" <> "$TEMP_SCHROOTCONF" fi +if [ ! -z "$SCHROOT_CONF_SUFFIX" ]; then + echo "$SCHROOT_CONF_SUFFIX" >> "$TEMP_SCHROOTCONF" +fi cat "$TEMP_SCHROOTCONF" | sed \ -e "s|CHROOT_NAME|$CHROOT_NAME|g" \ -e "s|CHROOT_PATH|$CHROOT_PATH|g" \ + -e "s|SNAPSHOT_SIZE|$SNAPSHOT_SIZE|g" \ | \ sudo bash -c "cat >> /etc/schroot/schroot.conf" rm -f "$TEMP_SCHROOTCONF" @@ -261,7 +282,7 @@ echo set debconf/frontend Noninteractive | debconf-communicate echo set debconf/priority critical | debconf-communicate # Install basic build tool set, trying to match buildd -apt-get -y install $BUILD_PKGS +apt-get -y --no-install-recommends install $BUILD_PKGS # Set up expected /dev entries if [ ! -r /dev/stdin ]; then ln -s /proc/self/fd/0 /dev/stdin; fi if [ ! -r /dev/stdout ]; then ln -s /proc/self/fd/1 /dev/stdout; fi diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/pbuilder-dist.new /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/pbuilder-dist.new --- ubuntu-dev-tools-0.30/pbuilder-dist.new 1970-01-01 01:00:00.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/pbuilder-dist.new 2008-08-09 13:25:31.000000000 +0100 @@ -0,0 +1,335 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright (C) 2007-2008 Siegfried-A. Gevatter +# With some changes by Iain Lane +# Based upon pbuilder-dist-simple by Jamin Collins and Jordan Mantha. +# +# License: GPLv2 or later +# +# This script is a wrapper to be able to easily use pbuilder for +# different distributions (eg, Gutsy, Hardy, Debian unstable, etc). +# +# You can create symlinks to a pbuilder-dist executable to get different +# configurations. For example, a symlink called pbuilder-hardy will assume +# that the target distribution is always meant to be Ubuntu Hardy. + +import sys +import os + +debian_distros = ['etch', 'lenny', 'sid', 'stable', 'testing', 'unstable'] + +class pbuilder_dist: + + def __init__(self): + + # Base directory where pbuilder will put all the files it creates. + self.base = None + + # Name of the operation which pbuilder should perform. + self.operation = None + + # Wheter additional components should be used or not. That is, + # 'universe' and 'multiverse' for Ubuntu chroots and 'contrib' + # and 'non-free' for Debian. + self.extra_components = True + + # File where the log of the last operation will be saved. + self.logfile = None + + # System architecture + self.system_architecture = None + + # Build architecture + self.build_architecture = None + + # System's distribution + self.system_distro = None + + # Target distribution + self.target_distro = None + + # This is an identificative string which will either take the form + # 'distribution' or 'distribution-architecture'. + self.chroot_string = None + + # Proxy + self.proxy = None + + # Authentication method + self.auth = 'sudo' + + ############################################################## + + if 'PBUILDFOLDER' in os.environ: + self.base = os.environ['PBUILDFOLDER'] + else: + self.base = os.path.expanduser('~/pbuilder/') + + if not os.path.exists(self.base): + os.makedirs(self.base) + + if 'PBUILDAUTH' in os.environ: + self.auth = os.environ['PBUILDAUTH'] + + self.system_architecture = host_architecture() + + if not self.system_architecture or 'not found' in self.system_architecture: + print 'Error: Not running on a Debian based system; could not detect its architecture.' + + if not os.path.isfile('/etc/lsb-release'): + print 'Error: Not running on a Debian based system; could not find /etc/lsb-release.' + exit(1) + + for line in open('/etc/lsb-release'): + line = line.strip() + if line.startswith('DISTRIB_CODENAME'): + self.system_distro = line[17:] + break + + if not self.system_distro: + print 'Error: Could not determine what distribution you are running.' + exit(1) + + self.target_distro = self.system_distro + + if 'http_proxy' in os.environ: + self.base = os.environ['http_proxy'] + elif 'HTTP_PROXY' in os.environ: + self.base = os.environ['HTTP_PROXY'] + + ############################################################## + + def __getitem__(self, name): + + return getattr(self, name) + + def _calculate(self): + """ pbuilder_dist.calculate(distro) -> None + + Do all necessary variable changes (and therefore required checks) + before the string that will be executed is generated. At this + point it's expected that no more variables will be modified + outside this class. + + """ + + if not self.build_architecture: + self.chroot_string = self.target_distro + self.build_architecture = self.system_architecture + else: + self.chroot_string = '%(target_distro)s-%(build_architecture)s' % self + + if not self.logfile: + self.logfile = '%(base)s.%(chroot_string)s.log' % self + + def set_target_distro(self, distro): + """ pbuilder_dist.set_target_distro(distro) -> None + + Check if the given target distribution name is correct, if it + isn't know to the system ask the user for confirmation before + proceeding, and finally either save the value into the appropiate + variable or finalize pbuilder-dist's execution. + + """ + + if not distro.isalpha(): + print 'Error: «%s» is an invalid distribution codename.' % distro + sys.exit(1) + + if not os.path.isfile(os.path.join('/usr/share/debootstrap/scripts/', distro)): + answer = ask('Warning: Unknown distribution «%s». Do you want to continue [y/N]? ' % distro) + if answer not in ('y', 'Y'): + sys.exit(0) + + self.target_distro = distro + + def set_operation(self, operation): + """ pbuilder_dist.set_operation -> None + + Check if the given string is a valid pbuilder operation and + depending on this either save it into the appropiate variable + or finalize pbuilder-dist's execution. + + """ + + arguments = ('create', 'update', 'build', 'clean', 'login', 'execute') + + if operation not in arguments: + if item_ends_with(arguments, '.dsc'): + self.operation = 'build' + else: + print 'Error: «%s» is not a recognized argument.' % operation + print 'Please use one of those: ' + ', '.join(arguments) + '.' + sys.exit(1) + else: + self.operation = operation + + def get_command(self, remaining_arguments = None): + """ pbuilder_dist.get_command -> string + + Generate the pbuilder command which matches the given configuration + and return it as a string. + + """ + + # Calculate variables which depend on arguments given at runtime. + self._calculate() + + arguments = [ + self.operation, + '--basetgz "%(base)s%(chroot_string)s-base.tgz"' % self, + '--distribution "%(target_distro)s"' % self, + '--buildresult "%(base)s%(chroot_string)s_result/"' % self, + '--logfile "%(logfile)s"' % self, + '--aptcache "/var/cache/apt/archives/"', + ### --mirror "${ARCHIVE}" \ + '--bindmounts "/var/cache/archive/"', + '--override-config', + ] + + localrepo = '/var/cache/archive/%(target_distro)s' % self + if os.path.exists(localrepo): + arguments.append('--othermirror ' +\ + '"deb file:///var/cache/archive/ %(target_distro)s/"' % self) + + if self.target_distro in debian_distros: + arguments.append('--mirror "ftp://ftp.debian.org/debian"') + arguments.append('--components "main contrib non-free"') + + if self.build_architecture != self.system_architecture: + arguments.append('--debootstrapopts --arch') + arguments.append('--debootstrapopts "%(build_architecture)s"' % self) + + if self.proxy: + arguments.append('--http-proxy "%(proxy)s"' % self) + + ### $( [ $ISDEBIAN != "False" ] || echo "--aptconfdir \"${BASE_DIR}/etc/${DISTRIBUTION}/apt.conf/\"" ) \ + + # Append remaining arguments + if remaining_arguments: + arguments.extend(remaining_arguments) + + return self.auth + ' /usr/sbin/pbuilder ' + ' '.join(arguments) + +def host_architecture(): + """ host_architecture -> string + + Detect the host's architecture and return it as a string + (i386/amd64/other values). + + """ + + return os.uname()[4].replace('x86_64', 'amd64').replace('i586', 'i386').replace('i686', 'i386') + +def item_ends_with(list, string): + """ item_ends_with(list, string) -> bool + + Return True if one of the items in list ends with the given string, + or else return False. + + """ + + for item in list: + if item.endswith(string): + return True + + return False + +def ask(question): + """ ask(question) -> string + + Ask the given question and return the answer. Also catch + KeyboardInterrupt (Ctrl+C) and EOFError (Ctrl+D) exceptions and + immediately return None if one of those is found. + + """ + + try: + answer = raw_input(question) + except (KeyboardInterrupt, EOFError): + print + answer = None + + return answer + +def help(exit_code = 0): + """ help() -> None + + Print a help message for pbuilder-dist, and exit with the given code. + + """ + + print 'Bad...' + + sys.exit(exit_code) + +def main(): + """ main() -> None + + This is pbuilder-dist's main function. It creates a pbuilder_dist + object, modifies all necessary settings taking data from the + executable's name and command line options and finally either ends + the script and runs pbuilder itself or exists with an error message. + + """ + + script_name = os.path.basename(sys.argv[0]) + parts = script_name.split('-') + + # Copy arguments into another list for save manipulation + args = sys.argv[1:] + + if '-' in script_name and parts[0] != 'pbuilder' or len(parts) > 3: + print 'Error: «%s» is not a valid name for a «pbuilder-dist» executable.' % script_name + sys.exit(1) + + if len(args) < 1: + print 'Insufficient number of arguments.' + help(1) + + if args[0] in ('-h', '--help', 'help'): + help(0) + + app = pbuilder_dist() + + if len(parts) > 1: + app.set_target_distro(parts[1]) + else: + app.set_target_distro(args.pop(0)) + + if len(parts) > 2: + requested_arch = parts[2] + elif args[0] in ('i386', 'amd64'): + requested_arch = args.pop(0) + else: + requested_arch = None + + if requested_arch: + if requested_arch in ('i386', 'amd64') and app.system_architecture == 'amd64': + app.build_architecture = requested_arch + else: + print 'Error: Architecture switching is not supported on your system; wrong filename.' + sys.exit(1) + + if 'mainonly' in sys.argv: + app.extra_components = False + args.remove('mainonly') + + if len(args) < 1: + print 'Insufficient number of arguments.' + help(1) + + # Parse the operation + app.set_operation(args.pop(0)) + + # Execute the pbuilder command + sys.exit(os.system(app.get_command(args))) + +if __name__ == '__main__': + + try: + main() + except KeyboardInterrupt: + print 'Manually aborted.' + sys.exit(1) diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/pull-debian-debdiff /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/pull-debian-debdiff --- ubuntu-dev-tools-0.30/pull-debian-debdiff 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/pull-debian-debdiff 2008-08-09 13:25:31.000000000 +0100 @@ -1,15 +1,11 @@ #!/usr/bin/perl -# Copyright 2007 (C) Kees Cook -# License: GPLv2 +# Copyright 2007-2008 Kees Cook +# License GPLv3 # # This script attempts to find and download a specific version of a Debian # package and its immediate parent to generate a debdiff. # # Requirements: devscripts diffstat dpkg-dev -# -# Cleanups needed: -# - general cleanup -# - parse diff.gz/orig.tar.gz from .dsc file instead of guessing version use strict; use warnings; @@ -20,28 +16,36 @@ my $file; $file = "${pkg}_${version}.dsc"; - warn "Trying $urlbase/$file ...\n"; + print "Want '$file'\n"; if (! -r "$file") { - + warn "Trying $urlbase/$file ...\n"; system("wget $urlbase/$file"); return 0 if ($? != 0); } - warn "Pulling source of $urlbase/$file ...\n"; - - $file = "${pkg}_${version}.diff.gz"; - if (! -r "$file") { - system("wget $urlbase/$file"); - return 0 if ($? != 0); + # Parse the .dsc file for list of required files... + my @needed; + open(DSC,"$file") || return 0; + while (my $line=) { + if ($line =~ /^Files:/) { + while (my $file=) { + chomp($file); + last if ($file !~ /^ /); + my @parts = split(/\s+/,$file); + my $want = pop(@parts); + print "Want '$want'\n"; + push(@needed,$want); + } + } } + close(DSC); - my $orig_ver = $version; - $orig_ver =~ s/-.*//; - - $file = "${pkg}_${orig_ver}.orig.tar.gz"; - if (! -r "$file") { - system("wget $urlbase/$file"); - return 0 if ($? != 0); + foreach my $file (@needed) { + if (! -r "$file") { + warn "Pulling $urlbase/$file ...\n"; + system("wget $urlbase/$file"); + return 0 if ($? != 0); + } } return 1; @@ -80,6 +84,8 @@ if (!geturls($urlbase,$pkg,$version)) { # Try snapshot + $urlbase="http://snapshot.debian.net/package/$pkg/$version"; + warn "Fetching snapshot url via '$urlbase' ...\n"; $urlbase=`curl -sI 'http://snapshot.debian.net/package/$pkg/$version' | grep ^[lL]ocation | cut -d' ' -f2 | head -1`; $urlbase =~ s/[\r\n]//g; warn "Trying snapshot location '$urlbase' ...\n"; @@ -94,8 +100,10 @@ } + my $pkg = $ARGV[0]; my $version = $ARGV[1]; +my $just_fetch = ($ARGV[2] && $ARGV[2] eq "--fetch"); my $skip = $ARGV[2] || 1; $skip+=0; @@ -106,19 +114,32 @@ # Extract latest source die "Cannot locate $pkg $version\n" unless download_source($pkg,$version); +exit(0) if ($just_fetch); system("dpkg-source -x ${pkg}_${version}.dsc"); die "Unpack of $pkg $version failed\n" unless ($? == 0); # Locate prior changelog entry my $prev_ver; -my $srcdir; -opendir(DIR,"."); -while ($srcdir = readdir(DIR)) { - last if ($srcdir =~ /^${pkg}-/ && -d $srcdir); +my $upstream_version = $version; +if ($upstream_version =~ /^([^-]+)-/) { + $upstream_version = $1; +} +my $srcdir="$pkg-$upstream_version"; +if (! -d "$srcdir") { + undef $srcdir; + my $dir; + opendir(DIR,"."); + while ($dir = readdir(DIR)) { + if ($dir =~ /^${pkg}-/ && -d $dir) { + $srcdir = $dir; + last; + } + } + closedir(DIR); } -closedir(DIR); die "Cannot locate source tree\n" if (!defined($srcdir)); -open(LOG,"<$srcdir/debian/changelog"); +my $log = "$srcdir/debian/changelog"; +open(LOG,"<$log") || die "$log: $!\n"; while (my $line=) { if ($line =~ /^$pkg \((?:\d+:)?([^\)]+)\)/) { my $seen = $1; @@ -136,8 +157,8 @@ die "Cannot find earlier source version\n" if (!defined($prev_ver)); die "Cannot locate $pkg $prev_ver\n" unless download_source($pkg,$prev_ver); -system("dpkg-source -x ${pkg}_${prev_ver}.dsc"); -die "Unpack of $pkg $prev_ver failed\n" unless ($? == 0); +#system("dpkg-source -x ${pkg}_${prev_ver}.dsc"); +#die "Unpack of $pkg $prev_ver failed\n" unless ($? == 0); system("debdiff ${pkg}_${prev_ver}.dsc ${pkg}_${version}.dsc > ${pkg}_${version}.debdiff"); die "Cannot debdiff\n" unless ($? == 0); diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/pull-lp-source /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/pull-lp-source --- ubuntu-dev-tools-0.30/pull-lp-source 1970-01-01 01:00:00.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/pull-lp-source 2008-08-09 13:25:31.000000000 +0100 @@ -0,0 +1,87 @@ +#!/usr/bin/python +# pull-lp-source -- pull a source package from Launchpad +# Basic usage: pull-lp-source [] +# +# Copyright (C) 2008 Iain Lane +# +# BackportFromLP class taken from prevu tool, which has +# copyright (C) 2006 John Dong . +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# TODO: Determine before going to LP whether a source package and distro exist or not. +# TODO: Determine current development distro programatically + +import sys +import os + +class BackportFromLP: + + def __getitem__(self, name): + return getattr(self, name) + + def __init__(self, package, target_distro): + self.package = package + self.target_distro = target_distro + self.__prepare_sources() + + def __prepare_sources(self): + # Scrape the source package from Launchpad :) + import re + + contents = os.popen('wget -q https://launchpad.net/ubuntu/%(target_distro)s/+source/%(package)s -O-' % self).read() + links = re.findall('a href=\"(.*\.dsc)\"', contents) + + if len(links) == 1 and \ + (os.system('dget -x http://launchpad.net%s' % links[0])) == 0: + print '\nSuccess!' + else: + raise ValueError, '\nFailed to fetch and extract the source. ' +\ + 'Ensure that the package specified is a valid source ' +\ + 'package name and that Launchpad is not down.' + +default_distro = 'intrepid' + +def usage(): + print 'Usage: %s [distro]' % sys.argv[0] + +if __name__ == '__main__': + + args = sys.argv[1:] or [] + + if args == [] or args[0] in ('-h', '--help'): + usage() + sys.exit(0) + + if len(args) >= 1: + package = args[0] + + if len(args) == 2: + distro = args[1] + elif len(args) == 1: + distro = os.getenv('DIST') or default_distro + else: # incorrect args + usage() + sys.exit(1) + + # Correct-ish args, can proceed + try: + print 'Attempting to get %s from distro %s...' % \ + (package, distro.capitalize()) + BackportFromLP(package, distro) + except ValueError, e: + print 'Error when downloading package %s from distro %s: %s' % \ + (package, distro, e) diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/requestsync /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/requestsync --- ubuntu-dev-tools-0.30/requestsync 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/requestsync 2008-08-09 13:25:31.000000000 +0100 @@ -1,15 +1,27 @@ #!/usr/bin/python # -*- coding: utf-8 -*- - +# # (C) 2007 Canonical Ltd., Steve Kowalik # Authors: -# Martin Pitt -# Steve Kowalik -# Michael Bienia (python-launchpad-bugs support) +# Martin Pitt +# Steve Kowalik +# Michael Bienia (python-launchpad-bugs support) +# Daniel Hahler +# Iain Lane # -# License: GPLv2, see /usr/share/common-licenses/GPL +# License: GPLv2, see /usr/share/common-licenses/GPL-2 import os, sys, urllib, subprocess, getopt +from debian_bundle.changelog import Version + +# Set this to the path of your Launchpad cookie file, when using +# python-launchpad-bugs support (--lp). +# The following will be tried automatically, if unset (first match gets used): +# 1. ~/.lpcookie.txt +# 2. ~/.mozilla/*/*/cookies.sqlite +# 3. ~/.mozilla/*/*/cookies.txt +launchpad_cookiefile = None + def cur_version_component(sourcepkg, release): '''Determine current package version in ubuntu.''' @@ -54,13 +66,17 @@ '''Return the Debian changelog from the latest up to the given version (exclusive).''' + base_version = Version(version) + ch = '' subdir = sourcepkg[0] if sourcepkg.startswith('lib'): subdir = 'lib%s' % sourcepkg[3] for l in urllib.urlopen('http://packages.debian.org/changelogs/pool/%s/%s/%s/current/changelog.txt' % (component, subdir, sourcepkg)): - if l.startswith(sourcepkg) and l.find(version + ')') > 0: - break + if l.startswith(sourcepkg): + ch_version = l[ l.find("(")+1 : l.find(")") ] + if Version(ch_version) <= base_version: + break ch += l return ch @@ -83,10 +99,10 @@ component = raw_comp[1].strip() return component -def wait_for_enter_or_exit(): - """Helper function to wait for ENTER and catch Control-C for abortion.""" +def raw_input_exit_on_ctrlc(*args, **kwargs): + """A wrapper around raw_input() to exit with a normalized message on Control-C""" try: - raw_input() + return raw_input(*args, **kwargs) except KeyboardInterrupt: print 'Abort requested. No sync request filed.' sys.exit(1) @@ -107,19 +123,28 @@ ''' sys.exit(1) +def get_email_address(): + '''Get the DEBEMAIL environment variable or give an error.''' + myemailaddr = os.getenv('DEBEMAIL') + if not myemailaddr: + print >> sys.stderr, 'The environment variable DEBEMAIL needs to be ' +\ + ' set to make use of this script, unless you use option --lp.' + return myemailaddr + def mail_bug(source_package, subscribe, status, bugtitle, bugtext, keyid = None): '''Submit the sync request per email. Return True if email successfully send, otherwise False.''' import smtplib + import socket to = 'new@bugs.launchpad.net' - myemailaddr = os.getenv('DEBEMAIL') + myemailaddr = get_email_address() if not myemailaddr: - print >> sys.stderr, 'The environment variable DEBEMAIL needs to be set to make use of this script.' return False + # generate initial mailbody mailbody = '' if source_package: mailbody += ' affects ubuntu/%s\n' % source_package @@ -127,7 +152,7 @@ mailbody += ' affects ubuntu\n' mailbody = mailbody + ' status %s\n importance wishlist\n subscribe %s\n\n%s' % (status, subscribe, bugtext) - # sign it + # prepare sign_command sign_command = 'gpg' for cmd in ('gpg2', 'gnome-gpg'): if os.access('/usr/bin/%s' % cmd, os.X_OK): @@ -137,17 +162,29 @@ if keyid: gpg_command.extend(('-u', keyid)) - gpg = subprocess.Popen(gpg_command, stdin = subprocess.PIPE, stdout = subprocess.PIPE) - signed_report = gpg.communicate(mailbody)[0] - assert gpg.returncode == 0 - - # generate email - mail = 'From: %s\nTo: %s\nSubject: %s\n\n%s' % (myemailaddr, to, bugtitle, signed_report) - - print mail - - print 'Press ENTER to file this bug, Control-C to abort.' - wait_for_enter_or_exit() + in_confirm_loop = True + while in_confirm_loop: + # sign it + gpg = subprocess.Popen(gpg_command, stdin = subprocess.PIPE, stdout = subprocess.PIPE) + signed_report = gpg.communicate(mailbody)[0] + assert gpg.returncode == 0 + + # generate email + mail = 'From: %s\nTo: %s\nSubject: %s\n\n%s' % (myemailaddr, to, bugtitle, signed_report) + + # ask for confirmation and allow to edit: + print mail + print 'Do you want to edit the report before sending [y/N]? Press Control-C to abort.' + while 1: + val = raw_input_exit_on_ctrlc() + if val.lower() in ('y', 'yes'): + (bugtitle, mailbody) = edit_report(bugtitle, mailbody) + break + elif val.lower() in ('n', 'no', ''): + in_confirm_loop = False + break + else: + print "Invalid answer" # get server address mailserver = os.getenv('DEBSMTP') @@ -164,7 +201,12 @@ mailserver_port = 25 # connect to the server - s = smtplib.SMTP(mailserver, mailserver_port) + try: + s = smtplib.SMTP(mailserver, mailserver_port) + except socket.error, s: + print "ERROR: Could not connect to mailserver %s at port %s: %s (%i)" % \ + (mailserver, mailserver_port, s[1], s[0]) + return False # authenticate to the server mailserver_user = os.getenv('DEBSMTP_USER') @@ -189,23 +231,34 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext): '''Use python-launchpad-bugs to submit the sync request. - Return True if email successfully send, otherwise False.''' + Return True if successfully posted, otherwise False.''' import glob, os.path + global launchpad_cookiefile try: import launchpadbugs.connector except ImportError: print >> sys.stderr, 'Importing launchpadbugs failed. Is python-launchpad-bugs installed?' - print >> sys.stderr, 'Falling back to submitting per email.' return False # Search cookiefile (for authentication to lp) - try: - cookiefile = glob.glob(os.path.expanduser('~/.mozilla/*/*/cookies.txt'))[0] - except IndexError: - print >> sys.stderr, 'Could not find Firefox cookie file' - return False + if launchpad_cookiefile == None: + try_globs = ('~/.lpcookie.txt', '~/.mozilla/*/*/cookies.sqlite', '~/.mozilla/*/*/cookies.txt') + for try_glob in try_globs: + try: + cookiefile = glob.glob(os.path.expanduser(try_glob))[0] + except IndexError: + continue + # Found: + launchpad_cookiefile = cookiefile + print "Using cookie file at «%s».\n" % launchpad_cookiefile + break + + if launchpad_cookiefile == None: + print >> sys.stderr, 'Could not find cookie file for Launchpad (looked in %s)' % ", ".join(try_globs) + print >> sys.stderr, 'You should be able to create a valid file by logging into Launchpad with Firefox' + return False if source_package: product = {'name': source_package, 'target': 'ubuntu'} @@ -213,17 +266,32 @@ # new source package product = {'name': 'ubuntu'} - print 'Summary:\n%s\n\nDescription:\n%s' % (bugtitle, bugtext) - - print 'Press ENTER to file this bug, Control-C to abort.' - wait_for_enter_or_exit() + in_confirm_loop = True + while in_confirm_loop: + print 'Summary:\n%s\n\nDescription:\n%s' % (bugtitle, bugtext) + + # ask for confirmation and allow to edit: + print 'Do you want to edit the report before sending [y/N]? Press Control-C to abort.' + while 1: + val = raw_input_exit_on_ctrlc() + if val.lower() in ('y', 'yes'): + (bugtitle, bugtext) = edit_report(bugtitle, bugtext) + break + elif val.lower() in ('n', 'no', ''): + in_confirm_loop = False + break + else: + print "Invalid answer" # Create bug Bug = launchpadbugs.connector.ConnectBug() - Bug.authentication = cookiefile + Bug.authentication = launchpad_cookiefile bug = Bug.New(product = product, summary = bugtitle, description = bugtext) - bug.importance = 'Wishlist' + try: + bug.importance = 'Wishlist' + except IOError, s: + print "Warning: setting importance failed: %s" % s bug.status = status bug.subscriptions.add(subscribe) bug.commit() @@ -232,6 +300,54 @@ return True +def edit_report(subject, body, changes_required=False): + """Edit a report (consisting of subject and body) in sensible-editor. + + subject and body get decorated, before they are written to the temporary + file and undecorated after editing again. + If changes_required is True and the file has not been edited + (according to its mtime), an error is written to STDERR and the + program exits. + Returns (new_subject, new_body). + """ + import re, string + + report = "Summary (one line):\n%s\n\nDescription:\n%s" % (subject, body) + + # Create tempfile and remember mtime + import tempfile + report_file = tempfile.NamedTemporaryFile( prefix='requestsync_' ) + report_file.file.write(report) + report_file.file.flush() + mtime_before = os.stat( report_file.name ).st_mtime + + # Launch editor + try: + editor = subprocess.check_call( ['sensible-editor', report_file.name] ) + except subprocess.CalledProcessError, e: + print >> sys.stderr, 'Error calling sensible-editor: %s\nAborting.' % (e,) + sys.exit(1) + + # Check if the tempfile has been changed + if changes_required: + report_file_info = os.stat( report_file.name ) + if mtime_before == os.stat( report_file.name ).st_mtime: + print >> sys.stderr, 'The temporary file %s has not been changed, but you have\nto explain why the Ubuntu changes can be dropped. Aborting. [Press ENTER]' % (report_file.name,) + raw_input() + sys.exit(1) + + report_file.file.seek(0) + report = report_file.file.read() + report_file.file.close() + + # Undecorate report again: + (new_subject, new_body) = report.split("\nDescription:\n", 1) + # Remove prefix and whitespace for subject: + new_subject = string.rstrip( re.sub("\n", " ", re.sub("^Summary \(one line\):\s*", "", new_subject, 1)) ) + + return (new_subject, new_body) + + # # entry point # @@ -242,7 +358,6 @@ keyid = None use_lp_bugs = False need_interaction = False - edit_report = False try: opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnsk:', ('lp')) @@ -254,10 +369,13 @@ if o == '-s': sponsorship = True if o == '-k': keyid = a if o == '--lp': use_lp_bugs = True - + if len(args) not in (2, 3): usage() + if not use_lp_bugs and not get_email_address(): + sys.exit(1) + (srcpkg, release) = args[:2] force_base_ver = None if len(args) == 3: @@ -292,12 +410,13 @@ base_ver = base_ver[:uidx] need_interaction = True - print 'There have been changes made in Ubuntu.' + print 'Changes have been made to the package in Ubuntu.' print 'Please edit the report and give an explanation.' - print 'Press ENTER to start your editor. Press Control-C to abort now. Not saving the report file will abort the request, too.' - wait_for_enter_or_exit() - report += '\nExplanation of the Ubuntu delta and why it can be dropped:\n\n' + \ - 'ENTER_EXPLANATION_HERE\n\n' + print 'Press ENTER to start your editor. Press Control-C to abort now.' + print 'Not saving the report file will abort the request, too.' + raw_input_exit_on_ctrlc() + report += 'Explanation of the Ubuntu delta and why it can be dropped:\n' + \ + '>>> ENTER_EXPLANATION_HERE <<<\n\n' uidx = base_ver.find('build') if uidx > 0: @@ -309,47 +428,21 @@ report += 'Changelog since current %s version %s:\n\n' % (release, cur_ver) report += debian_changelog(srcpkg, debiancomponent, base_ver) + '\n' - # Do we want to edit the report? if need_interaction: - edit_report = True - else: - val = raw_input('Do you want to edit the report [y/N]? ') - if val.lower() in ('y', 'yes'): - edit_report = True - - if edit_report: - # Create tempfile and remember mtime - import tempfile - report_file = tempfile.NamedTemporaryFile( prefix='requestsync_' ) - report_file.file.write(report) - report_file.file.flush() - mtime_before = os.stat( report_file.name ).st_mtime - - # Launch editor - try: - editor = subprocess.check_call( ['sensible-editor', report_file.name] ) - except subprocess.CalledProcessError, e: - print >> sys.stderr, 'Error calling sensible-editor: %s\nAborting.' % (e,) - sys.exit(1) + (_, report) = edit_report(title, report, changes_required=True) - # Check if the tempfile has been changed - report_file_info = os.stat( report_file.name ) - if mtime_before == os.stat( report_file.name ).st_mtime: - print >> sys.stderr, 'The temporary file %s has not been changed. Aborting. [Press ENTER]' % (report_file.name,) - raw_input() - sys.exit(1) - report_file.file.seek(0) - report = report_file.file.read() - report_file.file.close() - - # mail or post the sync request + # Post sync request using Launchpad interface: srcpkg = not newsource and srcpkg or None if use_lp_bugs: # Map status to the values expected by lp-bugs mapping = {'new': 'New', 'confirmed': 'Confirmed'} if post_bug(srcpkg, subscribe, mapping[status], title, report): sys.exit(0) + # Abort on error: + print 'Something went wrong. No sync request filed.' + sys.exit(1) + # Mail sync request: if mail_bug(srcpkg, subscribe, status, title, report, keyid): sys.exit(0) diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/setup.py /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/setup.py --- ubuntu-dev-tools-0.30/setup.py 2008-04-08 15:29:52.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/setup.py 2008-08-09 13:25:31.000000000 +0100 @@ -15,25 +15,26 @@ setup(name='ubuntu-dev-tools', version=version, - scripts=['404main', - 'check-symbols', + scripts=['404main', + 'check-symbols', + 'dch-repeat', + 'dgetlp', 'get-branches', + 'get-build-deps', + 'grab-attachments', + 'hugdaylist', + 'massfile', + 'mk-sbuild-lv', 'pbuilder-dist', 'pbuilder-dist-simple', - 'update-maintainer', - 'dch-repeat', - 'mk-sbuild-lv', 'pull-debian-debdiff', - 'what-patch', - 'suspicious-source', + 'pull-lp-source', 'requestsync', - 'hugdaylist', - 'massfile', - 'submittodebian', - 'get-build-deps', - 'dgetlp', 'reverse-build-depends', - 'grab-attachments', + 'submittodebian', + 'suspicious-source', + 'update-maintainer', + 'what-patch', ], packages=['ubuntutools'], ) diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/suspicious-source /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/suspicious-source --- ubuntu-dev-tools-0.30/suspicious-source 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/suspicious-source 2008-08-09 13:25:31.000000000 +0100 @@ -13,7 +13,8 @@ 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 *.in" + *.svg *.png *.bmp *.gif *.xpm *.hh *.in *.cs *.1 *.2 *.3 *.4 *.5 *.6 \ + *.7 *.8 *.9" IGNORE=".bzr CVS .svn debian" diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/update-maintainer /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/update-maintainer --- ubuntu-dev-tools-0.30/update-maintainer 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/update-maintainer 2008-08-09 13:25:31.000000000 +0100 @@ -7,11 +7,10 @@ usage() { cat <&2 && exit 1 section=$value ;; - "--nochangelog"|"--no-changelog") - nochangelog=1 - ;; "--help") usage exit 0 @@ -87,6 +83,3 @@ for file in control{,.in,.real}; do [ -f $DEBIANDIR/$file ] && sed -ri "s/(^Maintainer:) (.*)/\1 $email\nXSBC-Original-\1 \2/" $DEBIANDIR/$file done - -[ -z "$nochangelog" ] && dch --changelog $DEBIANDIR/changelog "Modify Maintainer value to match the DebianMaintainerField specification." -echo "Maintainer changed to $email." diff -Nru /tmp/iaPm8Pz6xT/ubuntu-dev-tools-0.30/what-patch /tmp/Y3vzPHqm9y/ubuntu-dev-tools-0.35~ppa1~hardy1/what-patch --- ubuntu-dev-tools-0.30/what-patch 2008-04-08 15:25:15.000000000 +0100 +++ ubuntu-dev-tools-0.35~ppa1~hardy1/what-patch 2008-08-09 13:25:31.000000000 +0100 @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2006-2007 (C) Kees Cook +# Copyright 2006-2008 (C) Kees Cook # Modified by Siegfried-A. Gevatter # Modified by Daniel Hahler # License: GPLv2 @@ -14,8 +14,10 @@ Run this inside the source directory of a Debian package and it will detect the patch system that it uses. - -v: Print a list of all those files outside the debian/ directory that have - been modified (if any). + -v: Enable verbose mode: + - Print a list of all those files outside the debian/ directory that have + been modified (if any). + - Report additional details about patch systems, if available. EOM exit 0 fi @@ -29,8 +31,13 @@ cd .. done +VERBOSE=0 if [ "$1" = "-v" ] then + VERBOSE=1 +fi + +if [ "$VERBOSE" -gt 0 ]; then files=`lsdiff -z ../$(dpkg-parsechangelog | grep ^Source: | sed -e "s/^Source: //")_$(dpkg-parsechangelog | grep ^Version: | sed -e "s/^Version: //").diff.gz 2>/dev/null | grep -v 'debian/'` if [ -n "$files" ] then @@ -42,13 +49,51 @@ fi fi +# Do not change the output of existing checks by default, as there are build +# tools that rely on the exisitng output. If changes in reporting is needed, +# please check the "VERBOSE" flag (see below for examples). Feel free +# to add new patchsystem detection and reporting. for filename in $(echo "debian/rules"; grep ^include debian/rules | fgrep -v '$(' | awk '{print $2}') do - fgrep patchsys.mk "$filename" | grep -q -v "^#" && { echo "cdbs"; exit 0; } + fgrep patchsys.mk "$filename" | grep -q -v "^#" && { + if [ "$VERBOSE" -eq 0 ]; then + echo "cdbs"; exit 0; + else + echo "cdbs (patchsys.mk: see 'cdbs-edit-patch')"; exit 0; + fi + } fgrep quilt "$filename" | grep -q -v "^#" && { echo "quilt"; exit 0; } - fgrep dbs-build.mk "$filename" | grep -q -v "^#" && { echo "dbs"; exit 0; } - fgrep dpatch "$filename" | grep -q -v "^#" && { echo "dpatch"; exit 0; } - fgrep '*.diff' "$filename" | grep -q -v "^#" && { echo "diff splash"; exit 0; } + fgrep dbs-build.mk "$filename" | grep -q -v "^#" && { + if [ "$VERBOSE" -eq 0 ]; then + echo "dbs"; exit 0; + else + echo "dbs (see 'dbs-edit-patch')"; exit 0; + fi + } + fgrep dpatch "$filename" | grep -q -v "^#" && { + if [ "$VERBOSE" -eq 0 ]; then + echo "dpatch"; exit 0; + else + echo "dpatch (see 'patch-edit-patch')"; exit 0; + fi + } + fgrep '*.diff' "$filename" | grep -q -v "^#" && { + if [ "$VERBOSE" -eq 0 ]; then + echo "diff splash"; exit 0; + else + echo "diff splash (check debian/rules)"; exit 0; + fi + } done -[ -d debian/patches ] || { echo "patchless?"; exit 0; } -echo "unknown patch system" +[ -d debian/patches ] || { + if [ "$VERBOSE" -eq 0 ]; then + echo "patchless?"; exit 0; + else + echo "patchless? (did not find debian/patches/)"; exit 0; + fi +} +if [ "$VERBOSE" -eq 0 ]; then + echo "unknown patch system" +else + echo "unknown patch system (see debian/patches/ and debian/rules)" +fi