public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: jturney@sourceware.org
To: cygwin-apps-cvs@sourceware.org
Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20160705-23-g5893900
Date: Mon, 19 Sep 2016 12:49:00 -0000	[thread overview]
Message-ID: <20160919124920.42175.qmail@sourceware.org> (raw)




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=58939006d9020bd49503ae6586e5b1f9fafdd87b

commit 58939006d9020bd49503ae6586e5b1f9fafdd87b
Author: Jon Turney <jon.turney@dronecode.org.uk>
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 <jon.turney@dronecode.org.uk>
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 <Stromeko@nexgo.de>
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 <pvr>.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'


                 reply	other threads:[~2016-09-19 12:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160919124920.42175.qmail@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-apps-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).