[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20160705-1-g5ff865b
jturney@sourceware.org
jturney@sourceware.org
Thu Jul 7 18:04:00 GMT 2016
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:
More information about the Cygwin-apps-cvs
mailing list