From 53c85def533fd854dfca29f07cc8f084c5008406 Mon Sep 17 00:00:00 2001 From: Olav Vitters Date: Tue, 21 Apr 2020 20:34:44 +0200 Subject: add command line argument to change the package root --- mgagnome | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mgagnome b/mgagnome index 224b69c..29253c0 100755 --- a/mgagnome +++ b/mgagnome @@ -1058,6 +1058,7 @@ class Downstream(object): re_file = re.compile(r'^(?P.*)[_-](?:(?P([0-9]+[\.])*[0-9]+)-)?(?P([0-9]+[\.\-])*[0-9]+)\.(?P(?:tar\.|diff\.)?[a-z][a-z0-9]*)$') MEDIA="Core Release Source" + # PKGROOT will be overwritten (command line option) PKGROOT='~/pkgs' DISTRO=None SECTION=None @@ -1870,6 +1871,8 @@ def main(): parser.add_argument("-l", "--limit", type=argparse.FileType('r', 0), dest="limit_upstream", metavar="FILE", help="File containing upstream names") + parser.add_argument("-p", "--root", action="store", dest="PKGROOT", + help="Package root directory") parser.add_argument("-d", "--distro", action="store", dest="distro", help="Distribution release") parser.add_argument("--debug", action="store_true", dest="debug", @@ -1881,7 +1884,7 @@ def main(): subparser.add_argument("-s", "--submit", action="store_true", dest="submit", help="Increase version for stable upgrades and submit") subparser.set_defaults( - func=cmd_check_latest, submit=False, debug=False + func=cmd_check_latest, submit=False, debug=False, PKGROOT="~/pkgs" ) subparser = subparsers.add_parser('check-prep', help='check prep phase') @@ -2018,8 +2021,9 @@ def main(): if not hasattr(options, 'submit'): options.submit = not options.distro + Downstream.PKGROOT=options.PKGROOT if options.distro: - Downstream.PKGROOT = os.path.join('~/pkgs', options.distro) + Downstream.PKGROOT = os.path.join(options.PKGROOT, options.distro) Downstream.MEDIA = "Core Release {0} Source,Core {0} Updates Source,Core {0} Updates Testing Source".format(options.distro) Downstream.DISTRO = options.distro -- cgit v1.2.1