public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20230209-82-g06cbd1c
@ 2024-04-03 13:03 Jon Turney
  0 siblings, 0 replies; only message in thread
From: Jon Turney @ 2024-04-03 13:03 UTC (permalink / raw)
  To: cygwin-apps-cvs




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=06cbd1c6d571b38511b5fdb02fd1174662ddec4e

commit 06cbd1c6d571b38511b5fdb02fd1174662ddec4e
Author: Jon Turney <jon.turney@dronecode.org.uk>
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 <jon.turney@dronecode.org.uk>
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")


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-03 13:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-03 13:03 [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20230209-82-g06cbd1c Jon Turney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).