Merge with trunk

This commit is contained in:
Iain Lane 2008-08-13 10:38:32 +01:00
commit ce044d17df
42 changed files with 1217 additions and 382 deletions

17
404main
View File

@ -3,7 +3,22 @@
#
# Copyright 2006-2007 (C) Pete Savage <petesavage@ubuntu.com>
# Copyright 2007 (C) Siegfried-A. Gevatter <rainct@ubuntu.com>
# 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.

15
AUTHORS
View File

@ -1,15 +0,0 @@
Albert Damen <albrt@gmx.net>
Albin Tonnerre <lut1n.tne@gmail.com>
Daniel Hahler <ubuntu@thequod.de>
Daniel Holbach <daniel.holbach@ubuntu.com>
Jamin W. Collins <jcollins@asgardsrealm.net>
Jordan Mantha <mantha@ubuntu.com>
Luke Yelavich <themuso@ubuntu.com>
Martin Pitt <martin.pitt@ubuntu.com>
Michael Bienia <geser@ubuntu.com>
Pete Savage <petesavage@ubuntu.com>
Kees Cook <kees@ubuntu.com>
Siegfried-A. Gevatter <rainct@ubuntu.com>
Soren Hansen <soren@ubuntu.com>
Steve Kowalik <stevenk@ubuntu.com>
Terence Simpson <stdin@stdin.me.uk>

78
README
View File

@ -1,78 +0,0 @@
================================
== Ubuntu Development Tools ==
================================
404main <package>
... will check if <package> and all it's build dependencies are
are in the "main" component or not.
check-symbols <package> [<directory>]
... will compare and give you a diff of the exported symbols of all
.so files in all binary packages of <package>. <directory> 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 <URL>
... will simulate «dget»'s behaviour for files hosted at
launchpadlibrarian.net.
get-branches <directory> <team> [checkout|branch]
... will branch / checkout all the Bazaar branches in a Launchpad
team.
get-build-deps [<packages list or file containing a list of packages>]
... 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 <number>] <bug list url>
... will create a list of <number> 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 <package> <version>
... will attempt to find and download a specific version of a
Debian package and its immediate parent to generate a debdiff.
requestsync [-n|-s] <source package> <target release> [base version]
... will file a sync request for a package from Debian by sending
a bug report to Launchpad.
reverse-build-depends [-c|-s] <package name>
... will print <package name>'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.

7
TODO
View File

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

85
buildd Executable file
View File

@ -0,0 +1,85 @@
#!/usr/bin/python
#
# buildd - command line interface for Launchpad buildd operations.
#
# Copyright (C) 2007 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@canonical.com>.
#
# 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 <http://www.gnu.org/licenses/>.
#
import urllib2
import re
import sys
from urllib import urlencode
sys.path.append('/usr/share/ubuntu-dev-tools/')
import common
# Parse arguments.
try:
(package, release, op) = sys.argv[1:]
except ValueError:
print >> sys.stderr, '''Usage: %s <srcpackage> <release> <operation>
operation: status | retry | rescore [priority (default 5000)]''' % sys.argv[0]
sys.exit(1)
# 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, 'This source does not appear to exist in Ubuntu'
sys.exit(1)
m = re.search('"/ubuntu/%s/\+source/%s/(\d[^"]+)"' % (release, package.replace('+', '\+')), page)
if not m:
print >> sys.stderr, 'Cannot find this source package in this release'
sys.exit(1)
version = m.group(1)
print 'Source version:', 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()
for m in re.finditer('"/ubuntu/\+source/%s/%s(/\+build/\d+)"[^\n]+\n\s*(\w+).*?<span>(\w+)</span>.*?</a>\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 op == 'rescore':
if status == 'Needs building':
print 'rescoring', build, '(%s)' % arch
urlopener.open(build+'/+rescore', urlencode(
{'SCORE': '5000', 'RESCORE': '1'}))
elif op == 'retry':
if status in ('Failed to build', 'Chroot problem', 'Failed to upload'):
print 'retrying', build, '(%s)' % arch
urlopener.open(build+'/+retry', urlencode(
{'RETRY': '1'}))
else:
print >> sys.stderr, 'Invalid operation'
sys.exit(1)

View File

@ -1,7 +1,22 @@
#!/bin/bash
# Copyright 2006-2007 (C) Daniel Holbach <daniel.holbach@ubuntu.com>
#
# Copyright (C) 2006-2007 Daniel Holbach <daniel.holbach@ubuntu.com>
# Modified by Siegfried-A. Gevatter <rainct@ubuntu.com>
# 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.

143
common.py Normal file
View File

@ -0,0 +1,143 @@
#
# common.py - provides functions which are commonly used by the
# ubuntu-dev-tools package.
#
# Copyright (C) 2008 Jonathan Patrick Davies <jpds@ubuntu.com>
# Copyright (C) 2008 Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
#
# Some of the functions are based upon code written by Martin Pitt
# <martin.pitt@ubuntu.com> and Kees Cook <kees@ubuntu.com>.
#
# ##################################################################
#
# 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')
if launchpad_cookiefile == None:
for try_glob in try_globs:
try:
cookiefile = glob.glob(os.path.expanduser(try_glob))[0]
except IndexError:
continue # Unable to glob file - carry on.
# Found:
launchpad_cookiefile = cookiefile
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)
# Found SQLite file. Parse information from it.
if launchpad_cookiefile.find('cookies.sqlite') != -1:
import sqlite3 as sqlite
con = sqlite.connect(launchpad_cookiefile)
cur = con.cursor()
cur.execute("select host, path, isSecure, expiry, name, value from moz_cookies where host like ?", ['%%launchpad%%'])
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')
newLPCookie.write("# HTTP Cookie File.\n") # Header.
for item in cur.fetchall():
# 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.
# Check what we have written.
checkCookie = open(newLPCookieLocation).read()
if checkCookie == "# HTTP Cookie File.\n\n":
print >> sys.stderr, "No Launchpad cookies were written to file. " \
"Please visit and log into Launchpad and run this script again."
os.remove(newLPCookieLocation) # Delete file.
sys.exit(1)
# For security reasons, change file mode to write and read
# only by owner.
os.chmod(newLPCookieLocation, 0600)
launchpad_cookiefile = newLPCookieLocation
# Return the Launchpad cookie.
return launchpad_cookiefile
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

View File

@ -1,7 +1,23 @@
#!/usr/bin/perl
# Copyright 2007-2008 (C) Canonical, Ltd
#
# Copyright (C) 2007-2008 Canonical, Ltd.
# Author: Kees Cook <kees@ubuntu.com>
# 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

98
debian/changelog vendored
View File

@ -1,3 +1,93 @@
ubuntu-dev-tools (0.39ubuntu1) intrepid; urgency=low
[ Jonathan Patrick Davies ]
* common.py: Use os.path.expanduser() instead of os.environ.
[ 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.
-- Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> Tue, 12 Aug 2008 20:09:42 +0200
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 <jpds@ubuntu.com> 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 <jpds@ubuntu.com> 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 <jpds@ubuntu.com> Sun, 10 Aug 2008 22:02:05 +0100
ubuntu-dev-tools (0.35) intrepid; urgency=low
[ Siegfried-Angel Gevatter Pujals ]
@ -8,6 +98,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 +114,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 <iain@orangesquash.org.uk> Mon, 04 Aug 2008 18:43:10 +0100
-- Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> Sat, 09 Aug 2008 13:58:23 +0200
ubuntu-dev-tools (0.34) intrepid; urgency=low

6
debian/control vendored
View File

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

23
debian/copyright vendored
View File

@ -7,18 +7,19 @@ Upstream Authors:
Albin Tonnerre <lut1n.tne@gmail.com>
Daniel Hahler <ubuntu@thequod.de>
Daniel Holbach <daniel.holbach@ubuntu.com>
Iain Lane <iain@orangesquash.org.uk>
Jamin W. Collins <jcollins@asgardsrealm.net>
Jonathan Patrick Davies <jpds@ubuntu.com>
Jordan Mantha <mantha@ubuntu.com>
Kees Cook <kees@ubuntu.com>
Luke Yelavich <themuso@ubuntu.com>
Martin Pitt <martin.pitt@ubuntu.com>
Michael Bienia <geser@ubuntu.com>
Pete Savage <petesavage@ubuntu.com>
Kees Cook <kees@ubuntu.com>
Siegfried-A. Gevatter <rainct@ubuntu.com>
Soren Hansen <soren@ubuntu.com>
Steve Kowalik <stevenk@ubuntu.com>
Terence Simpson <stdin@stdin.me.uk>
Iain Lane <iain@orangesquash.org.uk>
Copyright:
@ -34,12 +35,13 @@ Copyright:
(C) 2007-2008, Siegfried-A. Gevatter <rainct@ubuntu.com>
(C) 2007, Terence Simpson <stdin@stdin.me.uk>
(C) 2008, Iain Lane <iain@orangesquash.org.uk>
(C) 2008, Jonathan Patrick Davies <jpds@ubuntu.com>
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.

3
debian/rules vendored
View File

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

View File

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

View File

@ -1 +1,2 @@
bash_completion/* etc/bash_completion.d/
common.py usr/share/ubuntu-dev-tools/

26
dgetlp
View File

@ -1,20 +1,22 @@
#!/bin/bash
# Copyright (C) 2008 Terence Simpson <tsimpson@ubuntu.com>
# Modified by Siegfried-A. Gevatter <rainct@ubuntu.com>
# 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.

61
doc/dch-repeat.1 Normal file
View File

@ -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 <kees@ubuntu.com>. This manual page
was written by Jonathan Patrick Davies <jpds@ubuntu.com>.
.PP
Both are released under the GNU General Public License, version 2.
.SH SEE ALSO
.PP
.BR dch(1).

45
doc/get-branches.1 Normal file
View File

@ -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 <team>
.B get-branches <team>
.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 <daniel.holbach@ubuntu.com>, and
this manual page was written by Jonathan Patrick Davies <jpds@ubuntu.com>.
.PP
Both are released under the terms of the GNU General Public License, version 3.
.SH SEE ALSO
.PP
.B bzr(1)

View File

@ -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 <rainct@ubuntu.com>. They are released under the GNU General Public
License, version 3 or later.
Gevatter Pujals <rainct@ubuntu.com>. They are released under the GNU General
Public License, version 3 or later.

29
doc/grab-attachments.1 Normal file
View File

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

View File

@ -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 <jcollins@asgardsrealm.net> and
Jordan Mantha <mantha@ubuntu.com>.
.PP
On August 2007 it was mostly rewritten, and extended, by Siegfried-Angel Gevatter Pujals
<rainct@ubuntu.com>.
.SH SEE ALSO
\fBpbuilder\fR, \fBpbuilderrc\fR
.SH COPYRIGHT
This manual page was written by Siegfried-Angel Gevatter Pujals (RainCT)
<rainct@ubuntu.com> 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
<jcollins@asgardsrealm.net> and Jordan Mantha <mantha@ubuntu.com>. On August
2007 it was mostly rewritten, and extended, by Siegfried-Angel Gevatter Pujals
<rainct@ubuntu.com>.
.BB
\fBpbuilder\-dist\fP is released under the GNU General Public License, version
2 or later.

View File

@ -29,15 +29,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<keyid>\fR
Specifies your GPG key.
Can also be set with the line `\fIexport GPGKEY=<keyid>\fR' in
.IR $HOME/.bashrc .
Can also be set with the line `\fIexport GPGKEY=<keyid>\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 +45,43 @@ This is the source package that you would like to be synced from Debian.
.B <target release>
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.

View File

@ -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 <rainct@ubuntu.com> for YOU. Both are
released under the terms of the GNU General Public License (version 2

View File

@ -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 <soren@ubuntu.com>.
.PP
Both are released under the GNU General Public License, version 2 or later.

44
doc/what-patch.1 Normal file
View File

@ -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 <kees@ubuntu.com>, Siegfried-A.
Gevatter <rainct@ubuntu.com>, and Daniel Hahler <ubuntu@thequod.de>, among
others. This manual page was written by Jonathan Patrick Davies <jpds@ubuntu.com>.
.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)

View File

@ -1,70 +1,170 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2007 (C) Canonical Ltd.
#
# Copyright (C) 2007 Canonical Ltd.
# Created by Daniel Holbach <daniel.holbach@ubuntu.com>
# License: GPLv3
# Modified by Jonathan Patrick Davies <jpds@ubuntu.com>
#
# ##################################################################
#
# 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.
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 <directory> <team> [checkout|branch]"
if len(sys.argv) < 3:
print >> sys.stderr, usage
usage = "Usage: %prog [-d <directory>] -t <team> [-o <operation>]"
usage += "\nUsage: %prog <team>"
optParser = OptionParser(usage)
optsParsed = 0
# Our options.
optParser.add_option("-d", "--directory", action = "store_true",
dest = "directory", help = "Directory to download branches to.")
optParser.add_option("-t", "--team", action = "store_true",
dest = "lpteam", help = "Launchpad team to download branches from.")
optParser.add_option("-o", "--operation", action = "store_true",
dest = "operation", help = "Whether to branch or checkout the " \
"Bazaar branches. May be either 'branch' or 'checkout'.")
(options, args) = optParser.parse_args()
# Parse our options.
# No flags, and no team name specified.
if not options.lpteam and not args:
print >> sys.stderr, "No team has been specified."
optParser.print_help()
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]
if args:
team = args[0]
# Dictionary settings.
if options.directory:
try:
directory = args[optsParsed]
optsParsed += 1
except IndexError:
print >> sys.stderr, "The '-d' option requires an argument."
optParser.print_help()
sys.exit(1)
if not os.path.isdir(directory): # Check that it is a directory.
print >> sys.stderr, "%s is not a valid directory." % directory
optParser.print_help()
sys.exit(1)
else:
directory = os.path.abspath(args[0])
else:
# Otherwise use our current directory.
directory = os.getcwd()
# Launchpad team setting.
if options.lpteam:
try:
team = args[optsParsed]
optsParsed += 1
except IndexError:
print >> sys.stderr, "The '-t' option requires an argument."
optParser.print_help()
sys.exit(1)
# Type of Bazaar operation to perform.
if options.operation:
try:
operation_type = args[optsParsed]
optsParsed += 1
except IndexError:
print >> sys.stderr, "The '-o' option requires an argument."
optParser.print_help()
sys.exit(1)
# Got an argument, check if it is valid.
if operation_type.lower() not in ("branch", "checkout"):
print >> sys.stderr, "Invalid operation '%s' for '-o' flag." % \
operation_type
optParser.print_help()
sys.exit(1)
else:
operation_type = "branch"
pwd = os.getcwd()
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'.*<a href="/(~%s/.*)".*' % team
branch_page_urls = re.findall(branch_page_urls_regex, branch_list_page)
print "Downloading all branches for the team '%s'. This may take some " \
"time." % team
# Check the team actually has branches.
if len(branch_page_urls) == 0:
print "The team '%s' does not have any branches on Launchpad." % team
os.rmdir(team)
sys.exit(0)
try:
os.makedirs(team)
except:
pass
os.chdir(team)
sock = urllib2.urlopen("http://code.launchpad.net/~%s" % team)
branch_list_page = sock.read()
sock.close()
branch_page_urls_regex = r'.*<a href="/(~%s/.*)".*' % team
branch_page_urls = re.findall(branch_page_urls_regex, branch_list_page)
for url in branch_page_urls:
sock = urllib2.urlopen("http://code.launchpad.net/%s" % url)
branch_page = sock.read()
sock.close()
branch_url_regex = r'<th>Hosted on Launchpad:</th>.*\n.*<td>(.*)</td>'
sock = urllib2.urlopen("https://code.launchpad.net/%s" % url)
branch_page = sock.read()
sock.close()
branch_url_regex = r'<tt>bzr branch lp:~(.*)</tt>'
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()

View File

@ -1,6 +1,22 @@
#!/bin/bash
#
# Copyright 2007 (C) Siegfried-A. Gevatter <rainct@ubuntu.com>
# 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

View File

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

View File

@ -1,65 +1,107 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2007, Canonical, Daniel Holbach
# Copyright (C) 2007 Canonical Ltd., Daniel Holbach
# Copyright (C) 2008 Jonathan Patrick Davies <jpds@ubuntu.com>
#
# 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 <url>
# - produces lists like https://wiki.ubuntu.com/UbuntuBugDay/20070912?action=raw
#
# hugdaylist -n <howmany> <url>
# - will only list <howmany> URLs
#
# - will only list <howmany> 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 <howmany>] <URL>"
def check_args():
howmany = -1
url = ""
# Our usage options.
usage = "usage: %prog [-n <number>] launchpad-buglist-url"
optParser = OptionParser(usage)
argsParsed = 0
# Options - namely just the number of bugs to output.
optParser.add_option("-n", "--number", action = "store_true",
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.
if options.number:
try:
howmany = int(args[argsParsed])
argsParsed += 1
except:
print >> sys.stderr, "Option '-n' requires an integer for an " \
"argument."
optParser.print_help()
sys.exit(1)
# 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 +124,8 @@ def main():
if __name__ == '__main__':
main()
try:
main()
except KeyboardInterrupt:
print >> sys.stderr, "Aborted."
sys.exit(1)

View File

@ -1,10 +1,25 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) Canonical, 2007, GPL v3
# Copyright (C) 2007 Canonical Ltd.
#
# Modified by Iain Lane <iain@orangesquash.org.uk>, taking some code written by
# Daniel Hahler <ubuntu@thequod.de>
#
# ##################################################################
#
# 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"])

View File

@ -1,7 +1,23 @@
#!/bin/bash
#
# Copyright 2006-2007 (C) Canonical Ltd.
# Created by Kees Cook <kees@ubuntu.com>
# 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,

View File

@ -4,7 +4,21 @@
# Copyright (C) Jordan Mantha <mantha@ubuntu.com>
# Copyright (C) 2007-2008 Siegfried-A. Gevatter <rainct@ubuntu.com>
#
# 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).

View File

@ -3,7 +3,21 @@
# Copyright (C) Jamin W. Collins <jcollins@asgardsrealm.net>
# Copyright (C) Jordan Mantha <mantha@ubuntu.com>
#
# 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).

View File

@ -5,7 +5,21 @@
# With some changes by Iain Lane <iain@orangesquash.org.uk>
# 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).

View File

@ -1,6 +1,22 @@
#!/usr/bin/perl
#
# Copyright 2007-2008 Kees Cook <kees@ubuntu.com>
# 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.

View File

@ -1,12 +1,15 @@
#!/usr/bin/python
#
# pull-lp-source -- pull a source package from Launchpad
# Basic usage: pull-lp-source <source package> [<distro>]
# Basic usage: pull-lp-source <source package> [<release>]
#
# 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>.
# BackportFromLP class taken from prevu tool, which is:
# 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
# as published by the Free Software Foundation; either version 3
@ -17,71 +20,84 @@
# 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):
def __init__(self, package, target_release):
self.package = package
self.target_distro = target_distro
self.target_release = target_release
self.__prepare_sources()
def __prepare_sources(self):
# Scrape the source package from Launchpad :)
import re
contents = os.popen('wget -q https://launchpad.net/ubuntu/%(target_distro)s/+source/%(package)s -O-' % self).read()
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 \
(os.system('dget -x http://launchpad.net%s' % links[0])) == 0:
subprocess.call(['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 <package> [distro]' % sys.argv[0]
default_release = 'intrepid'
if __name__ == '__main__':
usage = "Usage: %prog <package> [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.
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)
if len(args) == 2:
distro = args[1]
elif len(args) == 1:
distro = os.getenv('DIST') or default_distro
else: # incorrect args
usage()
sys.exit(1)
# Correct-ish args, can proceed
try:
print 'Attempting to get %s from distro %s...' % \
(package, distro.capitalize())
BackportFromLP(package, distro)
except ValueError, e:
print 'Error when downloading package %s from distro %s: %s' % \
(package, distro, e)
# 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)

View File

@ -8,20 +8,82 @@
# Michael Bienia <geser@ubuntu.com> (python-launchpad-bugs support)
# Daniel Hahler <ubuntu@thequod.de>
# Iain Lane <iain@orangesquash.org.uk>
# Jonathan Patrick Davies <jpds@ubuntu.com>
#
# 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
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,7 +170,7 @@ def raw_input_exit_on_ctrlc(*args, **kwargs):
sys.exit(1)
def usage():
print '''Usage: requestsync [-h|-n|-s|-k <keyid>|--lp] <source package> <target release> [basever]
print '''Usage: requestsync [-h|-n|-k <keyid>|--lp] <source package> <target release> [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
@ -117,7 +179,6 @@ 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 <keyid> sign email with <keyid> (only used when submitting per email)
--lp use python-launchpad-bugs instead of email for bug submitting
'''
@ -234,7 +295,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 +302,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 +354,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)
@ -360,21 +405,21 @@ if __name__ == '__main__':
need_interaction = False
try:
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnsk:', ('lp'))
opts, args = getopt.gnu_getopt(sys.argv[1:], 'hnk:', ('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 == '--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
@ -386,6 +431,8 @@ if __name__ == '__main__':
debiancomponent = debian_component(srcpkg)
deb_version = cur_deb_version(srcpkg)
sponsorship = checkNeedsSponsorship(component)
if deb_version == cur_ver:
print 'The versions in Debian and Ubuntu are the same already (%s). Aborting.' % (deb_version,)

View File

@ -1,7 +1,23 @@
#!/bin/bash
#
# Copyright (C) 2007 Siegfried-A. Gevatter <rainct@ubuntu.com>
# 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.

View File

@ -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'],
)

View File

@ -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 <soren@ubuntu.com>
# submittodebian - tool to submit patches to Debian's BTS
# Copyright (C) 2007 Canonical Ltd.
# Author: Soren Hansen <soren@ubuntu.com>
#
# 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

View File

@ -1,7 +1,19 @@
#!/bin/bash
#
# Copyright 2007 (C) Siegfried-A. Gevatter <rainct@ubuntu.com>
# Based upon a script by Martin Pitt <martin.pitt@ubuntu.com>
# 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

View File

@ -1,6 +1,21 @@
#!/bin/bash
#
# Copyright 2007 (C) Albin Tonnerre (Lutin) <lut1n.tne@gmail.com>
# 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.

View File

@ -1,11 +1,28 @@
#!/bin/bash
#
# Copyright 2006-2008 (C) Kees Cook <kees@ubuntu.com>
# Modified by Siegfried-A. Gevatter <rainct@ubuntu.com>
# Modified by Daniel Hahler <ubuntu@thequod.de>
# 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 <<EOM