public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon Turney <jturney@sourceware.org>
To: cygwin-apps-cvs@sourceware.org
Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20230209-82-g06cbd1c
Date: Wed,  3 Apr 2024 13:03:14 +0000 (GMT)	[thread overview]
Message-ID: <20240403130315.19FAA3846424@sourceware.org> (raw)




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")


                 reply	other threads:[~2024-04-03 13:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240403130315.19FAA3846424@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-apps-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).