[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20171008-10-gbb18b84

jturney-9JcytcrH/[email protected]
Newsgroups gmane.os.cygwin.cvs.apps
Message-ID <[email protected]>


https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=bb18b8449ae04431c1b88e53e08a3491c031e67a

commit bb18b8449ae04431c1b88e53e08a3491c031e67a
Author: Jon Turney <[email protected]>
Date:   Sun Nov 5 20:07:10 2017 +0000

    Fix test: stability level not being set correctly, when less than curr:
    
    When using a test: label in version hints (rather than specifying a test:
    version in override.hint), the test: stability level wasn't being assigned
    correctly, if it was a lower version than curr:

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=f24cdc3b76929626ea2e6dfe3b8c94744672ab0a

commit f24cdc3b76929626ea2e6dfe3b8c94744672ab0a
Author: Jon Turney <[email protected]>
Date:   Sun Nov 5 19:43:31 2017 +0000

    Remove some unneeded parts of previous commit


Diff:
---
 calm/package.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/calm/package.py b/calm/package.py
index 610671a..fc0d7f4 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -25,7 +25,7 @@
 # utilities for working with a package database
 #
 
-from collections import defaultdict, OrderedDict
+from collections import defaultdict
 import copy
 import difflib
 import hashlib
@@ -551,6 +551,14 @@ def validate_packages(args, packages):
                 if packages[p].override_hints[l] is not None:
                     packages[p].stability[l] = packages[p].override_hints[l]
 
+        l = 'test'
+        if l not in packages[p].stability:
+            for v in sorted(packages[p].vermap.keys(), key=lambda v: SetupVersion(v), reverse=True):
+                if 'test' in packages[p].version_hints[v]:
+                    packages[p].stability[l] = v
+                    packages[p].version_hints[v][l] = ''
+                    break
+
         # the package must have some versions
         if not packages[p].stability:
             logging.error("no versions at any stability level for package '%s'" % (p))
@@ -797,7 +805,7 @@ def write_setup_ini(args, packages, arch):
             # next put any other versions
             #
             # these [prev] or [test] sections are superseded by the final ones.
-            for i, version in enumerate(sorted(packages[p].vermap.keys(), key=lambda v: SetupVersion(v), reverse=True)):
+            for version in sorted(packages[p].vermap.keys(), key=lambda v: SetupVersion(v), reverse=True):
                 # ignore versions which should have been removed by stale
                 # package removal
                 if not (set(['install', 'source']) & set(packages[p].vermap[version])):
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.