diff options
-rwxr-xr-x | mgagnome | 31 |
1 files changed, 27 insertions, 4 deletions
@@ -354,7 +354,8 @@ class SpecFile(object): ('remove unneeded setup option', None, re.compile(r'^(?P<keeppre>\%setup -q )-n (?:\%name|\%\{name\})-(?:\%version|\%\{version\})(?P<keeppost>\n)', re.MULTILINE + re.IGNORECASE)), ('https for download.gnome.org', r'\g<keeppre>https://\g<keeppost>', re.compile(r'^(?P<keeppre>Source[0-9]*[ \t]*:[^\n]+)http://(?P<keeppost>download.gnome.org/[^\n]+\n)', re.MULTILINE + re.IGNORECASE)), ('download.gnome.org instead of ftp.gnome.org', r'\g<keeppre>https://download.gnome.org\g<keeppost>', re.compile(r'^(?P<keeppre>Source[0-9]*[ \t]*:[^\n]+)(?:ftp|http|https)://ftp.gnome.org/pub/GNOME(?P<keeppost>/[^\n]+\n)', re.MULTILINE + re.IGNORECASE)), - ('restrict what libraries are matched with major numbers', r'\g<keeppre>.\g<keeppost>', re.compile(r'^(?P<keeppre>%{_libdir}[^\n]+})(?P<keeppost>\*)$', re.MULTILINE)) + ('restrict what libraries are matched with major numbers', r'\g<keeppre>{,.*}', re.compile(r'^(?P<keeppre>%{_libdir}[^\n]+})\.?\*$', re.MULTILINE)), + ('make use of autopatch', r'%autopatch -p1', re.compile(r'^%apply_patches$', re.MULTILINE)), ] re_convert_br = [ ('remove py_requires', ('python',), re.compile(r'^\%(?:py_requires|\{py_requires\})[ \t]*\n', re.MULTILINE)), @@ -457,6 +458,7 @@ class SpecFile(object): # print re_patch_header.findall(data) # print re_patch_valid.findall(data) + # XXX -- apparently this is really inefficient with e.g. apache mo2 = re_prep_patches.search(data) patch_nrs_header = set([give_patchnr(mo) for mo in re_patch_header.finditer(data)]) patch_nrs_any = set([give_patchnr(mo) for mo in re_patch_any.finditer(data)]) @@ -1129,6 +1131,8 @@ def cmd_co(options, parser): with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor: if options.all: packages = ((package, package) for package in Downstream().packages) + elif len(options.package): + packages = ((package, package) for package in options.package) else: packages = ((l[0], "%s => %s" % (l[0], l[1])) for l in sorted(join_streams(auto_update=False))) @@ -1220,6 +1224,19 @@ def cmd_group_owner(options, parser): for line in sorted(get_output(source, maints, packages[group])): print(line) +def cmd_cleanup(options, parser): + root = os.path.expanduser(Downstream.PKGROOT) + + packages = set(Downstream().packages) + + dirs = set((o for o in os.listdir(root) if os.path.isdir(os.path.join(root, o)))) + + dirs = dirs - packages + + dirs = (o for o in dirs if os.path.exists(os.path.join(root, o, "SPECS"))) + + print("\n".join(sorted(dirs))) + def cmd_ls(options, parser): streams = join_streams(show_version=options.show_version, only_diff_version=options.diff) if options.sort: @@ -1431,8 +1448,8 @@ def cmd_clean_spec(options, parser): with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor: executor.map(cmd_clean_spec_multi, ((options, package) for package in packages)) # DEBUG: -# for package in packages: -# cmd_clean_spec_multi((options, package)) +# for package in packages: +# cmd_clean_spec_multi((options, package)) def cmd_package_new_version(options, parser): # Determine the package name @@ -1620,7 +1637,7 @@ def main(): subparser = subparsers.add_parser('clean-spec', help='clean specfile') subparser.add_argument("package", help="Package name", nargs='*') - subparser.add_argument("-d", action="store_true", dest="doit") + subparser.add_argument("-d", "-s", action="store_true", dest="doit", help="submit the changes") subparser.add_argument("-f", "--force", action="store_true") subparser.add_argument("-a", "--all", action="store_true", dest="all", help="checkout all Downstream packages") @@ -1638,6 +1655,7 @@ def main(): subparser = subparsers.add_parser('co', help='checkout all GNOME packages') subparser.add_argument("-a", "--all", action="store_true", dest="all", help="checkout all Downstream packages") + subparser.add_argument("package", help="Package name", nargs='*') subparser.set_defaults( func=cmd_co, all=False ) @@ -1704,6 +1722,11 @@ def main(): func=cmd_ls, upstream=False, show_version=False, diff=False ) + subparser = subparsers.add_parser('cleanup', help='cleanup pkg directory') + subparser.set_defaults( + func=cmd_cleanup + ) + subparser = subparsers.add_parser('patches', help='list all GNOME patches') subparser.add_argument("-p", "--path", action="store_true", dest="path", help="Show full path to patch") |