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>2020-06-07 17:19:34 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2020-06-07 19:07:11 +0300
commitd17f6f971ee1b20f585f66cd93f8ab0f1d1eba19 (patch)
tree2174c09a442b0f88a8c17d4b12873cf5a0d86032
parentf9774e4c02a87950752aebfc88184d75bfeffede (diff)
Teach check that requires: are satified to know about provides:
-rwxr-xr-xcalm/package.py16
-rw-r--r--test/testdata/hints/x86/release/base-cygwin/base-cygwin-3.8-1.expected2
-rw-r--r--test/testdata/htdocs.expected/summary/base-cygwin.html1
-rw-r--r--test/testdata/inifile/setup.ini.expected3
-rw-r--r--test/testdata/process_arch/setup.ini.expected3
-rw-r--r--test/testdata/relarea/x86/release/base-cygwin/base-cygwin-3.8-1.hint2
6 files changed, 21 insertions, 6 deletions
diff --git a/calm/package.py b/calm/package.py
index fb60d39..a1fed9a 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -486,6 +486,14 @@ def validate_packages(args, packages):
if packages is None:
return False
+ # build the set of valid things to requires:
+ valid_requires = set()
+ for p in packages:
+ valid_requires.add(p)
+ for hints in packages[p].version_hints.values():
+ valid_requires.update(hints.get('provides', '').split())
+
+ # perform various package validations
for p in sorted(packages.keys()):
logging.log(5, "validating package '%s'" % (p))
has_requires = False
@@ -517,14 +525,14 @@ def validate_packages(args, packages):
# all packages listed in a hint must exist (unless the
# disable-check option says that's ok)
- if r not in packages:
+ if r not in valid_requires:
if okmissing not in getattr(args, 'disable_check', []):
- logging.error("package '%s' version '%s' %s nonexistent or errored package '%s'" % (p, v, c, r))
+ logging.error("package '%s' version '%s' %s: '%s', but nothing satisfies that" % (p, v, c, r))
error = True
continue
# hint referencing a source-only package makes no sense
- if packages[r].skip:
+ if r in packages and packages[r].skip:
logging.error("package '%s' version '%s' %s source-only package '%s'" % (p, v, c, r))
error = True
@@ -532,7 +540,7 @@ def validate_packages(args, packages):
if 'external-source' in hints:
e = hints['external-source']
if e not in packages:
- logging.error("package '%s' version '%s' refers to nonexistent or errored external-source '%s'" % (p, v, e))
+ logging.error("package '%s' version '%s' refers to non-existent or errored external-source '%s'" % (p, v, e))
error = True
# If package A is obsoleted by package B, B should appear in the
diff --git a/test/testdata/hints/x86/release/base-cygwin/base-cygwin-3.8-1.expected b/test/testdata/hints/x86/release/base-cygwin/base-cygwin-3.8-1.expected
index 7505632..cac431d 100644
--- a/test/testdata/hints/x86/release/base-cygwin/base-cygwin-3.8-1.expected
+++ b/test/testdata/hints/x86/release/base-cygwin/base-cygwin-3.8-1.expected
@@ -1,5 +1,5 @@
{'sdesc': '"Initial base installation helper script"',
'ldesc': '"Initial base installation helper script."',
'category': 'Base',
- 'requires': '',
+ 'requires': 'cygwin-api0_291',
'parse-warnings': ["sdesc ends with '.'"]}
diff --git a/test/testdata/htdocs.expected/summary/base-cygwin.html b/test/testdata/htdocs.expected/summary/base-cygwin.html
index 9dbd8fa..5d14df3 100644
--- a/test/testdata/htdocs.expected/summary/base-cygwin.html
+++ b/test/testdata/htdocs.expected/summary/base-cygwin.html
@@ -13,6 +13,7 @@
<span class="detail">summary</span>: Initial base installation helper script<br><br>
<span class="detail">description</span>: Initial base installation helper script.<br><br>
<span class="detail">categories</span>: Base<br><br>
+<span class="detail">depends</span>: cygwin-api0_291<br><br>
<span class="detail">source package</span>: base-cygwin-src<br><br>
<span class="detail">maintainer(s)</span>: Corinna Vinschen
<span class="smaller">(Use <a href="/lists.html#cygwin">the mailing list</a> to report bugs or ask questions.
diff --git a/test/testdata/inifile/setup.ini.expected b/test/testdata/inifile/setup.ini.expected
index 4a350c6..bfb82f7 100644
--- a/test/testdata/inifile/setup.ini.expected
+++ b/test/testdata/inifile/setup.ini.expected
@@ -31,13 +31,16 @@
'sdesc: "Initial base installation helper script"\n'
'ldesc: "Initial base installation helper script."\n'
'category: Base\n'
+ 'requires: cygwin-api0_291\n'
'version: 3.8-1\n'
'install: x86/release/base-cygwin/base-cygwin-3.8-1.tar.xz 228 '
'e675b0ac4bc2c3e1c4971bc56d77b0cd53a9bdf5632873a235d7582e29dfd3e8a7bb04b28f6cdee3e6b3d14c25ed39392538e3f628a9bfda6c905646ebc3c225\n'
+ 'depends2: cygwin-api0_291\n'
'[prev]\n'
'version: 3.6-1\n'
'install: x86/release/base-cygwin/base-cygwin-3.6-1.tar.xz 228 '
'e675b0ac4bc2c3e1c4971bc56d77b0cd53a9bdf5632873a235d7582e29dfd3e8a7bb04b28f6cdee3e6b3d14c25ed39392538e3f628a9bfda6c905646ebc3c225\n'
+ 'depends2: \n'
'\n'
'@ corrupt\n'
'sdesc: "A corrupt package"\n'
diff --git a/test/testdata/process_arch/setup.ini.expected b/test/testdata/process_arch/setup.ini.expected
index f3d3534..26378a3 100644
--- a/test/testdata/process_arch/setup.ini.expected
+++ b/test/testdata/process_arch/setup.ini.expected
@@ -31,13 +31,16 @@
'sdesc: "Initial base installation helper script"\n'
'ldesc: "Initial base installation helper script."\n'
'category: Base\n'
+ 'requires: cygwin-api0_291\n'
'version: 3.8-1\n'
'install: x86/release/base-cygwin/base-cygwin-3.8-1.tar.xz 228 '
'e675b0ac4bc2c3e1c4971bc56d77b0cd53a9bdf5632873a235d7582e29dfd3e8a7bb04b28f6cdee3e6b3d14c25ed39392538e3f628a9bfda6c905646ebc3c225\n'
+ 'depends2: cygwin-api0_291\n'
'[prev]\n'
'version: 3.6-1\n'
'install: x86/release/base-cygwin/base-cygwin-3.6-1.tar.xz 228 '
'e675b0ac4bc2c3e1c4971bc56d77b0cd53a9bdf5632873a235d7582e29dfd3e8a7bb04b28f6cdee3e6b3d14c25ed39392538e3f628a9bfda6c905646ebc3c225\n'
+ 'depends2: \n'
'\n'
'@ corrupt\n'
'sdesc: "A corrupt package"\n'
diff --git a/test/testdata/relarea/x86/release/base-cygwin/base-cygwin-3.8-1.hint b/test/testdata/relarea/x86/release/base-cygwin/base-cygwin-3.8-1.hint
index f6f64b2..9586976 100644
--- a/test/testdata/relarea/x86/release/base-cygwin/base-cygwin-3.8-1.hint
+++ b/test/testdata/relarea/x86/release/base-cygwin/base-cygwin-3.8-1.hint
@@ -1,4 +1,4 @@
sdesc: "Initial base installation helper script."
ldesc: "Initial base installation helper script."
category: Base
-requires:
+requires: cygwin-api0_291