diff --git a/404main b/404main index 604e759..db00ce9 100755 --- a/404main +++ b/404main @@ -3,7 +3,22 @@ # # Copyright 2006-2007 (C) Pete Savage # Copyright 2007 (C) Siegfried-A. Gevatter -# License: GPLv2 or later +# +# ################################################################## +# +# 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 2 +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## # # This script is used to check if a package and all its build # dependencies are in main or not. diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index efee5f0..0000000 --- a/AUTHORS +++ /dev/null @@ -1,15 +0,0 @@ -Albert Damen -Albin Tonnerre -Daniel Hahler -Daniel Holbach -Jamin W. Collins -Jordan Mantha -Luke Yelavich -Martin Pitt -Michael Bienia -Pete Savage -Kees Cook -Siegfried-A. Gevatter -Soren Hansen -Steve Kowalik -Terence Simpson diff --git a/README b/README deleted file mode 100644 index 8cf4e00..0000000 --- a/README +++ /dev/null @@ -1,78 +0,0 @@ -================================ -== Ubuntu Development Tools == -================================ - -404main - ... will check if and all it's build dependencies are - are in the "main" component or not. - -check-symbols [] - ... will compare and give you a diff of the exported symbols of all - .so files in all binary packages of . is not - mandatory and set to /var/cache/pbuilder/result by default. - -dch-repeat [--help] - ... will repeat a change log into an older release. - -dgetlp - ... will simulate «dget»'s behaviour for files hosted at - launchpadlibrarian.net. - -get-branches [checkout|branch] - ... will branch / checkout all the Bazaar branches in a Launchpad - team. - -get-build-deps [] - ... will install the build dependencies for a package, if you are - inside its source file. Alternatively, you can pass it the name of - a file containing a list of packages, one on each line, or just - pass them all as parameters, and it will get their build - dependencies. - -hugdaylist [-n ] - ... will create a list of bug list for a hug day listing - -massfile - ... will perform a massive bug reporting operation on Launchpad - according to the information in the "information" and "list" files - that are in the working directory. - -mk-sbuild-lv - ... will create LVM snapshot chroots via schroot and sbuild. It - assumes that sbuild has not be installed and configured before. - -pbuilder-dist [withlog] [create|update|build|clean|login|execute] - ... is a wrapper to use pbuilder with many different Ubuntu and/or - Debian releases. It's recommended to symlink as pbuilder-feisty, - pbuilder-gutsy, etc. - -pull-debian-debdiff - ... will attempt to find and download a specific version of a - Debian package and its immediate parent to generate a debdiff. - -requestsync [-n|-s] [base version] - ... will file a sync request for a package from Debian by sending - a bug report to Launchpad. - -reverse-build-depends [-c|-s] - ... will print 's build dependencies. - -submittodebian - ... will submit patches to Debian's BTS. Run it from inside the - source directory of a Debian package (note that there has to be - a .dsc for it in the parent directory). - -suspicious-source - ... will output a list of files which are not common source files. - This should be run in the root of a source tree to find files which - might not be the "prefered form of modification" that the GPL and - other licenses require. - -update-maintainer - ... will update the Maintainer field of an Ubuntu package to match - the DebianMaintainerField specification, and add a line about this - to the changelog. - -what-patch - ... will check what patching system is used by a package. You need - to be in its source directory in order for it to work. diff --git a/TODO b/TODO index 2d40c5b..9ac821f 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,7 @@ +- Fix all bugs at Launchpad: + https://bugs.launchpad.net/ubuntu/+source/ubuntu-dev-tools - Create missing manpages (for all commands). -- Document ubuntutools Python modules. -- Add the process-interdiff script to ubuntu-dev-tools. - Modify 404main to use the more robust python-apt module. +- Ask all authors who have used GPL if they are happy with using "or any later" + versions of the license. +- pull-lp-source: determine the current development distro programatically. diff --git a/buildd b/buildd new file mode 100755 index 0000000..2e892d4 --- /dev/null +++ b/buildd @@ -0,0 +1,160 @@ +#!/usr/bin/python +# +# buildd - command line interface for Launchpad buildd operations. +# +# Copyright (C) 2007 Canonical Ltd. +# Authors: +# - Martin Pitt +# - Jonathan Patrick Davies +# +# 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, see . +# + +import os +import re +import sys +import urllib2 +from optparse import OptionGroup +from optparse import OptionParser +from urllib import urlencode + +sys.path.append('/usr/share/ubuntu-dev-tools/') +import common + +# Usage. +usage = "%prog \n\n" +usage += "Where operation may be one of: rescore, retry, or status.\n" +usage += "Only Launchpad Buildd Admins may rescore package builds." + +# Prepare our option parser. +optParser = OptionParser(usage) + +# Retry options +retryRescoreOptions = OptionGroup(optParser, "Retry and rescore options", + "These options may only be used with the 'retry' and 'rescore' operations.") +retryRescoreOptions.add_option("-a", "--arch", type = "string", + action = "store", dest = "architecture", + help = "Rebuild or rescore a specific architecture.") + +# Add the retry options to the main group. +optParser.add_option_group(retryRescoreOptions) + +# Parse our options. +(options, args) = optParser.parse_args() + +# Check we have the correct number of arguments. +if len(args) < 3: + optParser.error("Incorrect number of arguments.") + +package = str(args[0]).lower() +release = str(args[1]).lower() +op = str(args[2]).lower() + +# Check our operation. +if op not in ("rescore", "retry", "status"): + print >> sys.stderr, "Invalid operation: %s." % op + sys.exit(1) + +# If the user has specified an architecture to build, we only wish to rebuild it +# and nothing else. +if op not in ("retry", 'rescore') and options.architecture: + print >> sys.stderr, "Operation %s does not use the --arch option." % op + sys.exit(1) +elif op in ("retry", "rescore") and options.architecture: + if options.architecture not in ("amd64", "hppa", "i386", "ia64", "lpia", + "powerpc", "sparc"): + print >> sys.stderr, "Invalid architecture specified: %s." % options.architecture + sys.exit(1) + else: + oneArch = True +else: + oneArch = False + +# Clear https_proxy env var as it's not supported in urllib/urllib2; see +# LP #122551 +if os.environ.has_key('https_proxy'): + print >> sys.stderr, "Ignoring https_proxy (no support in urllib/urllib2; see LP #122551)" + del os.environ['https_proxy'] + +# Prepare Launchpad cookie. +launchpadCookie = common.prepareLaunchpadCookie() +urlopener = common.setupLaunchpadUrlOpener(launchpadCookie) + +# Find out the version in given release. +try: + page = urlopener.open('https://launchpad.net/ubuntu/+source/' + package).read() +except urllib2.HTTPError: + print >> sys.stderr, "The source package (%s) does not appear to exist " \ + "in Ubuntu." % package + sys.exit(1) + +m = re.search('"/ubuntu/%s/\+source/%s/(\d[^"]+)"' % (release, + package.replace('+', '\+')), page) +if not m: + print >> sys.stderr, "Unable to find this source package (%s) in this " \ + "release (%s)." % (package, release.capitalize()) + sys.exit(1) + +version = m.group(1) + +# Output details. +print "The source version for '%s' in %s is at %s." % (package, + release.capitalize(), version) + +# Parse out build URLs, states, and arches. +buildstats = {} +page = urlopener.open('https://launchpad.net/ubuntu/+source/%s/%s' % (package, version)) +url = page.geturl() +page = page.read() + +print "Current build status for this package is as follows:" + +for m in re.finditer('"/ubuntu/\+source/%s/%s(/\+build/\d+)"[^\n]+\n\s*(\w+).*?(\w+).*?\s*([^\n]+)\n' % + (package.replace('+', '\+'), version.replace('+', '\+')), page, re.S): + if m.group(2) == release: + print '%s: %s.' % (m.group(3), m.group(4)) + buildstats[url + m.group(1)] = [m.group(3).strip(), m.group(4).strip()] + +# Operations. +if op == 'status': + sys.exit(0) + +for build, (arch, status) in buildstats.iteritems(): + if oneArch and not options.architecture == arch: + # Skip this architecture. + continue + + if op in ('rescore'): + if status in ('Needs building'): + print 'Rescoring', build, '(%s).' % arch + + try: + urlopener.open(build + '/+rescore', urlencode( + {'SCORE': '5000', 'RESCORE': '1'})) + except: + print >> sys.stderr, "Unable to request rescore on %s." % arch + else: + print "Not rescoring on %s; status is: %s." % (arch, status.lower()) + + if op in ('retry'): # Retry requested. + if status in ('Failed to build', 'Chroot problem', 'Failed to upload'): + print 'Retrying:', build, '(%s).' % arch + + try: + urlopener.open(build + '/+retry', urlencode( + {'RETRY': '1'})) + except: # Error encountered while submitting request. + print >> sys.stderr, "Unable to request retry on %s." % arch + else: # The package does not require rebuilding. + print "Not retrying on %s; status is %s." % (arch, status.lower()) diff --git a/check-symbols b/check-symbols index 800764a..1adf2cc 100755 --- a/check-symbols +++ b/check-symbols @@ -1,7 +1,22 @@ #!/bin/bash -# Copyright 2006-2007 (C) Daniel Holbach +# +# Copyright (C) 2006-2007 Daniel Holbach # Modified by Siegfried-A. Gevatter -# License: GPLv2 +# +# ################################################################## +# +# 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; version 2. +# +# 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. +# +# See file /usr/share/common-licenses/GPL-2 for more details. +# +# ################################################################## # # This script is used to get a diff of the exported symbols of all .so files in # every binary package of package $1. diff --git a/common.py b/common.py new file mode 100644 index 0000000..3c9cbfa --- /dev/null +++ b/common.py @@ -0,0 +1,147 @@ +# +# common.py - provides functions which are commonly used by the +# ubuntu-dev-tools package. +# +# Copyright (C) 2008 Jonathan Patrick Davies +# Copyright (C) 2008 Siegfried-Angel Gevatter Pujals +# +# Some of the functions are based upon code written by Martin Pitt +# and Kees Cook . +# +# ################################################################## +# +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## + +import cookielib +import glob +import os.path +import sys +import urllib2 + +def mkdir(directory): + """ Create the given directory and all its parents recursively, but don't + raise an exception if it already exists. """ + + path = [x for x in directory.split('/') if x] + + for i in xrange(len(path)): + current_path = '/' + '/'.join(path[:i+1]) + if not os.path.isdir(current_path): + os.mkdir(current_path) + +def readlist(filename, uniq=True): + """ Read a list of words from the indicated file. """ + + if not os.path.isfile(filename): + print 'File "%s" does not exist.' % filename + return False + + content = open(filename).read().replace('\n', ' ').replace(',', ' ') + + if not content.strip(): + print 'File "%s" is empty.' % filename + return False + + items = [item for item in content.split() if item] + + if uniq: + items = list(set(items)) + + return items + +def prepareLaunchpadCookie(): + """ Search for a cookie file in the places as defined by try_globs. + We shall use this cookie for authentication with Launchpad. """ + + # We do not have our cookie. + launchpad_cookiefile = None + # Look in common locations. + try_globs = ('~/.lpcookie.txt', '~/.mozilla/*/*/cookies.sqlite', + '~/.mozilla/*/*/cookies.txt') + + cookie_file_list = [] + if launchpad_cookiefile == None: + for try_glob in try_globs: + try: + cookie_file_list += glob.glob(os.path.expanduser(try_glob)) + except: + pass + + for cookie_file in cookie_file_list: + launchpad_cookiefile = _check_for_launchpad_cookie(cookie_file) + if launchpad_cookiefile != None: + break + + # Unable to find an correct file. + if launchpad_cookiefile == None: + print >> sys.stderr, "Could not find cookie file for Launchpad. " + print >> sys.stderr, "Looked in: %s" % ", ".join(try_globs) + print >> sys.stderr, "You should be able to create a valid file by " \ + "logging into Launchpad with Firefox." + sys.exit(1) + + return launchpad_cookiefile + +def _check_for_launchpad_cookie(cookie_file): + # Found SQLite file? Parse information from it. + if cookie_file.find('cookies.sqlite') != -1: + import sqlite3 as sqlite + + con = sqlite.connect(cookie_file) + + cur = con.cursor() + cur.execute("select host, path, isSecure, expiry, name, value from moz_cookies where host like ?", ['%%launchpad%%']) + + # No matching cookies? Abort. + items = cur.fetchall() + if len(items) == 0: + return None + + ftstr = ["FALSE", "TRUE"] + + # This shall be where our new cookie file lives - at ~/.lpcookie.txt + newLPCookieLocation = os.path.expanduser("~/.lpcookie.txt") + + # Open file for writing. + newLPCookie = open(newLPCookieLocation, 'w') + # For security reasons, change file mode to write and read + # only by owner. + os.chmod(newLPCookieLocation, 0600) + newLPCookie.write("# HTTP Cookie File.\n") # Header. + + for item in items: + # Write entries. + newLPCookie.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % ( + item[0], ftstr[item[0].startswith('.')], item[1], + ftstr[item[2]], item[3], item[4], item[5])) + + newLPCookie.write("\n") # New line. + newLPCookie.close() # And close file. + + return newLPCookieLocation + else: + if open(cookie_file).read().find('launchpad.net') != -1: + return cookie_file + + return None + +def setupLaunchpadUrlOpener(cookie): + """ Build HTML opener with cookie file. """ + cj = cookielib.MozillaCookieJar() + cj.load(cookie) + urlopener = urllib2.build_opener() + urlopener.add_handler(urllib2.HTTPCookieProcessor(cj)) + + return urlopener diff --git a/dch-repeat b/dch-repeat index ba831f0..47e870c 100755 --- a/dch-repeat +++ b/dch-repeat @@ -1,7 +1,23 @@ #!/usr/bin/perl -# Copyright 2007-2008 (C) Canonical, Ltd +# +# Copyright (C) 2007-2008 Canonical, Ltd. # Author: Kees Cook -# License: GPLv2 +# +# ################################################################## +# +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## # # This script is used to repeat a change log into an older release. It # expects that --build-tree is laid out with each Ubuntu release as a diff --git a/debian/changelog b/debian/changelog index f1bce31..4433ae8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,143 @@ +ubuntu-dev-tools (0.41) intrepid; urgency=low + + [ Loic Minier ] + * Replace .BB in doc/pbuilder-dist.1 with a newline to fix a syntax error. + * Drop spurious tab in buildd. + * When https_proxy is in the environment, output a warning and disable it as + urllib/urllib2 don't support it; see LP #122551. + + [ Kees Cook ] + * common.py: allow for multiple firefox instances, check all possible + cookie files. + + -- Kees Cook Wed, 20 Aug 2008 10:58:24 -0700 + +ubuntu-dev-tools (0.40ubuntu3) intrepid; urgency=low + + * Import urllib2. + + -- Loic Minier Mon, 18 Aug 2008 12:07:27 +0200 + +ubuntu-dev-tools (0.40ubuntu2) intrepid; urgency=low + + * requestsync: Correct print statement redirect to sys,stderr. + + -- Jonathan Patrick Davies Mon, 18 Aug 2008 10:59:59 +0100 + +ubuntu-dev-tools (0.40ubuntu1) intrepid; urgency=low + + * Bazaar revision 174. + * buildd: Code cleanup on single arch options. + * doc/buildd.1: Created. + * doc/requestsync.1: Added note about sponsorship detecting. + * requestsync: Suggest using the --lp flag when mailing a request encounters + a failure. + + -- Jonathan Patrick Davies Sat, 16 Aug 2008 23:38:41 +0100 + +ubuntu-dev-tools (0.39ubuntu1) intrepid; urgency=low + + * Bazaar revision 169. + + [ Jonathan Patrick Davies ] + * common.py: Use os.path.expanduser() instead of os.environ. + * buildd: + - Added optparse support for option handling. + - Added support to request the rebuilding or rescoring of only one + architecture. + - Various other improvements. + * hugdaylist: Improved number of bugs option handling. + * get-branches: Improved option handling. + + [ Siegfried-Angel Gevatter Pujals ] + * debian/control: + - Add sbuild as an alternative recommends to pbuilder. + * what-patch, pull-debian-debdiff, mk-sbuild-lv, dch-repat, debian/copyright: + - Change the license of all scripts from Kees Cook to the GPL version 3 + or later. + - Order the script names alphabetically in debian/copyright. + * common.py: + - Add functions mkdir and readlist. + + [ Iain Lane ] + * pull-lp-source: Better handle errors when going to LP + + -- Jonathan Patrick Davies Thu, 14 Aug 2008 12:21:45 +0100 + +ubuntu-dev-tools (0.38ubuntu1) intrepid; urgency=low + + [ Jonathan Patrick Davies ] + * requestsync: Check if user is a member of ubuntu-core-dev if sync request + is for a package in main. + * common.py: Change cookie file permissions to read and write only by user. + + -- Jonathan Patrick Davies Tue, 12 Aug 2008 14:52:34 +0100 + +ubuntu-dev-tools (0.37ubuntu1) intrepid; urgency=low + + [ Jonathan Patrick Davies ] + * get-branches: + - Open the teams code page before making a new directory. + - Now check team option before anything else. + - Check that the team has branches before downloading. + * doc/get-branches.1: Created. + * hugdaylist: Improved argument and error handling. + * pull-lp-source: + - Use optparse for option handling. + - Check that the 'release' and 'package' actually exist on Launchpad. + - Use subprocess for dget calls. + * buildd: Imported from Martin Pitt's scripts. + * common.py: Python module to be used to enable the use of cookies + to authenticate with Launchpad. + * debian/ubuntu-dev-tools.install: Added line to install common.py above to + the correct location. + * requestsync: + - Use the functions in the common.py file above to authenticate with + Launchpad. + - Using the Launchpad cookie file, validate that the user is a member of + the ubuntu-dev team on Launchpad. Thus, checking if the user needs + sponsership or not (LP: #130648). + * doc/requestsync.1: Removed mention of -s flag. Obsoleted by the above. + * massfile: + - Use the functions in the common.py file above to authenticate with + Launchpad. + * debian/control: Changed XS-Python-Version to >= 2.5. + + [ Siegfried-Angel Gevatter Pujals ] + * Add the GNU General Public License header to all scripts. + * Remove files AUTHORS (it duplicated content from debian/copyright) and + README (superseded by the manpages). + + -- Jonathan Patrick Davies Tue, 12 Aug 2008 14:48:35 +0100 + +ubuntu-dev-tools (0.36ubuntu1) intrepid; urgency=low + + [ Jonathan Patrick Davies ] + * doc/ Created new manpages for: + - what-patch.1. + - dch-repeat.1. + - grab-attachment.1. + * doc/requestsync.1: Described variables used by requestsync in man + page. (LP: #237595) + * hugdaylist: + - Added code to handle exceptions and short version of GPL. + - Rewrote option handling with optparse. + - Filter bugs subscribed to the ubuntu-archive team. + * get-branches: + - Rewrote option handling with optparse. + - Added short version of GPL to header. + - Fixed regular expressions to work with new Launchpad interface. + - Use subprocess.call() on Bazaar instead of os.system(). + * debian/copyright: Updated Authors and copyrights. + + [ Siegfried-Angel Gevatter Pujals ] + * Change the versioning scheme from 0.XX to 0.XXubuntu1. Delete + debian/source.lintian-overrides, as with this it isn't necessary anymore. + * General manpage cleanup (fix typos, use the same section names in all + manpages, etc). + + -- Jonathan Patrick Davies Sun, 10 Aug 2008 22:02:05 +0100 + ubuntu-dev-tools (0.35) intrepid; urgency=low [ Siegfried-Angel Gevatter Pujals ] @@ -8,6 +148,12 @@ ubuntu-dev-tools (0.35) intrepid; urgency=low 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. @@ -18,7 +164,7 @@ ubuntu-dev-tools (0.35) intrepid; urgency=low - Modify it to work with Firefox 3 cookies, taking code from requestsync. - Set the status to Confirmed, by default. - -- Iain Lane Mon, 04 Aug 2008 18:29:46 +0100 + -- Siegfried-Angel Gevatter Pujals Sat, 09 Aug 2008 13:58:23 +0200 ubuntu-dev-tools (0.34) intrepid; urgency=low diff --git a/debian/control b/debian/control index e770beb..bd300e0 100644 --- a/debian/control +++ b/debian/control @@ -6,15 +6,15 @@ Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/trunk Vcs-Browser: http://codebrowse.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/trunk/changes Build-Depends: cdbs (>= 0.4.49), debhelper (>= 5), python-all-dev (>= 2.4) Build-Depends-Indep: python-central (>= 0.5) -XS-Python-Version: all +XS-Python-Version: >= 2.5 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, diffstat, dpkg-dev -Recommends: bzr, pbuilder, reportbug (>= 3.39ubuntu1) +Recommends: bzr, pbuilder | sbuild, reportbug (>= 3.39ubuntu1) Conflicts: devscripts (<< 2.10.7ubuntu5) Replaces: devscripts (<< 2.10.7ubuntu5) XB-Python-Version: ${python:Versions} diff --git a/debian/copyright b/debian/copyright index 46a43c3..252b5fc 100644 --- a/debian/copyright +++ b/debian/copyright @@ -7,18 +7,19 @@ Upstream Authors: Albin Tonnerre Daniel Hahler Daniel Holbach + Iain Lane Jamin W. Collins + Jonathan Patrick Davies Jordan Mantha + Kees Cook Luke Yelavich Martin Pitt Michael Bienia Pete Savage - Kees Cook Siegfried-A. Gevatter Soren Hansen Steve Kowalik Terence Simpson - Iain Lane Copyright: @@ -34,12 +35,13 @@ Copyright: (C) 2007-2008, Siegfried-A. Gevatter (C) 2007, Terence Simpson (C) 2008, Iain Lane + (C) 2008, Jonathan Patrick Davies Licenses: -404main, check-symbols, dch-repeat, dgetlp, mk-sbuild-lv, pbuilder-dist, -requestsync, reverse-build-depends, submittodebian, update-maintainer -and what-patch are licensed under GPLv2: +404main, check-symbols, dgetlp, pbuilder-dist, requestsync, +reverse-build-depends, submittodebian and update-maintainer are licensed +under the GNU General Public License, version 2: 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 @@ -53,8 +55,9 @@ and what-patch are licensed under GPLv2: 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, debian-pull-debdiff, massfile, ppaput, -suspicious-source and pull-lp-source are licensed under GPLv3: +dch-repeat, get-branches, get-build-deps, massfile, mk-sbuild-lv, ppaput, +pull-debian-debdiff, pull-lp-source, suspicious-source and what-patch are +licensed under the GNU General Public License, version 3: 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 @@ -69,6 +72,6 @@ On Debian systems, the complete text of the GNU General Public License v3 can be found in `/usr/share/common-licenses/GPL-3'. 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, pull-lp-source and -get-build-deps. +later version of the previously specified license: 404main, dch-repeat, dgetlp, +get-build-deps, mk-sbuild-lv, pull-debian-debdiff, pull-lp-source, +reverse-build-depends, suspicious-source, what-patch. diff --git a/debian/rules b/debian/rules index 6a071b0..c10c010 100755 --- a/debian/rules +++ b/debian/rules @@ -6,6 +6,3 @@ include /usr/share/cdbs/1/rules/debhelper.mk 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 --git a/debian/source.lintian-overrides b/debian/source.lintian-overrides deleted file mode 100644 index 17ccc05..0000000 --- a/debian/source.lintian-overrides +++ /dev/null @@ -1,3 +0,0 @@ -# Override useless NMU warnings; this is a native Ubuntu package. -ubuntu-dev-tools source: changelog-should-mention-nmu -ubuntu-dev-tools source: source-nmu-has-incorrect-version-number diff --git a/debian/ubuntu-dev-tools.install b/debian/ubuntu-dev-tools.install index 40fadd6..5b36808 100644 --- a/debian/ubuntu-dev-tools.install +++ b/debian/ubuntu-dev-tools.install @@ -1 +1,2 @@ bash_completion/* etc/bash_completion.d/ +common.py usr/share/ubuntu-dev-tools/ diff --git a/dgetlp b/dgetlp index 38b5502..9df4289 100755 --- a/dgetlp +++ b/dgetlp @@ -1,20 +1,22 @@ #!/bin/bash # Copyright (C) 2008 Terence Simpson # Modified by Siegfried-A. Gevatter -# License: -# 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 2 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. +# 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 2 +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## # # This script simulates «dget»'s behaviour for files hosted at # launchpadlibrarian.net. diff --git a/doc/buildd.1 b/doc/buildd.1 new file mode 100644 index 0000000..e79c814 --- /dev/null +++ b/doc/buildd.1 @@ -0,0 +1,54 @@ +.TH BUILDD "1" "14 August 2008" "ubuntu-dev-tools" +.SH NAME +buildd \- command-line interface to Launchpad build operations + +.SH SYNOPSIS + +.B buildd + +.B buildd \-\-help + +.SH DESCRIPTION +.PP +\fBbuildd\fR provides a command line interface to the Launchpad build +operations. + +.PP +\fBbuildd\fR uses a cookie file stored at \fI~/.lpcookie.txt\fR to authenticate +to Launchpad. This cookie is created on run from the Mozilla Firefox cookie +file at \fI~/.mozilla/*/*/cookies.sqlite\fR. + +.SH OPERATIONS +.PP +Listed below are the available operations for \fBbuildd\fR: +.TP +.B status +Outputs the build status of the package on Launchpad on all architectures. +.TP +.B retry +Requests that the package has another attempt at rebuilding from source. This +shall only work if the package has \fIFailed to build\fR on Launchpad. +.TP +.B rescore +Requests that the packages build priority be raised in the build queue. Only +members of the Launchpad build administrators may issue this operation and may +only be performed on packages which \fINeed building\fR. + +.SH OPTIONS +.PP +Listed below are the command line options for \fBbuildd\fR: +.TP +.B \-h or \-\-help +Display a help message and exit. +.TP +.B \-a or \-\-architecture +Only available for \fIrescore\fR and \fIretry\fR operations only. This shall +only request the rebuilding/rescoring on the specified architecture only. + +.SH AUTHORS +.PP +\fBbuildd\fR was written by Martin Pitt , and +this manual page was written by Jonathan Patrick Davies . +.PP +Both are released under the terms of the GNU General Public License, version 3 +or (at your option) any later version. diff --git a/doc/dch-repeat.1 b/doc/dch-repeat.1 new file mode 100644 index 0000000..8506b8b --- /dev/null +++ b/doc/dch-repeat.1 @@ -0,0 +1,61 @@ +.TH DCH-REPEAT "1" "10 August 2008" "ubuntu-dev-tools" +.SH NAME +dch-repeat \- repeats a changelog entry into an older release + +.SH SYNOPSIS + +.B dch-repeat \-\-build-tree <\fIPATH\fR> + +.B dch-repeat \-\-source-release <\fIRELEASE\fR> + +.B dch-repeat \-\-target-release <\fIRELEASE\fR> + +.B dch-repeat \-\-devel-release <\fIRELEASE\fR> + +.B dch-repeat \-\-pocket <\fIPOCKET\fR> + +.B dch-repeat \-h + +.SH DESCRIPTION +.PP +\fBdch-repeat\fR is used to repeat a changelog into an older release. It +expects that \-\-build-tree is laid out with each Ubuntu release as a separate +directory ("feisty", "edgy", etc). + +.PP +For example, if gimp had a security update prepared for Feisty in +$TREE/feisty/gimp-2.2.13, running \fBdch-repeat\fR in $TREE/edgy/gimp-2.2.13 +would pull in the latest changelog from the Feisty build. + +.SH OPTIONS +.PP +Listed below are the command line options for \fBdch-repeat\fR: +.TP +.B \-h or \-\-help +Display a help message and exit. +.TP +.B \-\-build-tree PATH +Base of build trees. Default is /scratch/ubuntu/build. +.TP +.B \-s or \-\-source-release RELEASE +Which release to take changelog from. +.TP +.B \-\-target-release RELEASE +Which release to build into. +.TP +.B \-\-devel-release RELEASE +Which release is the development release. +.TP +.B \-\-pocket POCKET +Which pocket to use. + +.SH AUTHOR +.PP +\fBdch-repeat\fR was written by Kees Cook . This manual page +was written by Jonathan Patrick Davies . +.PP +Both are released under the GNU General Public License, version 2. + +.SH SEE ALSO +.PP +.BR dch(1). diff --git a/doc/get-branches.1 b/doc/get-branches.1 new file mode 100644 index 0000000..d0f29be --- /dev/null +++ b/doc/get-branches.1 @@ -0,0 +1,45 @@ +.TH GET-BRANCHES "1" "11 August 2008" "ubuntu-dev-tools" +.SH NAME +get-branches \- downloads all branches related to a Launchpad team or person + +.SH SYNOPSIS + +.B get-branches [-d directory] [-o branch|checkout] \-t + +.B get-branches + +.B get-branches \-\-help + +.SH DESCRIPTION +.PP +\fBget-branches\fR examines the code page of a Launchpad team/person, parses it, +and calls Bazaar to download all branches on that page. + +.SH OPTIONS +.PP +Listed below are the command line options for \fBget-branches\fR: +.TP +.B \-h or \-\-help +Display a help message and exit. +.TP +.B \-d or \-\-directory +Download branches to a directory other than the current directory. +.TP +.B \-o or \-\-operation +Specifies which Bazaar operation to use when downloading the branches; may be +either \fIbranch\fR or \fIcheckout\fR. +.TP +.B \-t or \-\-team +Specifies which Launchpad team/person to download branches from. This option is +required. + +.SH AUTHORS +.PP +\fBget-branches\fR was written by Daniel Holbach , and +this manual page was written by Jonathan Patrick Davies . +.PP +Both are released under the terms of the GNU General Public License, version 3. + +.SH SEE ALSO +.PP +.B bzr(1) diff --git a/doc/get-build-deps.1 b/doc/get-build-deps.1 index 2077f8b..a15b49d 100644 --- a/doc/get-build-deps.1 +++ b/doc/get-build-deps.1 @@ -55,5 +55,5 @@ the newest one available in the repositories. .SH AUTHORS \fBget\-build\-deps\fP and this manual page have been written by Siegfried-Angel -Gevatter Pujals . They are released under the GNU General Public -License, version 3 or later. +Gevatter Pujals . They are released under the GNU General +Public License, version 3 or later. diff --git a/doc/grab-attachments.1 b/doc/grab-attachments.1 new file mode 100644 index 0000000..2fff303 --- /dev/null +++ b/doc/grab-attachments.1 @@ -0,0 +1,29 @@ +.TH GRAB-ATTACHMENTS "1" "10 August 2008" "ubuntu-dev-tools" +.SH NAME +grab-attachments \- downloads attachments from a Launchpad bug +.SH SYNOPSIS +.B grab-attachments\fR <\fIbug-number\fR> + +.B grab-attachments \-h +.SH DESCRIPTION +.PP +\fBgrab-attachments\fR is a script to download all attachments from a +Launchpad bug report into the current directory. + +.SH OPTIONS +.PP +Listed below are the command line options for grab-attachments: +.TP +.B \-h +Display a help message and exit. +.TP +.B +Specifies the Launchpad bug number that the script should download +attachments from. + +.SH AUTHOR +.PP +\fBgrab-attachments\fR was written by Daniel Holbach and this manual page was +written by Jonathan Patrick Davies. +.PP +Both are released under the GNU General Public License, version 2. diff --git a/doc/pbuilder-dist.1 b/doc/pbuilder-dist.1 index 1cbd1a6..db993f3 100644 --- a/doc/pbuilder-dist.1 +++ b/doc/pbuilder-dist.1 @@ -91,22 +91,14 @@ rainct@ubuntu.com. Please ensure first that the problem is really this script and not an issue with \fBpbuilder\fP. -.SH AUTHORS -\fBpbuilder\-dist\fP was originally written by Jamin W. Collins and -Jordan Mantha . -.PP -On August 2007 it was mostly rewritten, and extended, by Siegfried-Angel Gevatter Pujals -. - .SH SEE ALSO \fBpbuilder\fR, \fBpbuilderrc\fR -.SH COPYRIGHT -This manual page was written by Siegfried-Angel Gevatter Pujals (RainCT) - for YOU. -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU General Public License, -Version 2 or any later version published by the Free Software Foundation. -.PP -On Debian based systems, the complete text of the GNU General Public -License can be found in \fB/usr/share/common\-licenses/GPL\fP. +.SH AUTHORS +\fBpbuilder\-dist\fP was originally written by Jamin W. Collins + and Jordan Mantha . On August +2007 it was mostly rewritten, and extended, by Siegfried-Angel Gevatter Pujals +. + +\fBpbuilder\-dist\fP is released under the GNU General Public License, version +2 or later. diff --git a/doc/requestsync.1 b/doc/requestsync.1 index 30ffd9e..013f687 100644 --- a/doc/requestsync.1 +++ b/doc/requestsync.1 @@ -18,6 +18,20 @@ follows so that it can sign the mail and send it off to Launchpad. Alternatively a sync request can be filed directly using the launchpadbugs python module (option \fB\-\-lp\fR). \fBrequestsync\fR falls back to mail the sync request if submitting using the launchpadbugs module fails. + +.PP +\fBrequestsync\fR checks if you have the permissions to request the sync from +the archive administrators directly by checking if you are a member of the +\fI~ubuntu-dev\fR team (for universe/multiverse syncs) or a member of the +\fI~ubuntu-core-dev\fR team (for main/restricted syncs) on Launchpad. If you are +not a member of the appropriate team, the script shall subscribe the necessary +team with approval rights to the bug report for you. + +.PP +\fBrequestsync\fR uses a cookie file stored at \fI~/.lpcookie.txt\fR to +authenticate with Launchpad. This cookie is created on run from the Mozilla +Firefox cookie file at \fI~/.mozilla/*/*/cookies.sqlite\fR. + .SH OPTIONS .PP Listed below are the command line options for requestsync: @@ -29,15 +43,10 @@ Display a help message and exit. Specifies that the package is a new package, and requestsync should not attempt to look it up in Ubuntu since it will not exist. .TP -.B \-s -Specifies that you require sponsorship. -You need this option if you are not a member of ubuntu-dev for universe or -multiverse, or ubuntu-core-dev for main or restricted. -.TP .B \-k \fI\fR Specifies your GPG key. -Can also be set with the line `\fIexport GPGKEY=\fR' in -.IR $HOME/.bashrc . +Can also be set with the line `\fIexport GPGKEY=\fR' in your shell's +configuration (For example: \fI$HOME/.bashrc\fR). This is only used if the sync request is mailed to Launchpad. .TP .B \-\-lp @@ -50,18 +59,43 @@ This is the source package that you would like to be synced from Debian. .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 from the Debian package) cannot be automatically determined. Specify this option in this case. -.SH AUTHOR -.PP -This manual page was pieced together by Steve Kowalik. -It was then updated by Ryan Kavanagh and Michael Bienia to reflect -additional features. +.SH ENVIRONMENT VARIABLES +.PP +\fBrequestsync\fR uses the following variables which should be set in your +shell's configuration by adding \fIexport VARIABLE=\fR lines, where VARIABLE is +one of the following: + +.TP +.B GPGKEY +Specifies your GnuPG key ID. +.TP +.B DEBEMAIL +Specifies which email should be used when sending to Launchpad. +.TP +.B DEBSMTP +Set which SMTP server to use when sending mail. If unspecified this defaults to +fioldland.ubuntu.com. +.TP +.B DEBSMTP_PORT +Sets which port of the SMTP server to use. Default is 25. +.TP +.B DEBSMTP_USER and DEBSMTP_PASS +Sets the username and password to use when authenticating to the SMTP server. + .SH SEE ALSO .PP .BR rmadison (1) + +.SH AUTHOR +.PP +.B requestsync +and this manual page were written by the Ubuntu MOTU Team. +.PP +Both are released under the GNU General Public License, version 2. diff --git a/doc/reverse-build-depends.1 b/doc/reverse-build-depends.1 index cd097ed..4c7401b 100644 --- a/doc/reverse-build-depends.1 +++ b/doc/reverse-build-depends.1 @@ -1,7 +1,3 @@ -.\" Title: reverse-build-depends -.\" Author: Siegfried-Angel Gevatter Pujals -.\" Contact details: rainct@ubuntu.com - .TH REVERSE\-BUILD\-DEPENDS 1 "January 17, 2008" "ubuntu-dev-tools" .SH NAME @@ -26,13 +22,13 @@ If you prefer to see all build dependencies in a single line, use this option. Otherwise, each one will be printed on its own line. .SH KNOWN BUGS AND LIMITATIONS -Note that to use \fBreverse\-build\-depends\fP it is required for the source repositories -(deb-src lines) to be enabled in your sources.list. +Note that to use \fBreverse\-build\-depends\fP it is required for the source +repositories (deb-src lines) to be enabled in your sources.list. .SH SEE ALSO \fBgrep\-dctrl\fR, \fBapt\-cache\fR -.SH COPYRIGHT +.SH AUTHORS \fBreverse\-build\-depends\fP and this manual page were written by Siegfried-Angel Gevatter Pujals for YOU. Both are released under the terms of the GNU General Public License (version 2 diff --git a/doc/submittodebian.1 b/doc/submittodebian.1 index f697870..dd4fd9a 100644 --- a/doc/submittodebian.1 +++ b/doc/submittodebian.1 @@ -26,3 +26,5 @@ By examining debian/changelog it will extract the information it needs to: .br .SH AUTHOR submittodebian and this man page were written by Soren Hansen . +.PP +Both are released under the GNU General Public License, version 2 or later. diff --git a/doc/what-patch.1 b/doc/what-patch.1 new file mode 100644 index 0000000..b160fed --- /dev/null +++ b/doc/what-patch.1 @@ -0,0 +1,44 @@ +.TH WHAT-PATCH "1" "10 August 2008" "ubuntu-dev-tools" +.SH NAME +what-patch \- detects which patch system a Debian package uses + +.SH SYNOPSIS + +.B what-patch [options] + +.SH DESCRIPTION +.PP +\fBwhat-patch\fR examines the debian/rules file to determine which patch +system the Debian package is using. + +.PP +\fBwhat-patch\fR should be run from the root directory of the Debian source +package. + +.SH OPTIONS +.PP +Listed below are the command line options for what-patch: +.TP +.B \-h or \-\-help +Display a help message and exit. +.TP +.B \-v +Enable verbose mode. This shall include the listing of any files modified +outside or the debian/ directory and report any additional details about the +patch system if available. + +.SH AUTHORS +.PP +\fBwhat-patch\fR was written by Kees Cook , Siegfried-A. +Gevatter , and Daniel Hahler , among +others. This manual page was written by Jonathan Patrick Davies . +.PP +Both are released under the GNU General Public License, version 2. + +.SH SEE ALSO +.PP +The Ubuntu MOTU team has some documentation about patch systems at the Ubuntu +wiki: \fBhttps://wiki.ubuntu.com/PackagingGuide/PatchSystems\fR + +.PP +.B cdbs-edit-patch(1), dbs-edit-patch(1), dpatch-edit-patch(1) diff --git a/get-branches b/get-branches index 58ec3c5..06204c0 100755 --- a/get-branches +++ b/get-branches @@ -1,70 +1,141 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright 2007 (C) Canonical Ltd. +# +# Copyright (C) 2007 Canonical Ltd. # Created by Daniel Holbach -# License: GPLv3 +# Modified by Jonathan Patrick Davies +# +# ################################################################## +# +# 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; version 3. +# +# 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. +# +# See file /usr/share/common-licenses/GPL-3 for more details. +# +# ################################################################## # # This script is used to checkout or branch all the Bazaar branches -# in a Launchpad team. +# of a Launchpad team. +# -import urllib2 -import sys -import re import os +import re +import subprocess +import sys +import urllib2 +from optparse import OptionParser def main(): - usage = "Usage: get-branches [checkout|branch]" - if len(sys.argv) < 3: - print >> sys.stderr, usage - sys.exit(1) - - directory = os.path.abspath(sys.argv[1])) - team = sys.argv[2] - operation_type = "branch" - if len(sys.argv) == 4: - operation_type = sys.argv[3] + usage = "Usage: %prog [-d ] -t [-o ]" + usage += "\nUsage: %prog " + optParser = OptionParser(usage) + # Our options. + optParser.add_option("-d", "--directory", action = "store", type = "string", + dest = "directory", default = ".", + help = "Directory to download branches to.") + optParser.add_option("-t", "--team", action = "store", type = "string", + dest = "lpteam", help = "Launchpad team to download branches from.") + optParser.add_option("-o", "--operation", action = "store", type = "string", + dest = "operation", default = "branch", + help = "Whether to branch or checkout the Bazaar branches. May be " \ + "either 'branch' or 'checkout'.") + + (options, args) = optParser.parse_args() + + # Parse our options aka Russian roulette time. + if len(args) != 1 and options.lpteam == None: + optParser.error("No team has been specified.") + + # Launchpad team setting. + if options.lpteam: + team = str(options.lpteam).lower() + if args: + team = str(args[0]).lower() + + directory = options.directory + + # Dictionary settings. + if not os.path.isdir(directory): # Check that it is a directory. + optParser.error("%s is not a valid directory." % directory) + + # Type of Bazaar operation to perform. + operation_type = str(options.operation).lower() + + # Got an argument, check if it is valid. + if operation_type not in ("branch", "checkout"): + optParser.error("Invalid operation '%s' for '-o' flag." % \ + operation_type) + + + # Fetch our current directory to return to later. pwd = os.getcwd() + + # Change to the specified directory. + os.chdir(directory) + + # Try to open the teams code page. try: - os.chdir(directory) - except: - print >> sys.stderr, "Directory '%s' not found." % directory + sock = urllib2.urlopen("https://code.launchpad.net/~%s" % team) + except urllib2.HTTPError: + print >> sys.stderr, "The page https://code.launchpad.net/~%s does " \ + "not exist." % team + print >> sys.stderr, "Perhaps invalid team name?" sys.exit(1) + branch_list_page = sock.read() + sock.close() + + branch_page_urls_regex = r'.*Hosted on Launchpad:.*\n.*(.*)' + sock = urllib2.urlopen("https://code.launchpad.net/%s" % url) + branch_page = sock.read() + sock.close() + + branch_url_regex = r'bzr branch lp:~(.*)' branch_url = re.findall(branch_url_regex, branch_page) - print branch_url[0] + print "Downloading branch: lp:~%s." % branch_url[0] + if branch_url[0]: product = branch_url[0].split("/")[-2] branch_nick = branch_url[0].split("/")[-1] - if not os.path.exists(product): - os.makedirs(product) - os.chdir(product) - if not os.path.exists(branch_nick): - os.system("bzr %s %s" % (operation_type, branch_url[0])) - else: - os.chdir(branch_nick) - os.system("bzr merge --pull --remember") - os.chdir(os.path.join(directory, team)) + + if not os.path.exists(product): + os.makedirs(product) + os.chdir(product) + + if not os.path.exists(branch_nick): + subprocess.call(["bzr", operation_type, "lp:~%s" % branch_url[0]]) + else: + os.chdir(branch_nick) + subprocess.call(["bzr", "merge", "--pull", "--remember"]) + os.chdir(os.path.join(directory, team)) os.chdir(pwd) sys.exit(0) - if __name__ == "__main__": main() diff --git a/get-build-deps b/get-build-deps index 3f2c6f7..50dd938 100755 --- a/get-build-deps +++ b/get-build-deps @@ -1,6 +1,22 @@ #!/bin/bash +# # Copyright 2007 (C) Siegfried-A. Gevatter -# License: GPLv3 or later +# +# ################################################################## +# +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## # # If you don't pass it any argument, this script will check if # there's a control (debian/control) file somewhere in the current diff --git a/grab-attachments b/grab-attachments index dbda6f2..109a119 100755 --- a/grab-attachments +++ b/grab-attachments @@ -1,9 +1,22 @@ #!/usr/bin/python # -# Copyright 2007, Canonical, Daniel Holbach +# Copyright (C) 2007, Canonical Ltd. +# Written by Daniel Holbach # -# GPL 3 +# ################################################################## # +# 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; version 3. +# +# 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. +# +# See file /usr/share/common-licenses/GPL-3 for more details. +# +# ################################################################## import os import sys diff --git a/hugdaylist b/hugdaylist index 555e112..8c9937c 100755 --- a/hugdaylist +++ b/hugdaylist @@ -1,65 +1,99 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# Copyright 2007, Canonical, Daniel Holbach +# Copyright (C) 2007 Canonical Ltd., Daniel Holbach +# Copyright (C) 2008 Jonathan Patrick Davies # -# GPL 3 +# ################################################################## +# +# 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; version 3. +# +# 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. +# +# See file /usr/share/common-licenses/GPL-3 for more details. +# +# ################################################################## +# +# +# hugdaylist - produces MoinMoin wiki formatted tables based on a Launchpad bug +# list. # # hugdaylist # - produces lists like https://wiki.ubuntu.com/UbuntuBugDay/20070912?action=raw # # hugdaylist -n -# - will only list URLs -# +# - will only list URLs. -import re import os -import sys +import re import string +import sys +from optparse import OptionParser try: import launchpadbugs.connector as Connector BugList = Connector.ConnectBugList() Bug = Connector.ConnectBug(method="Text") -except: +except ImportError: print >> sys.stderr, \ - "You need python-launchpad-bugs (>= 0.2.25) installed to use hugdaylist." + "python-launchpad-bugs (>= 0.2.25) needs to be installed to use hugdaylist." sys.exit(1) - -USAGE = "hugdaylist [-n ] " - def check_args(): howmany = -1 url = "" + + # Our usage options. + usage = "usage: %prog [-n ] launchpad-buglist-url" + optParser = OptionParser(usage) + argsParsed = 0 + + # Options - namely just the number of bugs to output. + optParser.add_option("-n", "--number", type = "int", + dest = "number", help = "Number of entries to output.") + + # Parse arguments. + (options, args) = optParser.parse_args() - if len(sys.argv) < 2: - print >> sys.stderr, USAGE + # Check if we want a number other than the default. + howmany = options.number + + # Check that we have an URL. + if not args: + print >> sys.stderr, "An URL pointing to a Launchpad bug list is " \ + "required." + optParser.print_help() sys.exit(1) - - if sys.argv[1] == "-n": - howmany = int(sys.argv[2]) - if len(sys.argv) < 4: - print USAGE - sys.exit(1) - url = sys.argv[3] else: - url = sys.argv[1] - + url = args[argsParsed] + return (howmany, url) def filter_unsolved(b): bug = Bug(int(b)) + # Filter out special types of bugs: + # - https://wiki.ubuntu.com/Bugs/HowToTriage#Special%20types%20of%20bugs return filter(lambda a: a.status != 'Fix Committed' and \ (a.assignee in ['motu','desktop-bugs'] or \ not a.assignee), bug.infotable) and \ 'ubuntu-main-sponsors' not in [str(s) for s in bug.subscribers] and \ - 'ubuntu-universe-sponsors' not in [str(s) for s in bug.subscribers] + 'ubuntu-universe-sponsors' not in [str(s) for s in bug.subscribers] and \ + 'ubuntu-archive' not in [str(s) for s in bug.subscribers] def main(): (howmany, url) = check_args() - - bl = BugList(url) + + try: + bl = BugList(url) + except: + print >> sys.stderr, "The page '%s' does not appear to exist." % url + sys.exit(1) + l = filter(filter_unsolved, bl) if not l: @@ -82,5 +116,8 @@ def main(): if __name__ == '__main__': - main() - + try: + main() + except KeyboardInterrupt: + print >> sys.stderr, "Aborted." + sys.exit(1) diff --git a/massfile b/massfile index ccc6780..54fa27d 100755 --- a/massfile +++ b/massfile @@ -1,10 +1,25 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# (C) Canonical, 2007, GPL v3 +# Copyright (C) 2007 Canonical Ltd. # # Modified by Iain Lane , taking some code written by # Daniel Hahler +# +# ################################################################## +# +# 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; version 3. +# +# 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. +# +# See file /usr/share/common-licenses/GPL-3 for more details. +# +# ################################################################## import os import sys @@ -14,6 +29,10 @@ import glob import launchpadbugs.connector as Connector +sys.path.append('/usr/share/ubuntu-dev-tools/') +import common + +cookie = common.prepareLaunchpadCookie() def read_config(): instructions_file = open("instructions") @@ -40,8 +59,7 @@ def read_list(): def file_bug(): Bug = Connector.ConnectBug() - Bug.authentication = os.path.expanduser("~/.lpcookie") - + Bug.authentication = cookie def check_configfiles(): result = True @@ -70,6 +88,7 @@ def check_configfiles(): def file_bug(config): Bug = Connector.ConnectBug() + Bug.authentication = cookie try: @@ -107,39 +126,11 @@ def read_buglist(url): packages.add(bug.sourcepackage) 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) - 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 --git a/mk-sbuild-lv b/mk-sbuild-lv index 51ad04c..07fd920 100755 --- a/mk-sbuild-lv +++ b/mk-sbuild-lv @@ -1,7 +1,23 @@ #!/bin/bash +# # Copyright 2006-2007 (C) Canonical Ltd. # Created by Kees Cook -# License: GPLv2 +# +# ################################################################## +# +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## # # This script creates LVM snapshot chroots via schroot and sbuild. # Much love to "man sbuild-setup", https://wiki.ubuntu.com/PbuilderHowto, diff --git a/pbuilder-dist b/pbuilder-dist index 47e54da..b3b502a 100755 --- a/pbuilder-dist +++ b/pbuilder-dist @@ -4,7 +4,21 @@ # Copyright (C) Jordan Mantha # Copyright (C) 2007-2008 Siegfried-A. Gevatter # -# License: GPLv2 or later +# ################################################################## +# +# 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 2 +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## # # This script is a wrapper to be able to easily use pbuilder for # different distributions (eg, Gutsy, Hardy, Debian unstable, etc). diff --git a/pbuilder-dist-simple b/pbuilder-dist-simple index 3210226..1a4e385 100755 --- a/pbuilder-dist-simple +++ b/pbuilder-dist-simple @@ -3,7 +3,21 @@ # Copyright (C) Jamin W. Collins # Copyright (C) Jordan Mantha # -# License: GPLv2 or later +# ################################################################## +# +# 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 2 +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## # # This script is a wrapper to be able to easily use pbuilder for # different distributions (eg, Gutsy, Hardy, Debian unstable, etc). diff --git a/pbuilder-dist.new b/pbuilder-dist.new index ab3468e..48755bb 100755 --- a/pbuilder-dist.new +++ b/pbuilder-dist.new @@ -5,7 +5,21 @@ # With some changes by Iain Lane # Based upon pbuilder-dist-simple by Jamin Collins and Jordan Mantha. # -# License: GPLv2 or later +# ################################################################## +# +# 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 2 +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## # # This script is a wrapper to be able to easily use pbuilder for # different distributions (eg, Gutsy, Hardy, Debian unstable, etc). diff --git a/pull-debian-debdiff b/pull-debian-debdiff index 08c47bb..eb0fd60 100755 --- a/pull-debian-debdiff +++ b/pull-debian-debdiff @@ -1,6 +1,22 @@ #!/usr/bin/perl +# # Copyright 2007-2008 Kees Cook -# License 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 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## # # This script attempts to find and download a specific version of a Debian # package and its immediate parent to generate a debdiff. diff --git a/pull-lp-source b/pull-lp-source index a58ec91..abf338c 100755 --- a/pull-lp-source +++ b/pull-lp-source @@ -1,12 +1,15 @@ #!/usr/bin/python +# # pull-lp-source -- pull a source package from Launchpad -# Basic usage: pull-lp-source [] +# Basic usage: pull-lp-source [] # # Copyright (C) 2008 Iain Lane # -# BackportFromLP class taken from prevu tool, which has -# copyright (C) 2006 John Dong . +# BackportFromLP class taken from prevu tool, which is: +# 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 @@ -17,71 +20,107 @@ # 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. +# See file /usr/share/common-licenses/GPL for more details. # +# ################################################################## -# 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 +import re +import subprocess +import sys +import urllib2 +from optparse import OptionParser 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 + def __getitem__(self, name): + return getattr(self, name) + + def __init__(self, package, target_release): + self.package = package + self.target_release = target_release + self.__prepare_sources() + + def __prepare_sources(self): + # Scrape the source package from Launchpad :) + contents = urllib2.urlopen('https://launchpad.net/ubuntu/%(target_release)s/+source/%(package)s' % self).read() + links = re.findall('a href=\"(.*\.dsc)\"', contents) + + if len(links) == 1 and \ + subprocess.call(['dget', '-xu', '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.' - 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] +default_release = 'intrepid' if __name__ == '__main__': + usage = "Usage: %prog [release]" + optParser = OptionParser(usage) + (options, args) = optParser.parse_args() + + if not args: + print >> sys.stderr, "Need arguments." + optParser.print_help() + sys.exit(1) + + package = args[0] - args = sys.argv[1:] or [] + if len(args) == 2: # Custom distribution specified. + release = args[1] + else: + release = os.getenv('DIST') or default_release - if args == [] or args[0] in ('-h', '--help'): - usage() - sys.exit(0) + # Correct-ish args, can proceed. + # Check release by checking if Launchpad page exists + try: + urllib2.urlopen("https://launchpad.net/ubuntu/%s" % release) + except urllib2.HTTPError: + print >> sys.stderr, "The '%s' release does not appear to exist on " \ + "Launchpad." % release + sys.exit(1) - if len(args) >= 1: - package = args[0] + # Check package exists. + try: - 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) + sourcePage = urllib2.urlopen("https://launchpad.net/ubuntu/%s/+source/%s" % \ + (release, package)).read() + m = re.search('"/ubuntu/%s/\+source/%s/(\d[^"]+)"' % (release, \ + package.replace('+', '\+')), sourcePage) + + if not m: + print >> sys.stderr, "The '%s' package does not appear to exist in " \ + "the '%s' release." % (package, release) + 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) + except urllib2.HTTPError, e: # Raised on 404 + + if e.code == 404: + + print >> sys.stderr, "The '%s' package does not appear to exist in " \ + "the '%s' release." % (package, release) + + else: # Other code, probably LP malfunction + + print >> sys.stderr, "Error when checking Launchpad for package: %s " % e + + sys.exit(1) + + except urllib2.URLError, e: # Other error (NXDOMAIN, ...) + + (_, reason) = e.reason + + print >> sys.stderr, "Error when checking Launchpad for package: %s " % reason + sys.exit(1) + + # All good - start downloading... + try: + print 'Attempting to get %s from release %s...' % \ + (package, release.capitalize()) + BackportFromLP(package, release) + except ValueError, e: + print 'Error when downloading package %s from release %s: %s.' % \ + (package, release, e) diff --git a/requestsync b/requestsync index c58dec5..debaba9 100755 --- a/requestsync +++ b/requestsync @@ -8,20 +8,83 @@ # Michael Bienia (python-launchpad-bugs support) # Daniel Hahler # Iain Lane +# Jonathan Patrick Davies # -# License: GPLv2, see /usr/share/common-licenses/GPL-2 +# ################################################################## +# +# 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; version 2. +# +# 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. +# +# See file /usr/share/common-licenses/GPL-2 for more details. +# +# ################################################################## -import os, sys, urllib, subprocess, getopt +import getopt +import os +import subprocess +import sys +import urllib +import urllib2 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 +# Use functions from ubuntu-dev-tools to create Launchpad cookie file. +sys.path.append('/usr/share/ubuntu-dev-tools/') +import common + +launchpad_cookiefile = common.prepareLaunchpadCookie() +def checkNeedsSponsorship(component): + """ + Check that the user has the appropriate permissions by checking what + Launchpad returns while authenticating with their cookie. + + If they are an indirect or direct member of the ~ubuntu-dev team on + Launchpad - sponsorship is not required if the package is in the + universe / multiverse component. + + If they are in the ~ubuntu-core-dev team, no sponsorship required. + + The prepareLaunchpadCookie function above shall ensure that a cookie + file exists first. + """ + urlopener = common.setupLaunchpadUrlOpener(launchpad_cookiefile) + + # Check where the package is and assign the appropriate variables. + if component in ['main', 'restricted']: + team = "ubuntu-core-dev" + sponsor = "ubuntu-main-sponsors" + else: + team = "ubuntu-dev" + sponsor = "ubuntu-universe-sponsors" + + # Try and open up Launchpad. + try: teamLPPage = urlopener.open('https://launchpad.net/~%s' % team).read() + except urllib2.HTTPError: + print >> sys.stderr, "Unable to connect to Launchpad." + + # Check if they are a member of the team. + if "You are an indirect member of this team:" in teamLPPage or \ + "You are a member of this team." in teamLPPage: + return False # Sponsorship not required. + + # Check if they are not. + if "You are not a member of this team" in teamLPPage: + print "You are not a member (direct or indirect) of the '%s' " \ + "team on Launchpad." % team + print "Your sync request shall require an approval by a member of " \ + "the '%s'\nteam, who shall be subscribed to this bug report." % sponsor + print "This must be done before it can be processed by a member of " \ + "the Ubuntu Archive team." + print "Should the above be incorrect, please press Control-C now to " \ + "stop this script now\nand check the cookie file at:", launchpad_cookiefile + raw_input_exit_on_ctrlc() # Abort if necessary. + return True # Sponsorship required. def cur_version_component(sourcepkg, release): '''Determine current package version in ubuntu.''' @@ -108,18 +171,17 @@ def raw_input_exit_on_ctrlc(*args, **kwargs): sys.exit(1) def usage(): - print '''Usage: requestsync [-h|-n|-s|-k |--lp] [basever] + print '''Usage: requestsync [-h|-n|-k |--lp] [basever] In some cases, the base version (fork point from Debian) cannot be determined automatically, and you'll get a complete Debian changelog. Specify the correct base version of the package in Ubuntu. Options: - -h print this help - -n new source package (doesn't exist yet in Ubuntu) - -s request sponsoring (through ubuntu-{main,universe}-sponsors) - -k sign email with (only used when submitting per email) - --lp use python-launchpad-bugs instead of email for bug submitting + -h print this help + -n new source package (doesn't exist yet in Ubuntu) + -k sign email with (only used when submitting per email) + --lp use python-launchpad-bugs instead of email for bug submitting ''' sys.exit(1) @@ -204,8 +266,12 @@ def mail_bug(source_package, subscribe, status, bugtitle, bugtext, keyid = None) try: s = smtplib.SMTP(mailserver, mailserver_port) except socket.error, s: - print "ERROR: Could not connect to mailserver %s at port %s: %s (%i)" % \ + print >> sys.stderr, "Could not connect to mailserver %s at port %s: %s (%i)" % \ (mailserver, mailserver_port, s[1], s[0]) + print "The port %s may be firewalled. Please try using requestsync with" \ + % mailserver_port + print "the '--lp' flag to file a sync request with the launchpadbugs " \ + "module." return False # authenticate to the server @@ -234,7 +300,6 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext): Return True if successfully posted, otherwise False.''' import glob, os.path - global launchpad_cookiefile try: import launchpadbugs.connector @@ -242,23 +307,7 @@ def post_bug(source_package, subscribe, status, bugtitle, bugtext): print >> sys.stderr, 'Importing launchpadbugs failed. Is python-launchpad-bugs installed?' return False - # Search cookiefile (for authentication to lp) - 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 + print "Using cookie file at", launchpad_cookiefile if source_package: product = {'name': source_package, 'target': 'ubuntu'} @@ -310,7 +359,8 @@ def edit_report(subject, body, changes_required=False): program exits. Returns (new_subject, new_body). """ - import re, string + import re + import string report = "Summary (one line):\n%s\n\nDescription:\n%s" % (subject, body) @@ -361,22 +411,22 @@ if __name__ == '__main__': distro = 'unstable' try: - opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnsd:k:', ('lp')) + opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnd:k:', ('lp')) except getopt.GetoptError: usage() for o, a in opts: if o == '-h': usage() if o == '-n': newsource = True - if o == '-s': sponsorship = True if o == '-k': keyid = a if o == '-d': distro = 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 @@ -388,6 +438,8 @@ if __name__ == '__main__': debiancomponent = debian_component(srcpkg, distro) deb_version = cur_deb_version(srcpkg, distro) + + sponsorship = checkNeedsSponsorship(component) if deb_version == cur_ver: print 'The versions in Debian and Ubuntu are the same already (%s). Aborting.' % (deb_version,) diff --git a/reverse-build-depends b/reverse-build-depends index 5e4f617..8a95ca8 100755 --- a/reverse-build-depends +++ b/reverse-build-depends @@ -1,7 +1,23 @@ #!/bin/bash +# # Copyright (C) 2007 Siegfried-A. Gevatter # Based upon a short script by an unknown author -# License: GPLv2+ +# +# ################################################################## +# +# 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 2 +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## # # This script is used to find the reverse build dependencies # that a package has. diff --git a/setup.py b/setup.py index 7b18fdb..0833139 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python from distutils.core import setup import glob @@ -15,25 +15,27 @@ if os.path.exists(changelog): setup(name='ubuntu-dev-tools', version=version, - scripts=['404main', - 'check-symbols', - 'get-branches', - 'pbuilder-dist', - 'pbuilder-dist-simple', - 'update-maintainer', + scripts=['404main', + 'buildd', + 'check-symbols', 'dch-repeat', - 'mk-sbuild-lv', - 'pull-debian-debdiff', - 'what-patch', - 'suspicious-source', - 'requestsync', + 'dgetlp', + 'get-branches', + 'get-build-deps', + 'grab-attachments', 'hugdaylist', 'massfile', - 'submittodebian', - 'get-build-deps', - 'dgetlp', + 'mk-sbuild-lv', + 'pbuilder-dist', + 'pbuilder-dist-simple', + 'pull-debian-debdiff', + 'pull-lp-source', + 'requestsync', 'reverse-build-depends', - 'grab-attachments', + 'submittodebian', + 'suspicious-source', + 'update-maintainer', + 'what-patch', ], packages=['ubuntutools'], ) diff --git a/submittodebian b/submittodebian index 209fe7b..770b4b1 100755 --- a/submittodebian +++ b/submittodebian @@ -1,23 +1,25 @@ #!/usr/bin/python # -*- coding: utf-8 -*- # -# submittodebian - tool to submit patches to Debian's bts -# Copyright (C) 2007 Canonical Ltd. -# Author: Soren Hansen +# submittodebian - tool to submit patches to Debian's BTS +# Copyright (C) 2007 Canonical Ltd. +# Author: Soren Hansen # -# 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 2 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. +# 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 2 +# 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. +# +# See file /usr/share/common-licenses/GPL 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. +# ################################################################## import re, os, sys from tempfile import mkstemp diff --git a/suspicious-source b/suspicious-source index 943376e..e4d81f9 100755 --- a/suspicious-source +++ b/suspicious-source @@ -1,7 +1,19 @@ #!/bin/bash +# # Copyright 2007 (C) Siegfried-A. Gevatter # Based upon a script by Martin Pitt -# License: GPLv3 or later +# +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. # # This script outputs a list of files which are not common source files. This # should be run in the root of a source tree to find files which might not be diff --git a/update-maintainer b/update-maintainer index ce03185..5403ef4 100755 --- a/update-maintainer +++ b/update-maintainer @@ -1,6 +1,21 @@ #!/bin/bash +# # Copyright 2007 (C) Albin Tonnerre (Lutin) -# License: GPLv2 +# +# ################################################################## +# +# 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; version 2. +# +# 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. +# +# See file /usr/share/common-licenses/GPL-2 for more details. +# +# ################################################################## # # This script is used to update the Maintainer field of an Ubuntu package # to match the DebianMaintainerField specification. diff --git a/what-patch b/what-patch index 73920fa..c7bcd54 100755 --- a/what-patch +++ b/what-patch @@ -1,11 +1,28 @@ #!/bin/bash +# # Copyright 2006-2008 (C) Kees Cook # Modified by Siegfried-A. Gevatter # Modified by Daniel Hahler -# License: GPLv2 +# +# ################################################################## +# +# 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. +# +# See file /usr/share/common-licenses/GPL for more details. +# +# ################################################################## +# +# By default only the name of the patch system is printed. Verbose mode can be +# enabled with -v. -# Default operation reports only the patch system. Verbose mode can be -# enabled with -v if [ "$1" = "-h" ] || [ "$1" = "--help" ] then cat <