Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2016-07-07 18:47:59 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2016-07-07 21:14:13 +0300
commit8f82a551da77e431fc56cb24e3553cd923563006 (patch)
tree9812e2c213acc0d50baf5da24c02905d8151a98f
parenta936f9396846da0c836135b473ac3f8daba2dac0 (diff)
Requiring a source-only package is an error
Also, make that check, and check for self-requires even if -okmissing=required-package is used.
-rwxr-xr-xcalm/package.py26
1 files changed, 17 insertions, 9 deletions
diff --git a/calm/package.py b/calm/package.py
index 571b22e..d1e79dd 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.DEBUG
+ 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: