mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-04-18 13:51:08 +00:00
sponsor-patch: Add --update option to make sure build environment is
up to date (LP: #689605)
This commit is contained in:
parent
b01194ef8d
commit
9f6067b68f
@ -65,6 +65,11 @@ def parse(args):
|
||||
default=None,
|
||||
help='Specify the package builder (default: pbuilder)',
|
||||
metavar='BUILDER')
|
||||
p.add_option('-U', '--update',
|
||||
dest='update',
|
||||
default=False,
|
||||
action='store_true',
|
||||
help='Update the build environment before attempting to build')
|
||||
p.add_option('-u', '--upload',
|
||||
dest='upload',
|
||||
help='Specify an upload destination',
|
||||
@ -166,6 +171,9 @@ def do_build(workdir, package, release, bp_version, opts):
|
||||
if not builder:
|
||||
return
|
||||
|
||||
if opts.update:
|
||||
builder.update(release)
|
||||
|
||||
builder.build(os.path.join(workdir,
|
||||
'%s_%s.dsc' % (package, bp_version)),
|
||||
release,
|
||||
|
4
debian/changelog
vendored
4
debian/changelog
vendored
@ -7,8 +7,10 @@ ubuntu-dev-tools (0.108) UNRELEASED; urgency=low
|
||||
|
||||
[ Evan Broder ]
|
||||
* backportpackage: new script for testing backport requests in a PPA.
|
||||
* sponsor-patch: Add --update option to make sure build environment is
|
||||
up to date (LP: #689605)
|
||||
|
||||
-- Evan Broder <evan@ebroder.net> Sat, 11 Dec 2010 14:11:54 -0800
|
||||
-- Evan Broder <evan@ebroder.net> Mon, 13 Dec 2010 03:57:20 -0800
|
||||
|
||||
ubuntu-dev-tools (0.107) experimental; urgency=low
|
||||
|
||||
|
@ -35,6 +35,9 @@ Use the specified builder to build the package. Supported are
|
||||
\fBpbuilder\fR(8) and \fBsbuild\fR(1). This overrides
|
||||
\fBUBUNTUTOOLS_BUILDER\fR. The default is \fBpbuilder\fR(8).
|
||||
.TP
|
||||
.B \-U, \-\-update
|
||||
Update the builder environment before attempting to build.
|
||||
.TP
|
||||
.B \-u \fIUPLOAD\fR, \-\-upload=\fIUPLOAD\fR
|
||||
Upload to \fIUPLOAD\fR with \fBdput\fR(1) (after confirmation).
|
||||
.TP
|
||||
|
@ -77,6 +77,9 @@ Shortcut for sponsored uploads. Equivalent to \fB\-b \-u ubuntu\fR.
|
||||
.B \-u \fIDEST\fR, \fB\-\-upload\fR=\fIDEST
|
||||
Upload to \fIDEST\fR with \fBdput\fR(1) (after confirmation).
|
||||
.TP
|
||||
.BR \-U ", " \-\-update
|
||||
Make sure the build environment is up to date before building.
|
||||
.TP
|
||||
.BR \-v ", " \-\-verbose
|
||||
Print more information.
|
||||
.TP
|
||||
|
@ -409,8 +409,8 @@ def apply_patch(task, patch):
|
||||
edit = True
|
||||
return edit
|
||||
|
||||
def main(script_name, bug_number, build, edit, keyid, upload, workdir, builder,
|
||||
verbose=False):
|
||||
def main(script_name, bug_number, update, build, edit, keyid, upload, workdir,
|
||||
builder, verbose=False):
|
||||
workdir = os.path.expanduser(workdir)
|
||||
if not os.path.isdir(workdir):
|
||||
try:
|
||||
@ -598,6 +598,15 @@ def main(script_name, bug_number, build, edit, keyid, upload, workdir, builder,
|
||||
continue
|
||||
|
||||
if build:
|
||||
if update:
|
||||
ret = builder.update()
|
||||
if ret != 0:
|
||||
Logger.error("Failed to update %s chroot for %s." % \
|
||||
(changelog.distributions,
|
||||
builder.get_name()))
|
||||
ask_for_manual_fixing()
|
||||
continue
|
||||
|
||||
buildresult = os.path.join(workdir, task.package + "-buildresult")
|
||||
if not os.path.isdir(buildresult):
|
||||
os.makedirs(buildresult)
|
||||
@ -609,7 +618,7 @@ def main(script_name, bug_number, build, edit, keyid, upload, workdir, builder,
|
||||
Logger.error("Failed to build %s from source with %s." % \
|
||||
(os.path.basename(new_dsc_file),
|
||||
builder.get_name()))
|
||||
# TODO: Add "retry" and "update" option
|
||||
# TODO: Add "retry" option
|
||||
ask_for_manual_fixing()
|
||||
continue
|
||||
|
||||
@ -706,6 +715,9 @@ if __name__ == "__main__":
|
||||
dest="sponsoring", action="store_true", default=False)
|
||||
parser.add_option("-u", "--upload", dest="upload", default=None,
|
||||
help="Specify an upload destination (default none).")
|
||||
parser.add_option("-U", "--update", dest="update", default=False,
|
||||
action="store_true",
|
||||
help="Update builder chroot before building")
|
||||
parser.add_option("-v", "--verbose", help="print more information",
|
||||
dest="verbose", action="store_true", default=False)
|
||||
parser.add_option("-w", "--workdir", dest="workdir",
|
||||
@ -737,5 +749,6 @@ if __name__ == "__main__":
|
||||
options.build = True
|
||||
options.upload = "ubuntu"
|
||||
|
||||
main(script_name, bug_number, options.build, options.edit, options.keyid,
|
||||
options.upload, options.workdir, builder, options.verbose)
|
||||
main(script_name, bug_number, options.update, options.build, options.edit,
|
||||
options.keyid, options.upload, options.workdir, builder,
|
||||
options.verbose)
|
||||
|
Loading…
x
Reference in New Issue
Block a user