diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-05-18 20:21:25 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-05-19 16:26:54 +0300 |
commit | 848b5b6b430417d80d9b3b5c48de73bce3a66eb6 (patch) | |
tree | b7b1855e48783a32335177b761b491237773d440 | |
parent | 7bee1947e21d774a88ad7c9849b26d868d7daf72 (diff) |
Disallow build-depends: in install package hints
This means we can drop the less restrictive check that an install
package with a build-depends: hint has a sibling source.
-rwxr-xr-x | calm/hint.py | 2 | ||||
-rwxr-xr-x | calm/package.py | 9 | ||||
-rwxr-xr-x | test/test_calm.py | 3 | ||||
-rw-r--r-- | test/testdata/hints/noarch/release/test-e/test-e-1.0-1.expected | 2 | ||||
-rw-r--r-- | test/testdata/inifile/setup.ini.expected | 1 | ||||
-rw-r--r-- | test/testdata/process_arch/setup.ini.expected | 1 | ||||
-rwxr-xr-x | test/testdata/relarea/noarch/release/test-e/test-e-1.0-1.hint | 1 |
7 files changed, 5 insertions, 14 deletions
diff --git a/calm/hint.py b/calm/hint.py index e96d3e8..bbebfda 100755 --- a/calm/hint.py +++ b/calm/hint.py @@ -50,7 +50,6 @@ hintkeys[pvr] = { 'skip': 'noval', 'requires': 'optval', 'depends': 'optval', - 'build-depends': 'optval', 'obsoletes': 'optval', 'test': 'noval', # mark the package as a test version 'version': 'val', # version override @@ -63,6 +62,7 @@ hintkeys[pvr] = { hintkeys[spvr] = hintkeys[pvr].copy() hintkeys[spvr].update({ 'homepage': 'val', + 'build-depends': 'optval', }) hintkeys[override] = { diff --git a/calm/package.py b/calm/package.py index e705803..1a34656 100755 --- a/calm/package.py +++ b/calm/package.py @@ -784,15 +784,6 @@ def validate_packages(args, packages): lvl = logging.WARNING logging.log(lvl, "package '%s' version '%s' has empty install tar file, but it's not in the _obsolete category" % (p, vr)) - # the presence of build-depends only makes sense if this is a source - # package, or it has a sibling source package, with which is shares hints - if packages[p].kind != Kind.source: - for vr in packages[p].version_hints: - if 'build-depends' in packages[p].version_hints[vr]: - if 'external-source' in packages[p].version_hints[vr]: - logging.error("package '%s' version '%s' has build-depends but isn't a source package" % (p, vr)) - error = True - # make another pass to verify a source tarfile exists for every install # tarfile version for p in sorted(packages.keys()): diff --git a/test/test_calm.py b/test/test_calm.py index f4853cb..712c7bc 100755 --- a/test/test_calm.py +++ b/test/test_calm.py @@ -139,6 +139,9 @@ class CalmTest(unittest.TestCase): if f == 'override.hint': kind = hint.override name = 'override' + elif f.endswith('-src.hint'): + kind = hint.spvr + name = f[:-5] else: kind = hint.pvr name = f[:-5] diff --git a/test/testdata/hints/noarch/release/test-e/test-e-1.0-1.expected b/test/testdata/hints/noarch/release/test-e/test-e-1.0-1.expected index e7414e7..f842f13 100644 --- a/test/testdata/hints/noarch/release/test-e/test-e-1.0-1.expected +++ b/test/testdata/hints/noarch/release/test-e/test-e-1.0-1.expected @@ -1 +1 @@ -OrderedDict([('category', 'Devel'), ('sdesc', '"test package E"'), ('build-depends', 'libtextcat-devel')]) +OrderedDict([('category', 'Devel'), ('sdesc', '"test package E"')]) diff --git a/test/testdata/inifile/setup.ini.expected b/test/testdata/inifile/setup.ini.expected index f5b6501..280c9f4 100644 --- a/test/testdata/inifile/setup.ini.expected +++ b/test/testdata/inifile/setup.ini.expected @@ -363,7 +363,6 @@ '2e47817b620a7dbfe6810d47aee0adbcdf4663dc57932bcc51fc4b9bcfafa00dbbc2bfbefb1692dd5f6cc5333f23aea324d7c4d9b2ca091b917811fcdb70ca1f\n' 'source: noarch/release/test-e/test-e-1.0-1-src.tar.xz 236 ' '2e47817b620a7dbfe6810d47aee0adbcdf4663dc57932bcc51fc4b9bcfafa00dbbc2bfbefb1692dd5f6cc5333f23aea324d7c4d9b2ca091b917811fcdb70ca1f\n' - 'build-depends: libtextcat-devel\n' '\n' '@ testpackage\n' 'sdesc: "A test package (stuff & other stuff)"\n' diff --git a/test/testdata/process_arch/setup.ini.expected b/test/testdata/process_arch/setup.ini.expected index ea487ef..8c5ec7f 100644 --- a/test/testdata/process_arch/setup.ini.expected +++ b/test/testdata/process_arch/setup.ini.expected @@ -352,7 +352,6 @@ '2e47817b620a7dbfe6810d47aee0adbcdf4663dc57932bcc51fc4b9bcfafa00dbbc2bfbefb1692dd5f6cc5333f23aea324d7c4d9b2ca091b917811fcdb70ca1f\n' 'source: noarch/release/test-e/test-e-1.0-1-src.tar.xz 236 ' '2e47817b620a7dbfe6810d47aee0adbcdf4663dc57932bcc51fc4b9bcfafa00dbbc2bfbefb1692dd5f6cc5333f23aea324d7c4d9b2ca091b917811fcdb70ca1f\n' - 'build-depends: libtextcat-devel\n' '\n' '@ testpackage\n' 'sdesc: "A test package"\n' diff --git a/test/testdata/relarea/noarch/release/test-e/test-e-1.0-1.hint b/test/testdata/relarea/noarch/release/test-e/test-e-1.0-1.hint index d151b15..e14c850 100755 --- a/test/testdata/relarea/noarch/release/test-e/test-e-1.0-1.hint +++ b/test/testdata/relarea/noarch/release/test-e/test-e-1.0-1.hint @@ -1,3 +1,2 @@ category: Devel sdesc: "test package E" -build-depends: libtextcat-devel |