diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2016-06-17 01:29:49 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2016-06-22 17:44:57 +0300 |
commit | c6c1b815b02daaffc9ff85cc6d8dd0d498cfe174 (patch) | |
tree | e6719b8d30cd7a420aa25d657c905cc50fedc78e | |
parent | 2bfb4654a43d765715a40e8b16d7e898e0a385e8 (diff) |
Check that packages have some versions, and warn if no curr version
Update tests appropriately:
- Remove naim test package, it's no longer valid
- Change to using arc package to test no sha512.sum behaviour
-rwxr-xr-x | calm/package.py | 8 | ||||
-rwxr-xr-x | test/test_calm.py | 2 | ||||
-rw-r--r-- | test/testdata/process_arch/rel_area.expected | 3 | ||||
-rw-r--r-- | test/testdata/relarea/x86/release/naim/setup.hint | 5 |
4 files changed, 10 insertions, 8 deletions
diff --git a/calm/package.py b/calm/package.py index 7cdd987..514f386 100755 --- a/calm/package.py +++ b/calm/package.py @@ -397,6 +397,14 @@ def validate_packages(args, packages): if l in packages[p].hints: packages[p].stability[l] = packages[p].hints[l] + # the package must have some versions + if not packages[p].stability: + logging.error("package '%s' doesn't have any versions" % (p)) + error = True + # it's also probably a really good idea if a curr version exists + elif 'curr' not in packages[p].stability: + logging.warning("package '%s' doesn't have a curr version" % (p)) + # If, for every stability level, the install tarball is empty and there # is no source tarball, we should probably be marked obsolete if 'skip' not in packages[p].hints: diff --git a/test/test_calm.py b/test/test_calm.py index 60246d1..c872be6 100755 --- a/test/test_calm.py +++ b/test/test_calm.py @@ -285,7 +285,7 @@ class CalmTest(unittest.TestCase): # ensure sha512.sum files exist os.system("find testdata/relarea/x86 testdata/relarea/noarch -type d -exec sh -c 'cd {} ; sha512sum * >sha512.sum 2>/dev/null' \;") # should remove a sha512.sum file so that we test functioning when it's absent - os.unlink('testdata/relarea/x86/release/naim/sha512.sum') + os.unlink('testdata/relarea/x86/release/arc/sha512.sum') # remove !ready files os.system("find testdata/homes -name !ready -exec rm {} \;") diff --git a/test/testdata/process_arch/rel_area.expected b/test/testdata/process_arch/rel_area.expected index b147754..d697a10 100644 --- a/test/testdata/process_arch/rel_area.expected +++ b/test/testdata/process_arch/rel_area.expected @@ -9,7 +9,7 @@ 'sha512.sum'], 'x86': ['sha512.sum'], 'x86/release': ['sha512.sum'], - 'x86/release/arc': ['arc-4.32.7-10-src.tar.bz2', 'arc-4.32.7-10.tar.bz2', 'setup.hint', 'sha512.sum'], + 'x86/release/arc': ['arc-4.32.7-10-src.tar.bz2', 'arc-4.32.7-10.tar.bz2', 'setup.hint'], 'x86/release/base-cygwin': ['base-cygwin-3.6-1.tar.xz', 'base-cygwin-3.8-1.tar.xz', 'setup.hint', 'sha512.sum'], 'x86/release/corrupt': ['corrupt-2.0.0-1-src.tar.xz', 'corrupt-2.0.0-1.tar.xz', 'setup.hint', 'sha512.sum'], 'x86/release/cygwin': ['.this-should-be-ignored', @@ -52,7 +52,6 @@ 'x86/release/mDNSResponder/libdns_sd1': ['libdns_sd1-379.32.1-1.tar.bz2', 'setup.hint', 'sha512.sum'], 'x86/release/mingw64-i686-binutils': ['setup.hint', 'sha512.sum'], 'x86/release/mingw64-i686-binutils/mingw64-i686-binutils-debuginfo': ['setup.hint', 'sha512.sum'], - 'x86/release/naim': ['setup.hint'], 'x86/release/openssh': ['openssh-7.2p2-1-src.tar.xz', 'openssh-7.2p2-1.tar.xz', 'setup.hint', 'sha512.sum'], 'x86/release/proj': ['setup.hint', 'sha512.sum'], 'x86/release/proj/libproj-devel': ['setup.hint', 'sha512.sum'], diff --git a/test/testdata/relarea/x86/release/naim/setup.hint b/test/testdata/relarea/x86/release/naim/setup.hint deleted file mode 100644 index 7de6e7b..0000000 --- a/test/testdata/relarea/x86/release/naim/setup.hint +++ /dev/null @@ -1,5 +0,0 @@ -category: Net -requires: -sdesc: "Console AIM, ICQ, IRC, and Lily client" -ldesc: " naim is a console client for AOL Instant Messenger (AIM), -AOL I Seek You (ICQ), Internet Relay Chat (IRC), and The lily CMC." |