From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11344 invoked by alias); 10 Apr 2017 12:40:29 -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 11313 invoked by uid 9795); 10 Apr 2017 12:40:29 -0000 Date: Mon, 10 Apr 2017 12:40:00 -0000 Message-ID: <20170410124029.11287.qmail@sourceware.org> From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20160705-61-gece907f X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 6a9ff000cc6c882f37d5b33c8392fca8b2a9e459 X-Git-Newrev: ece907f71b7148b0eb1ad207a32eb6408d2d4940 X-SW-Source: 2017-q2/txt/msg00005.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=ece907f71b7148b0eb1ad207a32eb6408d2d4940 commit ece907f71b7148b0eb1ad207a32eb6408d2d4940 Author: Jon Turney Date: Sun Apr 9 18:39:21 2017 +0100 Improve 'should be categorized obsolete' test to apply to each version There are some ligitimate cases of this condition, so this is only logged at info severity. Diff: --- calm/package.py | 27 +++++++++++---------------- 1 files changed, 11 insertions(+), 16 deletions(-) diff --git a/calm/package.py b/calm/package.py index 2891e0d..a2ec6f8 100755 --- a/calm/package.py +++ b/calm/package.py @@ -561,23 +561,15 @@ def validate_packages(args, packages): packages[p].best_version = None error = True - # If, for every stability level, the install tarball is empty and there - # is no source tarball, we should probably be marked obsolete + # If the install tarball is empty and there is no source tarball, we + # should probably be marked obsolete if not packages[p].skip: - if not obsolete: - has_something = False - - for l in ['test', 'curr', 'prev']: - if l in packages[p].stability: - v = packages[p].stability[l] - if 'source' in packages[p].vermap[v]: - has_something = True - elif 'install' in packages[p].vermap[v]: - if not packages[p].tars[packages[p].vermap[v]['install']].is_empty: - has_something = True - - if not has_something: - logging.warning("package '%s' has empty install tar file and no source for all levels, but it's not in the _obsolete category" % (p)) + for vr in packages[p].version_hints: + if '_obsolete' not in packages[p].version_hints[vr].get('category', ''): + if 'source' not in packages[p].vermap[vr]: + if 'install' in packages[p].vermap[vr]: + if packages[p].tars[packages[p].vermap[vr]['install']].is_empty: + logging.info("package '%s' version '%s' has empty install tar file and no source, but it's not in the _obsolete category" % (p, vr)) # make another pass to verify a source tarfile exists for every install # tarfile version @@ -920,6 +912,9 @@ def mark_package_fresh(packages, p, v): return # unless the install tarfile is empty ... + if 'install' not in packages[p].vermap[v]: + return + if packages[p].tars[packages[p].vermap[v]['install']].is_empty: return