From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id CCD533858D37; Sat, 22 Jan 2022 15:36:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCD533858D37 To: cygwin-apps-cvs@sourceware.org Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210626-9-gf327e7d X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 8b6fa8fb2c0cdc12d3e0219b0bbf21836835bf7a X-Git-Newrev: f327e7dd59641a89bcf58735964350238fa7c498 Message-Id: <20220122153605.CCD533858D37@sourceware.org> Date: Sat, 22 Jan 2022 15:36:05 +0000 (GMT) From: Jon TURNEY X-BeenThere: cygwin-apps-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin-apps git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2022 15:36:05 -0000 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=f327e7dd59641a89bcf58735964350238fa7c498 commit f327e7dd59641a89bcf58735964350238fa7c498 Author: Jon Turney Date: Fri Jan 21 17:01:48 2022 +0000 Update top-level sha512.sum Update the top-level sha512.sum, rather than leaving it missing until another process later runs 'make-sha'. https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=67e9143991f707627cafdb09798ea14bc1929cae commit 67e9143991f707627cafdb09798ea14bc1929cae Author: Jon Turney Date: Fri Jan 21 16:33:11 2022 +0000 Drop any special treatment of md5.sum Drop any special treatment of md5.sum files, which are no longer generated by mirror maintainance. Diff: --- calm/calm.py | 20 +++++++++++++------- calm/package.py | 6 +----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/calm/calm.py b/calm/calm.py index b43f65d..731bb7b 100755 --- a/calm/calm.py +++ b/calm/calm.py @@ -444,7 +444,8 @@ def do_output(args, state): irk.irk("calm updated setup.ini for arch '%s'" % (arch)) # compress and re-sign - for ext in ['.ini', '.bz2', '.xz', '.zst']: + extensions = ['.ini', '.bz2', '.xz', '.zst'] + for ext in extensions: extfile = os.path.join(basedir, 'setup' + ext) try: os.remove(extfile + '.sig') @@ -461,12 +462,17 @@ def do_output(args, state): keys = ' '.join(['-u' + k for k in args.keys]) utils.system('/usr/bin/gpg ' + keys + ' --batch --yes -b ' + extfile) - # arrange for checksums to be recomputed - for sumfile in ['md5.sum', 'sha512.sum']: - try: - os.remove(os.path.join(basedir, sumfile)) - except FileNotFoundError: - pass + # recompute checksums + files = ['setup' + ext for ext in extensions] + ['setup' + ext + '.sig' for ext in extensions] + ['setup.ini.bak'] + + hashfile = os.path.join(basedir, 'sha512.sum') + with tempfile.NamedTemporaryFile(mode='w', delete=False) as tmphashfile: + for fn in sorted(files): + sha512 = package.sha512_file(os.path.join(basedir, fn)) + print('%s %s' % (sha512, fn), file=tmphashfile) + logging.info("moving %s to %s" % (tmphashfile.name, hashfile)) + shutil.move(tmphashfile.name, hashfile) + else: logging.debug("removing %s, unchanged %s" % (tmpfile.name, inifile)) os.remove(tmpfile.name) diff --git a/calm/package.py b/calm/package.py index 34424a8..4ec906f 100755 --- a/calm/package.py +++ b/calm/package.py @@ -201,7 +201,7 @@ def read_package_dir(packages, basedir, dirpath, files, remove=None, upload=Fals # no .hint files if not any([f.endswith('.hint') for f in files]): if (relpath.count(os.path.sep) > 1): - for s in ['md5.sum', 'sha512.sum']: + for s in ['sha512.sum']: if s in files: files.remove(s) @@ -211,10 +211,6 @@ def read_package_dir(packages, basedir, dirpath, files, remove=None, upload=Fals return False - # discard obsolete md5.sum - if 'md5.sum' in files: - files.remove('md5.sum') - # ignore dotfiles and backup files for f in files[:]: if f.startswith('.') or f.endswith('.bak'):