mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-19 04:41:28 +00:00
backportpackage: Add --suffix option
This commit is contained in:
parent
8afda6d3f1
commit
06446bbd4d
@ -57,6 +57,11 @@ def parse(args):
|
|||||||
default=None,
|
default=None,
|
||||||
help='Backport from SOURCE release (default: devel release)',
|
help='Backport from SOURCE release (default: devel release)',
|
||||||
metavar='SOURCE')
|
metavar='SOURCE')
|
||||||
|
p.add_option('-S', '--suffix',
|
||||||
|
dest='suffix',
|
||||||
|
default=None,
|
||||||
|
help='Suffix to append to version number (default: ~ppa1)',
|
||||||
|
metavar='SUFFIX')
|
||||||
p.add_option('-b', '--build',
|
p.add_option('-b', '--build',
|
||||||
dest='build',
|
dest='build',
|
||||||
default=False,
|
default=False,
|
||||||
@ -173,9 +178,11 @@ def fetch_package(lp, workdir, package, version, source_release):
|
|||||||
cwd=workdir)
|
cwd=workdir)
|
||||||
return os.path.join(workdir, os.path.basename(dsc))
|
return os.path.join(workdir, os.path.basename(dsc))
|
||||||
|
|
||||||
def get_backport_version(version, upload, release):
|
def get_backport_version(version, suffix, upload, release):
|
||||||
v = version + ('~%s1' % release)
|
v = version + ('~%s1' % release)
|
||||||
if upload and upload.startswith('ppa:'):
|
if suffix:
|
||||||
|
v += suffix
|
||||||
|
elif upload and upload.startswith('ppa:'):
|
||||||
v += '~ppa1'
|
v += '~ppa1'
|
||||||
return v
|
return v
|
||||||
|
|
||||||
@ -210,12 +217,12 @@ def do_upload(workdir, package, bp_version, upload):
|
|||||||
check_call(['dput', upload, changes_file], cwd=workdir)
|
check_call(['dput', upload, changes_file], cwd=workdir)
|
||||||
|
|
||||||
|
|
||||||
def do_backport(workdir, package, dscfile, version, release, build, builder,
|
def do_backport(workdir, package, dscfile, version, suffix, release, build,
|
||||||
update, upload):
|
builder, update, upload):
|
||||||
check_call(['dpkg-source', '-x', dscfile, package], cwd=workdir)
|
check_call(['dpkg-source', '-x', dscfile, package], cwd=workdir)
|
||||||
srcdir = os.path.join(workdir, package)
|
srcdir = os.path.join(workdir, package)
|
||||||
|
|
||||||
bp_version = get_backport_version(version, upload, release)
|
bp_version = get_backport_version(version, suffix, upload, release)
|
||||||
bp_dist = get_backport_dist(upload, release)
|
bp_dist = get_backport_dist(upload, release)
|
||||||
|
|
||||||
check_call(['dch',
|
check_call(['dch',
|
||||||
@ -278,6 +285,7 @@ def main(args):
|
|||||||
package,
|
package,
|
||||||
dscfile,
|
dscfile,
|
||||||
version,
|
version,
|
||||||
|
suffix,
|
||||||
release,
|
release,
|
||||||
opts.build,
|
opts.build,
|
||||||
opts.builder,
|
opts.builder,
|
||||||
|
@ -22,6 +22,16 @@ this option nor \fB\-\-version\fR are specified, then
|
|||||||
\fBbackportpackage\fR defaults to the current Ubuntu development
|
\fBbackportpackage\fR defaults to the current Ubuntu development
|
||||||
release.
|
release.
|
||||||
.TP
|
.TP
|
||||||
|
.B \-S \fISUFFIX\fR, \-\-suffix=\fISUFFIX\fR
|
||||||
|
Add the specified suffix to the version number when
|
||||||
|
backporting. \fBbackportpackage\fR will always append
|
||||||
|
~\fIDESTINATION\fR1 to the original version number, and if
|
||||||
|
\fISUFFIX\fR is specified, it is appended to that, to get version
|
||||||
|
numbers of the form
|
||||||
|
\fIORIGINAL_VERSION\fR~\fIDESTINATION\fR1\fISUFFIX\fR. If the
|
||||||
|
backported package is being uploaded to a PPA, then \fISUFFIX\fR
|
||||||
|
defaults to \fB~ppa1\fR, otherwise the default is blank.
|
||||||
|
.TP
|
||||||
.B \-b, \-\-build
|
.B \-b, \-\-build
|
||||||
Build the package with the specified builder before uploading. Note
|
Build the package with the specified builder before uploading. Note
|
||||||
for \fBpbuilder\fR(8) users: This assumes the common configuration,
|
for \fBpbuilder\fR(8) users: This assumes the common configuration,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user