[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20190530-52-ge10575b

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=e10575b0572fa0e82082c2f1133745a99a9228da

commit e10575b0572fa0e82082c2f1133745a99a9228da
Author: Jon Turney <[email protected]>
Date:   Wed Jul 10 17:57:29 2019 +0100

    Don't assume a binary package exists for uploads
    
    As written, this assumes a binary package exist for anything uploaded,
    which fails when only a source pacakge exists.
    
    This simple fix prevents replacement hint uploading from working, so
    something more sophisticated might be needed.

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

commit c19eb253d32f1bb2789b8b6108e9314354be0b37
Author: Jon Turney <[email protected]>
Date:   Fri Jul 5 19:01:00 2019 +0100

    Always mark source packages as skip


Diff:
---
 calm/package.py                        |   11 ++++++-----
 test/testdata/uploads/pkglist.expected |    2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/calm/package.py b/calm/package.py
index ccca563..842bb31 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -237,10 +237,8 @@ def read_package_dir(packages, basedir, dirpath, files, remove=[], upload=False)
     # read package
     result = False
     for kind in Kind:
-        # always create binary packages when uploading to allow replacement
-        # hints, otherwise, only create a package if there's archives for it to
-        # contain
-        if fl[kind] or (upload and kind == Kind.binary):
+        # only create a package if there's archives for it to contain
+        if fl[kind]:
             result = read_one_package(packages, p, relpath, dirpath, fl[kind] + fl['all'], remove, kind) or result
 
     # warn about unexpected files, including tarfiles which don't match the
@@ -411,7 +409,10 @@ def read_one_package(packages, p, relpath, dirpath, files, remove, kind):
     packages[pn].tars = actual_tars
     packages[pn].hints = hints
     packages[pn].pkgpath = pkgpath
-    packages[pn].skip = any(['skip' in version_hints[vr] for vr in version_hints])
+    if kind == Kind.source:
+        packages[pn].skip = True
+    else:
+        packages[pn].skip = any(['skip' in version_hints[vr] for vr in version_hints])
     packages[pn].kind = kind
     # since we are kind of inventing the source package names, and don't
     # want to report them, keep track of the real name
diff --git a/test/testdata/uploads/pkglist.expected b/test/testdata/uploads/pkglist.expected
index 5595a50..a928e8d 100644
--- a/test/testdata/uploads/pkglist.expected
+++ b/test/testdata/uploads/pkglist.expected
@@ -13,7 +13,7 @@
                     'Bézier."',
            'category': 'Devel',
            'requires': 'cygwin',
-           'depends': 'cygwin'}}, {}, False),
+           'depends': 'cygwin'}}, {}, True),
  'testpackage-subpackage': Package('testpackage/testpackage-subpackage', {'1.0-1': {'testpackage-subpackage-1.0-1.tar.bz2': Tar('testpackage-subpackage-1.0-1.tar.bz2', 'x86/release/testpackage/testpackage-subpackage', 'aff488008bee3486e25b539fe6ccd1397bd3c5c0ba2ee2cf34af279554baa195af7493ee51d6f8510735c9a2ea54436d776a71e768165716762aec286abbbf83', 195, False)}}, {'1.0-1': {'sdesc': '"A test subpackage"',
            'ldesc': '"A test subpackage"',
            'category': 'Devel',
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.