Merge with trunk

This commit is contained in:
Iain Lane 2008-08-04 20:14:48 +01:00
commit 8090782049
6 changed files with 68 additions and 44 deletions

11
debian/changelog vendored
View File

@ -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 <iain@orangesquash.org.uk> Mon, 04 Aug 2008 18:43:10 +0100

View File

@ -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
<iain@orangesquash.org.uk>. Both are released under the GNU General Public
License, version 3 or later.

View File

@ -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.

View File

@ -2,9 +2,9 @@
# -*- coding: utf-8 -*-
#
# (C) Canonical, 2007, GPL v3
# Authors:
# Iain Lane <iain@orangesquash.org.uk>, taking some code written by:
# Daniel Hahler <ubuntu-launchpad@thequod.de>
#
# Modified by Iain Lane <iain@orangesquash.org.uk>, taking some code written by
# Daniel Hahler <ubuntu@thequod.de>
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)

View File

@ -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)

View File

@ -2,9 +2,10 @@
# pull-lp-source -- pull a source package from Launchpad
# Basic usage: pull-lp-source <source package> [<distro>]
#
# Copyright (C) 2008 Iain Lane, BackportFromLP class taken from
# prevu tool and:
# Copyright (C) 2006 John Dong <jdong@ubuntu.com>
# Copyright (C) 2008 Iain Lane <iain@orangesquash.org.uk>
#
# BackportFromLP class taken from prevu tool, which has
# copyright (C) 2006 John Dong <jdong@ubuntu.com>.
#
# 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 <package> [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)