Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2023-02-08 17:38:15 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2023-02-09 18:53:23 +0300
commit6be5440ff6d88db80bf862d04504c74610f7ed7a (patch)
tree407d50db197d37bab1c682261fe40149901638a4
parentd64ec03daa585e6df68b72b45e98c96ecc703241 (diff)
Fix invalid packageset after process_relarea
If post-stale removal package set validation fails, don't change the packageset during process_relarea(). This makes it similar to process_uploads, in that the packageset can't be changed to something invalid. (Scenario: vaulting is requested via 'vault' command, which triggers process_relarea(), which applies any requested vaultings during it's stale evaluation. If that fails to validate, the packageset is broken and any subsequent uploads will fail until after another relarea scan takes place) Fixes: 0939d5bd86f4 ("Add 'calm-tool vault'")
-rwxr-xr-xcalm/calm.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/calm/calm.py b/calm/calm.py
index b6e7e6e..54d0155 100755
--- a/calm/calm.py
+++ b/calm/calm.py
@@ -121,7 +121,11 @@ def process_relarea(args, state):
# packages can be stale due to changes made directly in the release
# area, so first check here if there are any stale packages to vault
if args.stale:
- stale_to_vault = remove_stale_packages(args, packages, state)
+ fresh_packages = {}
+ for arch in common_constants.ARCHES:
+ fresh_packages[arch] = package.merge(packages[arch])
+
+ stale_to_vault = remove_stale_packages(args, fresh_packages, state)
if stale_to_vault:
for arch in common_constants.ARCHES + ['noarch', 'src']:
logging.info("vaulting %d old package(s) for arch %s" % (len(stale_to_vault[arch]), arch))
@@ -130,6 +134,8 @@ def process_relarea(args, state):
logging.error("error while evaluating stale packages")
return None
+ packages = fresh_packages
+
# clean up any empty directories
if not args.dryrun:
utils.rmemptysubdirs(args.rel_area)