From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18100 invoked by alias); 27 Jun 2016 13:54:02 -0000 Mailing-List: contact cygwin-apps-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-apps-cvs-owner@sourceware.org Received: (qmail 18072 invoked by uid 9795); 27 Jun 2016 13:54:02 -0000 Date: Mon, 27 Jun 2016 13:54:00 -0000 Message-ID: <20160627135402.18033.qmail@sourceware.org> From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 04684104a172dc7a2d3d52d2667881922ef097d0 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: ba688d6c07b1cfe410dd6063882ee757c549992f X-Git-Newrev: 04684104a172dc7a2d3d52d2667881922ef097d0 X-SW-Source: 2016-q2/txt/msg00029.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=04684104a172dc7a2d3d52d2667881922ef097d0 commit 04684104a172dc7a2d3d52d2667881922ef097d0 Author: Jon Turney Date: Sun Jun 26 13:39:22 2016 +0100 Permit the upload of a compressed empty file as a package file Permit the upload of a compressed empty file as a package file Adjust a test pacakge to exercise that case https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=411fe5b272ffd1a678c83b4f8f32a52ac79d8778 commit 411fe5b272ffd1a678c83b4f8f32a52ac79d8778 Author: Jon Turney Date: Fri Jun 24 14:49:11 2016 +0100 Uniquify requires: in setup.ini https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=28e8934c71f5a7d0445fadf3840db28c63e525d3 commit 28e8934c71f5a7d0445fadf3840db28c63e525d3 Author: Jon Turney Date: Fri Jun 24 14:23:02 2016 +0100 Check packages which share the same source package are all at the same version Report the offending packages if they aren't listed as past mistakes Diff: --- calm/package.py | 12 ++++++---- calm/uploads.py | 22 +++++++++++-------- .../testpackage2-subpackage-1.0-1.tar.bz2 | Bin 195 -> 14 bytes test/testdata/uploads/pkglist.expected | 2 +- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/calm/package.py b/calm/package.py index 088da76..571b22e 100755 --- a/calm/package.py +++ b/calm/package.py @@ -502,7 +502,7 @@ def validate_packages(args, packages): out.append("%s (%s)" % (v, ','.join(versions[v]))) most_common = False - lvl = logging.INFO + lvl = logging.DEBUG if source_p not in past_mistakes.nonunique_versions: lvl = logging.ERROR error = True @@ -581,11 +581,13 @@ def write_setup_ini(args, packages, arch): category = ' '.join(map(upper_first_character, packages[p].hints['category'].split())) print("category: %s" % category, file=f) + # uniquify and sort requires + requires = set() if 'requires' in packages[p].hints: - # for historical reasons, empty requires are suppressed - requires = packages[p].hints['requires'] - if requires: - print("requires: %s" % requires, file=f) + requires = set(packages[p].hints['requires'].split()) + # for historical reasons, empty requires are suppressed + if requires: + print("requires: %s" % ' '.join(sorted(requires)), file=f) # write tarfile lines for each stability level for level in ['curr', 'prev', 'test']: diff --git a/calm/uploads.py b/calm/uploads.py index 59c3d70..d2d75ee 100644 --- a/calm/uploads.py +++ b/calm/uploads.py @@ -170,15 +170,19 @@ def scan(m, all_packages, arch, args): # verify compressed archive files are valid if re.search(r'\.tar\.(bz2|gz|lzma|xz)$', f): valid = True - try: - # we need to extract all of an archive contents to validate - # it - with tarfile.open(fn) as a: - a.getmembers() - except Exception as e: - valid = False - logging.error("exception %s while reading %s" % (type(e).__name__, fn)) - logging.debug('', exc_info=True) + + # accept a compressed empty file, even though it isn't a valid + # compressed archive + if os.path.getsize(fn) > 32: + try: + # we need to extract all of an archive contents to validate + # it + with tarfile.open(fn) as a: + a.getmembers() + except Exception as e: + valid = False + logging.error("exception %s while reading %s" % (type(e).__name__, fn)) + logging.debug('', exc_info=True) if not valid: files.remove(f) diff --git a/test/testdata/homes/Blooey McFooey/x86/release/testpackage2/testpackage2-subpackage/testpackage2-subpackage-1.0-1.tar.bz2 b/test/testdata/homes/Blooey McFooey/x86/release/testpackage2/testpackage2-subpackage/testpackage2-subpackage-1.0-1.tar.bz2 index a1145fb..b56f3b9 100644 Binary files a/test/testdata/homes/Blooey McFooey/x86/release/testpackage2/testpackage2-subpackage/testpackage2-subpackage-1.0-1.tar.bz2 and b/test/testdata/homes/Blooey McFooey/x86/release/testpackage2/testpackage2-subpackage/testpackage2-subpackage-1.0-1.tar.bz2 differ diff --git a/test/testdata/uploads/pkglist.expected b/test/testdata/uploads/pkglist.expected index bbe52b0..695aa09 100644 --- a/test/testdata/uploads/pkglist.expected +++ b/test/testdata/uploads/pkglist.expected @@ -9,6 +9,6 @@ 'ldesc': '"A test subpackage"', 'category': 'Devel', 'external-source': 'testpackage'}), - 'testpackage2-subpackage': Package('x86/release/testpackage2/testpackage2-subpackage', {'testpackage2-subpackage-1.0-1.tar.bz2': Tar('aff488008bee3486e25b539fe6ccd1397bd3c5c0ba2ee2cf34af279554baa195af7493ee51d6f8510735c9a2ea54436d776a71e768165716762aec286abbbf83', 195, False)}, {'sdesc': '"A test subpackage 2"', + 'testpackage2-subpackage': Package('x86/release/testpackage2/testpackage2-subpackage', {'testpackage2-subpackage-1.0-1.tar.bz2': Tar('6de201dfed1d45412509c65deb34690dc2d09c6aafccfe491fd2f440f92842b9c755b61dc7bcdd4cc0c9f18cf46c2b3a1241e99c4c2a33fff5555e7b2f0b6348', 14, True)}, {'sdesc': '"A test subpackage 2"', 'ldesc': '"A test subpackage 2"', 'category': 'Devel'})}