mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
Merge with trunk
This commit is contained in:
commit
abd7660c33
@ -31,5 +31,5 @@ _pbuilder-dist()
|
||||
return 0
|
||||
}
|
||||
[ "$have" ] && complete -F _pbuilder-dist -o filenames \
|
||||
{pbuilder,cowbuilder}-{dist,dapper,edgy,feisty,gutsy,hardy,intrepid,jaunty,karmic,lucid,sarge,etch,lenny,squeeze,sid}
|
||||
{pbuilder,cowbuilder}-{dist,dapper,edgy,feisty,gutsy,hardy,intrepid,jaunty,karmic,lucid,maverick,sarge,etch,lenny,squeeze,sid}
|
||||
# Make it pbuilder-* if you know how to do it
|
||||
|
@ -47,7 +47,7 @@ EOM
|
||||
exit(0);
|
||||
}
|
||||
|
||||
my @releases = ('dapper', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid');
|
||||
my @releases = ('dapper', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid', 'maverick');
|
||||
|
||||
#Getopt::Long::Configure("bundling", "no_ignore_case");
|
||||
our $opt_build_tree = "/scratch/ubuntu/build";
|
||||
|
22
debian/changelog
vendored
22
debian/changelog
vendored
@ -1,4 +1,11 @@
|
||||
ubuntu-dev-tools (0.98) UNRELEASED; urgency=low
|
||||
ubuntu-dev-tools (0.99) UNRELEASED; urgency=low
|
||||
|
||||
[ Luca Falavigna ]
|
||||
* syncpackage: new script to easily upload pristine Debian packages.
|
||||
|
||||
-- Luca Falavigna <dktrkranz@ubuntu.com> Sat, 17 Apr 2010 12:46:34 +0200
|
||||
|
||||
ubuntu-dev-tools (0.98) lucid; urgency=low
|
||||
|
||||
[ Ryan Kavanagh ]
|
||||
* Added the merge-changelog script from
|
||||
@ -6,17 +13,24 @@ ubuntu-dev-tools (0.98) UNRELEASED; urgency=low
|
||||
who need to manually merge packages.
|
||||
* Fixed typo in doc/grab-merge.1
|
||||
|
||||
[ Soren Hansen ]
|
||||
* Update get-branches to account for changes in LP's web UI. Really, someone
|
||||
should update it to use the LP API, but for now, this will have to do.
|
||||
|
||||
[ Emmet Hikory ]
|
||||
* doc/mk-sbuild.1: add missing options to summary
|
||||
|
||||
[ Michael Bienia ]
|
||||
* lp-shell: Use "udt-lp-shell" as LP API consumer instead of the non-unique
|
||||
"test" (lp: #558531).
|
||||
* get-branches: Use the LP API to obtain a list of branches of a team.
|
||||
|
||||
[ Luca Falavigna ]
|
||||
* syncpackage: new script to easily upload pristine Debian packages.
|
||||
[ Loïc Minier ]
|
||||
* bash_completion/pbuilder-dist, dch-repeat: list maverick in possible
|
||||
Ubuntu dists; the default dist for reverse-build-depends and
|
||||
submittodebian should be changed in maverick.
|
||||
|
||||
-- Luca Falavigna <dktrkranz@debian.org> Tue, 13 Apr 2010 23:17:22 +0200
|
||||
-- Loïc Minier <loic.minier@ubuntu.com> Fri, 16 Apr 2010 12:58:22 +0200
|
||||
|
||||
ubuntu-dev-tools (0.97) lucid; urgency=low
|
||||
|
||||
|
@ -1,32 +1,39 @@
|
||||
.TH GET\-BRANCHES "1" "11 August 2008" "ubuntu-dev-tools"
|
||||
.TH get\-branches "1" "11 August 2008" "ubuntu-dev-tools"
|
||||
.SH NAME
|
||||
get\-branches \- downloads all branches related to a Launchpad team or person
|
||||
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
|
||||
.RB [ \-d
|
||||
.IR directory ]
|
||||
.RB [ \-o
|
||||
.BR branch | checkout ]
|
||||
.B \-t
|
||||
.I team
|
||||
.br
|
||||
.B get\-branches <team>
|
||||
.B get\-branches
|
||||
.I team
|
||||
.br
|
||||
.B get\-branches \-\-help
|
||||
|
||||
.SH DESCRIPTION
|
||||
\fBget\-branches\fR examines the code page of a Launchpad team/person,
|
||||
parses it, and calls Bazaar to download all branches on that page.
|
||||
\fBget\-branches\fR uses the LP API to get a list of branches for a person or
|
||||
team and calls Bazaar to download all branches.
|
||||
|
||||
.SH OPTIONS
|
||||
Listed below are the command line options for \fBget\-branches\fR:
|
||||
.TP
|
||||
.B \-h or \-\-help
|
||||
.BR \-h ", " \-\-help
|
||||
Display a help message and exit.
|
||||
.TP
|
||||
.B \-d or \-\-directory
|
||||
.BR \-d ", " \-\-directory
|
||||
Download branches to a directory other than the current directory.
|
||||
.TP
|
||||
.B \-o or \-\-operation
|
||||
.BR \-o ", " \-\-operation
|
||||
Specifies which Bazaar operation to use when downloading the branches; may be
|
||||
either \fIbranch\fR or \fIcheckout\fR.
|
||||
.TP
|
||||
.B \-t or \-\-team
|
||||
.BR \-t ", " \-\-team
|
||||
Specifies which Launchpad team/person to download branches from.
|
||||
This option is required.
|
||||
|
||||
|
96
get-branches
96
get-branches
@ -25,11 +25,10 @@
|
||||
#
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import urllib2
|
||||
from optparse import OptionParser
|
||||
from ubuntutools.lp.lpapicache import PersonTeam
|
||||
|
||||
def main():
|
||||
usage = "Usage: %prog [-d <directory>] -t <team> [-o <operation>]"
|
||||
@ -49,93 +48,62 @@ def main():
|
||||
|
||||
(options, args) = optParser.parse_args()
|
||||
|
||||
# Fetch our current directory to return to later.
|
||||
pwd = os.getcwd()
|
||||
|
||||
# Parse our options.
|
||||
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.
|
||||
directory = options.directory
|
||||
if not os.path.isdir(directory): # Check that it is a directory.
|
||||
optParser.error("%s is not a valid directory." % directory)
|
||||
os.chdir(directory)
|
||||
|
||||
# Type of Bazaar operation to perform.
|
||||
operation_type = str(options.operation).lower()
|
||||
|
||||
# Got an argument, check if it is valid.
|
||||
operation_type = options.operation.lower()
|
||||
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.
|
||||
# Launchpad team setting.
|
||||
if options.lpteam:
|
||||
team = options.lpteam.lower()
|
||||
if args:
|
||||
team = args[0].lower()
|
||||
try:
|
||||
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)
|
||||
team = PersonTeam(team)
|
||||
except KeyError:
|
||||
print >> sys.stderr, "E: The team '%s' doesn't exist." % team
|
||||
|
||||
branch_list_page = sock.read()
|
||||
sock.close()
|
||||
# Get a list of branches
|
||||
branches = team.getBranches()
|
||||
|
||||
branch_page_urls_regex = r'.*href="/(~%s/.*)">lp:.*' % team
|
||||
branch_page_urls = re.findall(branch_page_urls_regex, branch_list_page)
|
||||
|
||||
# Check the team actually has branches.
|
||||
if len(branch_page_urls) == 0:
|
||||
print "The team '%s' does not have any branches on Launchpad." % team
|
||||
sys.exit(0)
|
||||
|
||||
print "Downloading all branches for the team '%s'. This may take some " \
|
||||
"time." % team
|
||||
print "Downloading all branches for the '%s' team. This may take some " \
|
||||
"time." % team.display_name
|
||||
|
||||
try:
|
||||
os.makedirs(team)
|
||||
os.makedirs(team.name)
|
||||
except:
|
||||
pass
|
||||
|
||||
os.chdir(team)
|
||||
os.chdir(team.name)
|
||||
|
||||
for url in branch_page_urls:
|
||||
sock = urllib2.urlopen("https://code.launchpad.net/%s" % url)
|
||||
branch_page = sock.read()
|
||||
sock.close()
|
||||
for branch in branches:
|
||||
project_name = branch.project.name
|
||||
if not os.path.exists(project_name):
|
||||
os.makedirs(project_name)
|
||||
os.chdir(project_name)
|
||||
|
||||
branch_url_regex = r'<dd>bzr branch <span.*>lp:(.*)</span></dd>'
|
||||
branch_url = re.findall(branch_url_regex, branch_page)
|
||||
|
||||
if branch_url[0]:
|
||||
print "Downloading branch: lp:%s (%s)." % (branch_url[0], url)
|
||||
product = url.split("/")[-2]
|
||||
branch_nick = url.split("/")[-1]
|
||||
if not os.path.exists(branch.name):
|
||||
print "Branching %s ..." % branch.display_name
|
||||
subprocess.call(["bzr", operation_type, branch.bzr_identity, branch.name])
|
||||
else:
|
||||
continue
|
||||
|
||||
print branch_nick, product, os.getcwd()
|
||||
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" % url])
|
||||
else:
|
||||
os.chdir(branch_nick)
|
||||
print "Merging %s ..." % branch.display_name
|
||||
os.chdir(branch.name)
|
||||
subprocess.call(["bzr", "merge", "--pull", "--remember"])
|
||||
os.chdir(os.path.join(directory, team))
|
||||
os.chdir(os.path.join(directory, team.name))
|
||||
|
||||
os.chdir(pwd)
|
||||
sys.exit(0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user