Public bug reported: Hi,
sometimes it is important to have a larger version number than in the target release, so an option to override (~ubuntu or ~debian) to something larger might be needed. Here's the patch that adds an -p,--prefix option to backportpackage: ``` --- /usr/bin/backportpackage 2017-06-13 11:14:14.000000000 +0200 +++ /home/ondrej/bin/backportpackage 2017-07-06 14:13:37.022244568 +0200 @@ -83,6 +83,10 @@ def parse(args): metavar='SUFFIX', help='Suffix to append to version number ' '(default: ~ppa1 when uploading to a PPA)') + parser.add_option('-p', '--prefix', + metavar='PREFIX', + help='Prefix to prepend to version number ' + '(default: ~<distribution> (debian or ubuntu)') parser.add_option('-b', '--build', default=False, action='store_true', @@ -221,14 +225,16 @@ def find_package(mirror, workdir, packag return srcpkg -def get_backport_version(version, suffix, upload, release): +def get_backport_version(version, suffix, upload, release, prefix): distribution = codename_to_distribution(release) if not distribution: error('Unknown release codename %s' % release) series = Distribution(distribution.lower()).\ getSeries(name_or_version=release) - backport_version = version + ('~%s%s.1' % (distribution.lower(), series.version)) + if prefix is None: + prefix = '~%s' % (distribution.lower()) + backport_version = version + ('%s%s.1' % (prefix, series.version)) if suffix is not None: backport_version += suffix elif upload and upload.startswith('ppa:'): @@ -308,7 +314,7 @@ def orig_needed(upload, workdir, pkg): def do_backport(workdir, pkg, suffix, close, release, release_pocket, build, - builder, update, upload, keyid, prompt): + builder, update, upload, keyid, prompt, prefix): dirname = '%s-%s' % (pkg.source, release) srcdir = os.path.join(workdir, dirname) @@ -321,7 +327,7 @@ def do_backport(workdir, pkg, suffix, cl pkg.unpack(dirname) bp_version = get_backport_version(pkg.version.full_version, suffix, - upload, release) + upload, release, prefix) old_version = get_old_version(pkg.source, release) bp_dist = get_backport_dist(release, release_pocket) @@ -413,7 +419,8 @@ def main(args): opts.update, opts.upload, opts.keyid, - opts.prompt) + opts.prompt, + opts.prefix) except DownloadError as e: error(str(e)) finally: ``` ** Affects: ubuntu-dev-tools (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1702677 Title: Add an option to override version prefix (~ubuntu) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ubuntu-dev-tools/+bug/1702677/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs