diff --git a/debian/changelog b/debian/changelog index 35fe2c1..7215bc0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,14 +6,17 @@ ubuntu-dev-tools (0.35) intrepid; urgency=low * 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. [ Iain Lane ] - * Add pull-lp-source: Get source packages from LP to avoid mirror lag. + * Add pull-lp-source, which get source packages from LP to avoid mirror lag. * pbuilder-dist.new: - - Set mirror and componente for debian distros - - Use local apt cache if available + - Set mirror and component for Debian distros. + - Use local apt cache if available. * massfile: - - Modify to work with Firefox 3 cookies + - 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:43:10 +0100 diff --git a/doc/pull-lp-source.1 b/doc/pull-lp-source.1 index 4595486..ec106a5 100644 --- a/doc/pull-lp-source.1 +++ b/doc/pull-lp-source.1 @@ -1,16 +1,18 @@ .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 <\fBsource package\fR> [\fItarget release\fR] -.B pull-lp-source -h +.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: @@ -24,6 +26,14 @@ This is the source package that you would like to be downloaded from Launchpad. .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 -This manual page was written by Iain Lane +\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 --git a/examples/massfile.instructions b/examples/massfile.instructions index 4605afc..773093a 100644 --- a/examples/massfile.instructions +++ b/examples/massfile.instructions @@ -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 @@ text: installable (on AMD64) at the moment. . Please have a look and make sure it's installable again. - diff --git a/massfile b/massfile index a835e12..ccc6780 100755 --- a/massfile +++ b/massfile @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- # # (C) Canonical, 2007, GPL v3 -# Authors: -# Iain Lane , taking some code written by: -# Daniel Hahler +# +# Modified by Iain Lane , taking some code written by +# Daniel Hahler import os import sys @@ -22,7 +22,7 @@ def read_config(): instr = dict() for field in "subject", "assignee", "subscribers", "tags", "text", \ - "buglist-url": + "buglist-url", "status": instr[field] = instructions.get(field) return instr @@ -89,7 +89,10 @@ def file_bug(config): if tag.strip("\n").strip(): bug.tags.append(tag.strip("\n").strip()) bug.assignee = config["assignee"] - bug.status = "Confirmed" + if config["status"]: + bug.status = config["status"].capitalize() + else: + bug.status = "Confirmed" bug.commit() except: "Bug for '%s' was not filed." % config["sourcepackage"] @@ -123,10 +126,10 @@ def lp_cookie(): 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) - - + 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) diff --git a/pbuilder-dist.new b/pbuilder-dist.new index 12fe499..ab3468e 100755 --- a/pbuilder-dist.new +++ b/pbuilder-dist.new @@ -17,7 +17,7 @@ import sys import os -debian_distros = ["etch", "lenny", "sid", "stable", "testing", "unstable"] +debian_distros = ['etch', 'lenny', 'sid', 'stable', 'testing', 'unstable'] class pbuilder_dist: @@ -184,18 +184,19 @@ class pbuilder_dist: '--logfile "%(logfile)s"' % self, '--aptcache "/var/cache/apt/archives/"', ### --mirror "${ARCHIVE}" \ - '--bindmounts /var/cache/archive/ --override-config' + '--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) - + 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) diff --git a/pull-lp-source b/pull-lp-source index 66abad0..a58ec91 100755 --- a/pull-lp-source +++ b/pull-lp-source @@ -2,9 +2,10 @@ # 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 and: -# Copyright (C) 2006 John Dong +# 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 @@ -24,39 +25,44 @@ # TODO: Determine before going to LP whether a source package and distro exist or not. # TODO: Determine current development distro programatically -import sys,os +import sys +import os -class BackportFromLP(): +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.package = package + self.target_distro = target_distro self.__prepare_sources() + def __prepare_sources(self): - # Scrape from Launchpad the source package :) + # 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 -xu http://launchpad.net%s" % links[0])) == 0: - print 'Success' + if len(links) == 1 and \ + (os.system('dget -x http://launchpad.net%s' % links[0])) == 0: + print '\nSuccess!' else: - raise ValueError, "Failed to fetch and extract source. Ensure that the package specified is a valid source package name and Launchpad is not down." + 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__': +if __name__ == '__main__': args = sys.argv[1:] or [] - if args == [] or args[0] in ['-h', '--help']: + if args == [] or args[0] in ('-h', '--help'): usage() sys.exit(0) @@ -66,15 +72,16 @@ if __name__=='__main__': if len(args) == 2: distro = args[1] elif len(args) == 1: - distro=os.getenv('DIST') or default_distro + 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) + 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) - + print 'Error when downloading package %s from distro %s: %s' % \ + (package, distro, e)