public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20160705-1-g5ff865b
@ 2016-07-07 18:04 jturney
  0 siblings, 0 replies; only message in thread
From: jturney @ 2016-07-07 18:04 UTC (permalink / raw)
  To: cygwin-apps-cvs




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

commit 5ff865b263bedd6eb1ae167b584074a7e11be800
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Thu Jul 7 16:47:59 2016 +0100

    Requiring a source-only package is an error
    
    Also, make that check, and check for self-requires even if
    -okmissing=required-package is used.


Diff:
---
 calm/package.py |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/calm/package.py b/calm/package.py
index 571b22e..2ad2c7e 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -278,18 +278,26 @@ def validate_packages(args, packages):
     for p in sorted(packages.keys()):
         logging.debug("validating package '%s'" % (p))
 
-        if 'required-package' not in getattr(args, 'okmissing', []):
-            # all packages listed in requires must exist
-            if 'requires' in packages[p].hints:
-                for r in packages[p].hints['requires'].split():
-                    if r not in packages:
+        if 'requires' in packages[p].hints:
+            for r in packages[p].hints['requires'].split():
+
+                # a package should not appear in it's own requires
+                if r == p:
+                    lvl = logging.WARNING if p not in past_mistakes.self_requires else logging.INFO
+                    logging.log(lvl, "package '%s' requires itself" % (p))
+
+                # all packages listed in requires must exist (unless okmissing
+                # says that's ok)
+                if r not in packages:
+                    if 'required-package' not in getattr(args, 'okmissing', []):
                         logging.error("package '%s' requires nonexistent package '%s'" % (p, r))
                         error = True
+                    continue
 
-                        # a package is should not appear in it's own requires
-                        if r == p:
-                            lvl = logging.WARNING if p not in past_mistakes.self_requires else logging.INFO
-                            logging.log(lvl, "package '%s' requires itself" % (p))
+                # requiring a source-only package makes no sense
+                if 'skip' in packages[r].hints:
+                    logging.error("package '%s' requires source-only package '%s'" % (p, r))
+                    error = True
 
         # if external-source is used, the package must exist
         if 'external-source' in packages[p].hints:


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

only message in thread, other threads:[~2016-07-07 18:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-07 18:04 [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20160705-1-g5ff865b jturney

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