From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 19FAA3846424; Wed, 3 Apr 2024 13:03:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19FAA3846424 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712149395; bh=YC+z7kbnNKOHBXRiUHfDRHZzuEwHWsVKwIqeRU8dCSw=; h=To:Subject:Date:From:From; b=fKSUZU6CzU4AjZ81/w6K47IzI2bRiTLeg69+4mFhMk3omdzwd6VFKRpGJcPIOOuns BQZH9IcjZ3oydn2P2WBM4IEEdeWjWHGtzfmmRafQZmwj5MuFI0Sg3ZcQd5QeKrWF9C baGBF/LrLqEJnkBNBh48R/sv+ED8er3SXg1Y+ANo= To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20230209-82-g06cbd1c X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: bb2c299374c2e9d859c3d4016568dedf40327627 X-Git-Newrev: 06cbd1c6d571b38511b5fdb02fd1174662ddec4e Message-Id: <20240403130315.19FAA3846424@sourceware.org> Date: Wed, 3 Apr 2024 13:03:14 +0000 (GMT) From: Jon Turney List-Id: https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=06cbd1c6d571b38511b5fdb02fd1174662ddec4e commit 06cbd1c6d571b38511b5fdb02fd1174662ddec4e Author: Jon Turney Date: Tue Apr 2 16:05:29 2024 +0100 Fix package name checking in fix-requires-by-path Also add a bit of more verbose output, Also make it possible to run on just a named package https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=de29eed7b46b4144053cc54e8cfb3a45002c59cc commit de29eed7b46b4144053cc54e8cfb3a45002c59cc Author: Jon Turney Date: Tue Apr 2 16:03:44 2024 +0100 Clean up all empty directories in stagingdir Diff: --- calm/calm.py | 5 ++++- calm/fix-requires-by-path.py | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/calm/calm.py b/calm/calm.py index ab118ee..b13d78c 100755 --- a/calm/calm.py +++ b/calm/calm.py @@ -213,7 +213,10 @@ def process_maintainer_uploads(args, state, all_packages, m, basedir, desc, scru # clean up any empty directories if not args.dryrun: - utils.rmemptysubdirs(os.path.join(basedir, m.name)) + if scrub: + utils.rmemptysubdirs(os.path.join(basedir, m.name), depth=0) + else: + utils.rmemptysubdirs(os.path.join(basedir, m.name)) return success diff --git a/calm/fix-requires-by-path.py b/calm/fix-requires-by-path.py index 0efe087..3111e08 100644 --- a/calm/fix-requires-by-path.py +++ b/calm/fix-requires-by-path.py @@ -42,10 +42,6 @@ from . import hint def fix_one_hint(args, dirpath, hintfile, tf): pn = os.path.join(dirpath, hintfile) - # avoid pointlessly checking to add a self-dependency - if pn == args.requires: - return - hints = hint.hint_file_parse(pn, hint.pvr) hints.pop('parse-warnings', None) @@ -72,6 +68,7 @@ def fix_one_hint(args, dirpath, hintfile, tf): pass if ivp: + logging.info('found matching path in %s' % (tf)) requires = hints.get('requires', '').split() if args.requires not in requires: if args.replace and args.replace in requires: @@ -101,6 +98,18 @@ def fix_hints(args): if root.endswith('-src'): continue + pn = root.rsplit('-', 2)[0] + + # is pn in the list of packages (if specified)? + if args.package and (pn not in args.package): + continue + + # avoid pointlessly checking to add a self-dependency + if pn == args.requires: + return + + logging.info('Checking %s' % root) + fix_one_hint(args, dirpath, root + '.hint', f) # @@ -114,6 +123,7 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description='Add DEPATOM to requires: of packages which contain a file starting with PATH') parser.add_argument('path', metavar='PATH', help='regex of path to match') parser.add_argument('requires', metavar='DEPATOM', help='require to add') + parser.add_argument('package', metavar='PACKAGE', action='extend', nargs='*', help='packages to check') parser.add_argument('-v', '--verbose', action='count', dest='verbose', help='verbose output', default=0) parser.add_argument('--releasearea', action='store', metavar='DIR', help="release directory (default: " + relarea_default + ")", default=relarea_default, dest='relarea') parser.add_argument('--replace', action='store', metavar='DEPATOM', help="replace existing DEPATOM if present")