From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60921 invoked by alias); 7 May 2017 17:58:16 -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 60895 invoked by uid 9795); 7 May 2017 17:58:16 -0000 Date: Sun, 07 May 2017 17:58:00 -0000 Message-ID: <20170507175815.60859.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-78-g1df741c X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: de1c67659c16cf63ba57695c4c2ab49a35ca72f7 X-Git-Newrev: 1df741ca99b61726efabde01557f5a55be1da8e3 X-SW-Source: 2017-q2/txt/msg00022.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=1df741ca99b61726efabde01557f5a55be1da8e3 commit 1df741ca99b61726efabde01557f5a55be1da8e3 Author: Jon Turney Date: Sun May 7 18:21:49 2017 +0100 Check for and fix pep8 E226 missing whitespace around arithmetic operator https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=1682f797b9eb5b95831bec85e889dd775c4a1f6a commit 1682f797b9eb5b95831bec85e889dd775c4a1f6a Author: Jon Turney Date: Sun May 7 18:17:24 2017 +0100 Remove lingering reference to setup.hint in 'unknown construct' error message Update tests appropriately https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=d960f8540483804880a5f2d79636a3af6122abbe commit d960f8540483804880a5f2d79636a3af6122abbe Author: Jon Turney Date: Sun May 7 18:15:25 2017 +0100 Forgive timestamp anomaly with opencv Update TODO with an idea for a better way of doing this https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=ba2708843ab9cc7eb1df178d7de979773278b744 commit ba2708843ab9cc7eb1df178d7de979773278b744 Author: Jon Turney Date: Sun May 7 18:03:05 2017 +0100 Don't crash when package changes from source-only to installable A source-only package marked with skip: is not required to have any other hints, so they may not have any category: specified. Don't crash if some version doesn't have a category: hint. This still doesn't work well: if the installable package is now depended on, calm will then complain that something "requires source-only package", but at least it doesn't crash Diff: --- TODO | 1 + calm/calm.py | 6 +++--- calm/compare-arches | 2 +- calm/fix-missing-cygwin-dep.py | 2 +- calm/hint.py | 8 ++++---- calm/mkmaintdir | 2 +- calm/mksetupini.py | 2 +- calm/package.py | 4 ++-- calm/past_mistakes.py | 1 + calm/pkg2html.py | 2 +- calm/uploads.py | 4 ++-- pep8 | 2 +- test/testdata/hints/x86/release/invalid/expected | 2 +- 13 files changed, 20 insertions(+), 18 deletions(-) diff --git a/TODO b/TODO index 74a729d..e82b165 100644 --- a/TODO +++ b/TODO @@ -8,3 +8,4 @@ * check packages for path collisions * don't do upload authorization by path, then remove unique path constraint * mksetupini should be able to verify requires: contains valid package names using a provided list of packages (or a cygwin-pkg-maint file?) +* certain checks where we have past_mistakes to forgive should instead have a forgive: key in override.hint to disable? diff --git a/calm/calm.py b/calm/calm.py index e8fb9a2..c0558ca 100755 --- a/calm/calm.py +++ b/calm/calm.py @@ -514,8 +514,8 @@ def do_daemon(args, state): # we wake at a 10 minute offset from the next 240 minute boundary # (i.e. at :10 past every fourth hour) to check the state of the # release area, in case someone has ninja-ed in a change there... - interval = 240*60 - offset = 10*60 + interval = 240 * 60 + offset = 10 * 60 delay = interval - ((time.time() - offset) % interval) signal.alarm(int(delay)) @@ -561,7 +561,7 @@ def logging_setup(args): # setup logging to stdout, of WARNING messages or higher (INFO if verbose) ch = logging.StreamHandler(sys.stdout) - ch.setFormatter(logging.Formatter(os.path.basename(sys.argv[0])+': %(message)s')) + ch.setFormatter(logging.Formatter(os.path.basename(sys.argv[0]) + ': %(message)s')) if args.verbose: ch.setLevel(logging.INFO) else: diff --git a/calm/compare-arches b/calm/compare-arches index d2d6594..f5ffe76 100755 --- a/calm/compare-arches +++ b/calm/compare-arches @@ -125,6 +125,6 @@ if __name__ == "__main__": if args.verbose: logging.getLogger().setLevel(logging.INFO) - logging.basicConfig(format=os.path.basename(sys.argv[0])+': %(message)s') + logging.basicConfig(format=os.path.basename(sys.argv[0]) + ': %(message)s') main(args) diff --git a/calm/fix-missing-cygwin-dep.py b/calm/fix-missing-cygwin-dep.py index 2a9b3ab..b7c2c80 100755 --- a/calm/fix-missing-cygwin-dep.py +++ b/calm/fix-missing-cygwin-dep.py @@ -133,6 +133,6 @@ if __name__ == "__main__": if args.verbose: logging.getLogger().setLevel(logging.INFO) - logging.basicConfig(format=os.path.basename(sys.argv[0])+': %(message)s') + logging.basicConfig(format=os.path.basename(sys.argv[0]) + ': %(message)s') main(args) diff --git a/calm/hint.py b/calm/hint.py index 5a36901..bcdda95 100755 --- a/calm/hint.py +++ b/calm/hint.py @@ -150,7 +150,7 @@ def item_lexer(c): i = -1 lines = c.splitlines() - while i < len(lines)-1: + while i < len(lines) - 1: i = i + 1 o = lines[i] @@ -172,7 +172,7 @@ def item_lexer(c): # if the line contains an opening quote if '"' in o: # continue reading lines till closing quote - while i < len(lines)-1: + while i < len(lines) - 1: i = i + 1 # multi-line quoted text preserves any leading space used for # indentation, but removes any trailing space @@ -276,7 +276,7 @@ def hint_file_parse(fn, kind): # store the key:value hints[key] = value else: - errors.append("unknown setup construct '%s' at line %d" % (item, i)) + errors.append("unknown construct '%s' at line %d" % (item, i)) # for setup and pvr kinds, if 'skip' isn't present, 'category' and # 'sdesc' must be @@ -293,7 +293,7 @@ def hint_file_parse(fn, kind): # packages like to repeat the basic description in ldesc in every # subpackage, but add to sdesc to distinguish the subpackages) if 'ldesc' in hints: - if len(hints['sdesc']) > 2*len(hints['ldesc']): + if len(hints['sdesc']) > 2 * len(hints['ldesc']): warnings.append('sdesc is much longer than ldesc') # sort requires: as differences in ordering are uninteresting diff --git a/calm/mkmaintdir b/calm/mkmaintdir index cadeaa6..4d016d1 100755 --- a/calm/mkmaintdir +++ b/calm/mkmaintdir @@ -135,6 +135,6 @@ if __name__ == "__main__": if args.verbose: logging.getLogger().setLevel(logging.INFO) - logging.basicConfig(format=os.path.basename(sys.argv[0])+': %(message)s') + logging.basicConfig(format=os.path.basename(sys.argv[0]) + ': %(message)s') main(args) diff --git a/calm/mksetupini.py b/calm/mksetupini.py index 863a14b..e7337fe 100755 --- a/calm/mksetupini.py +++ b/calm/mksetupini.py @@ -113,7 +113,7 @@ def main(): if args.verbose: logging.getLogger().setLevel(logging.INFO) - logging.basicConfig(format=os.path.basename(sys.argv[0])+': %(message)s') + logging.basicConfig(format=os.path.basename(sys.argv[0]) + ': %(message)s') do_main(args) diff --git a/calm/package.py b/calm/package.py index ca48d2e..6ddb4a5 100755 --- a/calm/package.py +++ b/calm/package.py @@ -97,7 +97,7 @@ def read_packages(rel_area, arch): # helper function to compute sha512 for a particular file # (block_size should be some multiple of sha512 block size which can be efficiently read) -def sha512_file(fn, block_size=256*128): +def sha512_file(fn, block_size=256 * 128): sha512 = hashlib.sha512() with open(fn, 'rb') as f: @@ -647,7 +647,7 @@ def validate_packages(args, packages): for install_p in packages[source_p].is_used_by: # ignore obsolete packages - if any(['_obsolete' in packages[install_p].version_hints[vr]['category'] for vr in packages[install_p].version_hints]): + if any(['_obsolete' in packages[install_p].version_hints[vr].get('category', '') for vr in packages[install_p].version_hints]): continue # ignore runtime library packages, as we may keep old versions of diff --git a/calm/past_mistakes.py b/calm/past_mistakes.py index e24f152..5f63004 100644 --- a/calm/past_mistakes.py +++ b/calm/past_mistakes.py @@ -166,6 +166,7 @@ mtime_anomalies = [ 'libquadmath0', 'libssp0', 'libstdc++6', + 'opencv', # 2.4.11-1 was created when changed from source-only to install 'python-gtk2.0', 'python-gtk2.0-demo', 'python-gtk2.0-devel', diff --git a/calm/pkg2html.py b/calm/pkg2html.py index 70af62d..9b23a94 100755 --- a/calm/pkg2html.py +++ b/calm/pkg2html.py @@ -258,7 +258,7 @@ if __name__ == "__main__": if args.verbose: logging.getLogger().setLevel(logging.INFO) - logging.basicConfig(format=os.path.basename(sys.argv[0])+': %(message)s') + logging.basicConfig(format=os.path.basename(sys.argv[0]) + ': %(message)s') packages = package.read_packages(args.rel_area, args.arch) update_package_listings(args, packages, args.arch) diff --git a/calm/uploads.py b/calm/uploads.py index 29fc379..61a3d04 100644 --- a/calm/uploads.py +++ b/calm/uploads.py @@ -37,9 +37,9 @@ import time from . import package # reminders will be issued daily -REMINDER_INTERVAL = 60*60*24 +REMINDER_INTERVAL = 60 * 60 * 24 # reminders don't start to be issued until an hour after upload -REMINDER_GRACE = 60*60 +REMINDER_GRACE = 60 * 60 # a named tuple type to hold the result of scan ScanResult = namedtuple('ScanResult', 'error,packages,to_relarea,to_vault,remove_always,remove_success') diff --git a/pep8 b/pep8 index 0fc53ec..d52ae5b 100755 --- a/pep8 +++ b/pep8 @@ -1,2 +1,2 @@ #!/bin/sh -grep -s -l '^#!/usr/bin/env python' calm/* tests/* | xargs python3 -m pep8 --count --show-source --max-line-length=240 --ignore=E129,E226 +grep -s -l '^#!/usr/bin/env python' calm/* tests/* | xargs python3 -m pep8 --count --show-source --max-line-length=240 --ignore=E129 diff --git a/test/testdata/hints/x86/release/invalid/expected b/test/testdata/hints/x86/release/invalid/expected index ebcffb4..70f37d7 100644 --- a/test/testdata/hints/x86/release/invalid/expected +++ b/test/testdata/hints/x86/release/invalid/expected @@ -1,4 +1,4 @@ {'parse-errors': ['unknown key unknown-key at line 0', - "unknown setup construct 'invalid-construct' at line 1", + "unknown construct 'invalid-construct' at line 1", "required key 'category' missing", "required key 'sdesc' missing"]}