From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42232 invoked by alias); 19 Sep 2016 12:49:21 -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 42207 invoked by uid 9795); 19 Sep 2016 12:49:20 -0000 Date: Mon, 19 Sep 2016 12:49:00 -0000 Message-ID: <20160919124920.42175.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-23-g5893900 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 437f6ad4ddddd43a6c39ba6bd0e02ff2cf08cdaa X-Git-Newrev: 58939006d9020bd49503ae6586e5b1f9fafdd87b X-SW-Source: 2016-q3/txt/msg00037.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=58939006d9020bd49503ae6586e5b1f9fafdd87b commit 58939006d9020bd49503ae6586e5b1f9fafdd87b Author: Jon Turney Date: Sat Sep 17 20:03:06 2016 +0100 Tweak reporting of vaulting packages We count the number of packages vaulted, not files https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=d4c6f0be2acd3674f7f98a72bb8b45360b787326 commit d4c6f0be2acd3674f7f98a72bb8b45360b787326 Author: Jon Turney Date: Sat Sep 17 20:00:59 2016 +0100 Update TODO https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=8c620a22570401f910c75490b0d56c85489c6d7e commit 8c620a22570401f910c75490b0d56c85489c6d7e Author: Achim Gratz Date: Sat Sep 17 18:59:31 2016 +0100 Write human-readable time in addition to machine-readable timestamp * calm/package.py (write_setup_ini): In addition to the epoch timestamp write that time in a comment in human-readable form so that it can be more easily deciphered. Diff: --- TODO | 8 ++++---- calm/calm.py | 4 ++-- calm/package.py | 13 ++++++++----- test/test_calm.py | 2 ++ test/testdata/inifile/setup.ini.expected | 6 +++--- test/testdata/process_arch/setup.ini.expected | 6 +++--- 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/TODO b/TODO index 9c6b60b..991af0d 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,8 @@ -* per-package-version hint files (e.g. named .hint, or /.setup.hint inside tar file) -* automatically vault stuff which has dropped out of setup.ini -* more than 2 versions possible (and automatically vault 'old' versions, where we have some mechanism to explicity say what is old) +* more than 2 versions possible * automatically suppress 'empty source' packages with no deps from setup.ini ? * run more often, option to not do anything if no uploads (to avoid reading the release area if we don't need to), lockfile to avoid colliding runs -* work out some way to package it as a replacement for genini * use irkerd to report when calm failed due to an error? * upload a hash at the same time as package, and pass that through to setup.ini +* mksetupini should have an okmissing option for override.hint which names non-existent versions +* use ./setup.hint inside the tar file, avoiding all the hint/tar coherence problems +* mksetupini should write to stdout if --inifile not specified diff --git a/calm/calm.py b/calm/calm.py index 0d41602..4d5e371 100755 --- a/calm/calm.py +++ b/calm/calm.py @@ -107,7 +107,7 @@ def process(args): stale_to_vault = remove_stale_packages(args, packages) if stale_to_vault: for arch in common_constants.ARCHES + ['noarch']: - logging.info("vaulting %d old files for arch %s, which are no longer accessible by installer" % (len(stale_to_vault[arch]), arch)) + logging.info("vaulting %d old packages for arch %s, which are no longer accessible by installer" % (len(stale_to_vault[arch]), arch)) uploads.move_to_vault(args, stale_to_vault[arch]) else: return None @@ -218,7 +218,7 @@ def process(args): if args.stale: for arch in common_constants.ARCHES + ['noarch']: if stale_to_vault[arch]: - logging.info("vaulting %d old files for arch %s, which are no longer accessible by installer" % (len(stale_to_vault[arch]), arch)) + logging.info("vaulting %d old package for arch %s, which are no longer accessible by installer" % (len(stale_to_vault[arch]), arch)) uploads.move_to_vault(args, stale_to_vault[arch]) # for each arch diff --git a/calm/package.py b/calm/package.py index a5881e3..087e554 100755 --- a/calm/package.py +++ b/calm/package.py @@ -644,17 +644,20 @@ def write_setup_ini(args, packages, arch): with open(args.inifile, 'w') as f: os.fchmod(f.fileno(), 0o644) + tz = time.time() # write setup.ini header print(textwrap.dedent('''\ - # This file is automatically generated. If you edit it, your - # edits will be discarded next time the file is generated. - # See http://cygwin.com/setup.html for details. - #'''), file=f) + # This file was automatically generated at %s. + # + # If you edit it, your edits will be discarded next time the file is + # generated. See http://cygwin.com/setup.html for details.''') + % (time.strftime("%F %T %Z", time.localtime(tz))), + file=f) if args.release: print("release: %s" % args.release, file=f) print("arch: %s" % arch, file=f) - print("setup-timestamp: %d" % time.time(), file=f) + print("setup-timestamp: %d" % tz, file=f) if args.setup_version: print("setup-version: %s" % args.setup_version, file=f) diff --git a/test/test_calm.py b/test/test_calm.py index 2c29719..84124bd 100755 --- a/test/test_calm.py +++ b/test/test_calm.py @@ -231,6 +231,7 @@ class CalmTest(unittest.TestCase): results = inifile.read() # fix the timestamp to match expected results = re.sub('setup-timestamp: .*', 'setup-timestamp: 1458221800', results, 1) + results = re.sub('generated at .*', 'generated at 2016-03-17 13:36:40 GMT', results, 1) compare_with_expected_file(self, 'testdata/inifile', (results,), 'setup.ini') # XXX: delete a needed package, and check validate fails @@ -277,6 +278,7 @@ class CalmTest(unittest.TestCase): results = inifile.read() # fix the timestamp to match expected results = re.sub('setup-timestamp: .*', 'setup-timestamp: 1473797080', results, 1) + results = re.sub('generated at .*', 'generated at 2016-09-13 21:04:40 BST', results, 1) compare_with_expected_file(self, 'testdata/process_arch', (results,), 'setup.ini') for d in ['rel_area', 'homedir', 'htdocs', 'vault']: diff --git a/test/testdata/inifile/setup.ini.expected b/test/testdata/inifile/setup.ini.expected index 22bab0f..d770582 100644 --- a/test/testdata/inifile/setup.ini.expected +++ b/test/testdata/inifile/setup.ini.expected @@ -1,7 +1,7 @@ -('# This file is automatically generated. If you edit it, your\n' - '# edits will be discarded next time the file is generated.\n' - '# See http://cygwin.com/setup.html for details.\n' +('# This file was automatically generated at 2016-03-17 13:36:40 GMT\n' '#\n' + '# If you edit it, your edits will be discarded next time the file is\n' + '# generated. See http://cygwin.com/setup.html for details.\n' 'release: testing\n' 'arch: x86\n' 'setup-timestamp: 1458221800\n' diff --git a/test/testdata/process_arch/setup.ini.expected b/test/testdata/process_arch/setup.ini.expected index de165ea..2fd7bcb 100644 --- a/test/testdata/process_arch/setup.ini.expected +++ b/test/testdata/process_arch/setup.ini.expected @@ -1,7 +1,7 @@ -('# This file is automatically generated. If you edit it, your\n' - '# edits will be discarded next time the file is generated.\n' - '# See http://cygwin.com/setup.html for details.\n' +('# This file was automatically generated at 2016-09-13 21:04:40 BST\n' '#\n' + '# If you edit it, your edits will be discarded next time the file is\n' + '# generated. See http://cygwin.com/setup.html for details.\n' 'release: trial\n' 'arch: x86\n' 'setup-timestamp: 1473797080\n'