From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126101 invoked by alias); 7 Apr 2017 10:40:52 -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 126076 invoked by uid 9795); 7 Apr 2017 10:40:52 -0000 Date: Fri, 07 Apr 2017 10:40:00 -0000 Message-ID: <20170407104051.126024.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-56-gfe66fcd X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 2c3912b9ef9ba9c3601681c6a4e65f3bc6aa8e47 X-Git-Newrev: fe66fcdabbefb3d925226e2fac2aa1e0e6c13abf X-SW-Source: 2017-q2/txt/msg00000.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=fe66fcdabbefb3d925226e2fac2aa1e0e6c13abf commit fe66fcdabbefb3d925226e2fac2aa1e0e6c13abf Author: Jon Turney Date: Thu Apr 6 19:26:20 2017 +0100 Downgrade 'validating package' log message which occurs a lot https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=04f5caf8c1c169d0f0c80a6df0bfae1d3592b5e0 commit 04f5caf8c1c169d0f0c80a6df0bfae1d3592b5e0 Author: Jon Turney Date: Thu Apr 6 13:02:22 2017 +0100 Warn about setup.hint in uploads https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=a0f957c7f24fa0492a5149ce6119e2418540fc89 commit a0f957c7f24fa0492a5149ce6119e2418540fc89 Author: Jon Turney Date: Wed Apr 5 20:31:23 2017 +0100 Clean setup.hint files which aren't used by any version Should be controlled by --dry-run, but isn't We avoid doing this for uploads, since setup.hint uploads are treated specially, to allow the hint to be changed https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=d752429b9a02d32305c46ca13b90ef65fd27eb01 commit d752429b9a02d32305c46ca13b90ef65fd27eb01 Author: Jon Turney Date: Thu Apr 6 12:44:13 2017 +0100 Remove old expected hints unused by test_hint_parser Diff: --- calm/package.py | 10 ++++++++-- calm/uploads.py | 6 +++++- test/testdata/hints/x86/release/naim/expected | 6 ------ .../hints/x86/release/proj/proj-debuginfo/expected | 5 ----- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/calm/package.py b/calm/package.py index 5d58ddc..8ee68bc 100755 --- a/calm/package.py +++ b/calm/package.py @@ -149,7 +149,7 @@ def clean_hints(p, hints, strict_lvl, warnings): # # read a single package # -def read_package(packages, basedir, dirpath, files, strict=False, remove=[]): +def read_package(packages, basedir, dirpath, files, strict=False, remove=[], upload=False): strict_lvl = logging.ERROR if strict else logging.WARNING relpath = os.path.relpath(dirpath, basedir) warnings = False @@ -170,6 +170,7 @@ def read_package(packages, basedir, dirpath, files, strict=False, remove=[]): # read setup.hint legacy = 'setup.hint' in files + legacy_used = False if legacy: hints = read_hints(p, os.path.join(dirpath, 'setup.hint'), hint.setup) if not hints: @@ -295,6 +296,7 @@ def read_package(packages, basedir, dirpath, files, strict=False, remove=[]): elif legacy: # otherwise, use setup.hint pvr_hint = hints + legacy_used = True else: # it's an error to not have either a setup.hint or a pvr.hint logging.error("package %s has packages for version %s, but no %s or setup.hint" % (p, vr, hint_fn)) @@ -313,6 +315,10 @@ def read_package(packages, basedir, dirpath, files, strict=False, remove=[]): logging.log(strict_lvl, "unexpected files in %s: %s" % (p, ', '.join(files))) warnings = True + if not upload and legacy and not legacy_used: + logging.warning("package '%s' has a setup.hint which no version uses, removing it" % (p)) + os.unlink(os.path.join(dirpath, 'setup.hint')) + packages[p].version_hints = version_hints packages[p].override_hints = override_hints packages[p].legacy_hints = hints @@ -376,7 +382,7 @@ def validate_packages(args, packages): error = False for p in sorted(packages.keys()): - logging.debug("validating package '%s'" % (p)) + logging.log(5, "validating package '%s'" % (p)) for (v, hints) in packages[p].version_hints.items(): if 'requires' in hints: diff --git a/calm/uploads.py b/calm/uploads.py index 15a6c3c..d9a172d 100644 --- a/calm/uploads.py +++ b/calm/uploads.py @@ -169,6 +169,10 @@ def scan(m, all_packages, arch, args): files.remove(f) continue + # warn about legacy setup.hint uploads + if f == 'setup.hint': + logging.warning("'%s' seen, please update to cygport >= 0.23.0" % fn) + # verify compressed archive files are valid if re.search(r'\.tar\.(bz2|gz|lzma|xz)$', f): valid = True @@ -214,7 +218,7 @@ def scan(m, all_packages, arch, args): # read and validate package if files: # strict means we consider warnings as fatal for upload - if package.read_package(packages, m.homedir(), dirpath, files, strict=True, remove=removed_files): + if package.read_package(packages, m.homedir(), dirpath, files, strict=True, remove=removed_files, upload=True): error = True # always consider timestamp as checked during a dry-run, so it is never diff --git a/test/testdata/hints/x86/release/naim/expected b/test/testdata/hints/x86/release/naim/expected deleted file mode 100644 index 9f7710c..0000000 --- a/test/testdata/hints/x86/release/naim/expected +++ /dev/null @@ -1,6 +0,0 @@ -{'category': 'Net', - 'requires': '', - 'sdesc': '"Console AIM, ICQ, IRC, and Lily client"', - 'ldesc': '" naim is a console client for AOL Instant Messenger (AIM),\n' - 'AOL I Seek You (ICQ), Internet Relay Chat (IRC), and The lily CMC."', - 'parse-warnings': ['value for key ldesc starts with quoted whitespace']} diff --git a/test/testdata/hints/x86/release/proj/proj-debuginfo/expected b/test/testdata/hints/x86/release/proj/proj-debuginfo/expected deleted file mode 100644 index 6af3a7b..0000000 --- a/test/testdata/hints/x86/release/proj/proj-debuginfo/expected +++ /dev/null @@ -1,5 +0,0 @@ -{'category': 'Debug', - 'requires': 'cygwin-debuginfo', - 'external-source': 'proj', - 'sdesc': '"Debug info for proj"', - 'ldesc': '"This package contains files necessary for debugging the\nproj package with gdb."'}