diff options
author | Pascal Terjan <pterjan@mageia.org> | 2023-01-08 17:00:34 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2023-01-08 17:00:34 +0000 |
commit | a2c6bacb09be6e82673c25373c4f716db0de1a4c (patch) | |
tree | 1135dc536d4a61d04c006f915a96beca29c367f7 /modules/buildsystem/templates/cleaner.rb | |
parent | af440a8aee43646dc6a1d078ab1af745551c5e0a (diff) | |
download | puppet-a2c6bacb09be6e82673c25373c4f716db0de1a4c.tar puppet-a2c6bacb09be6e82673c25373c4f716db0de1a4c.tar.gz puppet-a2c6bacb09be6e82673c25373c4f716db0de1a4c.tar.bz2 puppet-a2c6bacb09be6e82673c25373c4f716db0de1a4c.tar.xz puppet-a2c6bacb09be6e82673c25373c4f716db0de1a4c.zip |
Fix cleaner.rb
It did not really wait for 7d for removed subpackages.
Also remove an incorrect condition, src.rpm is usually slightly older
that binary rpms, and fix the tests.
Diffstat (limited to 'modules/buildsystem/templates/cleaner.rb')
-rwxr-xr-x | modules/buildsystem/templates/cleaner.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/buildsystem/templates/cleaner.rb b/modules/buildsystem/templates/cleaner.rb index 45e683d9..97b91ab0 100755 --- a/modules/buildsystem/templates/cleaner.rb +++ b/modules/buildsystem/templates/cleaner.rb @@ -203,14 +203,12 @@ def check_binaries(arch, srcs, srcages, src_path, path, used_srcs) srcname = name_from_filename(src) if srcages[srcname] then # The src.rpm is gone but there is a different version of it + latestsrc = srcages[srcname][0] # Only delete old binaries after 7d or if there is a new version name = name_from_filename(filename) - next unless (srcages[srcname][1] < Time.now.to_i - 24*60*60*7 || all_versions[name].include?(src)) - # Do not delete newer binaries, upload may be in progress - next unless buildtime < srcages[srcname][1] + next unless (srcages[srcname][1] < Time.now.to_i - 24*60*60*7 || all_versions[name].include?(latestsrc)) # Do not delete if the new version of the package hasn't been built for this arch yet # but still delete it if it is no longer expected to be built. - latestsrc = srcages[srcname][0] next unless (used_here_srcs[latestsrc] || !arch_wanted("#{src_path}/#{latestsrc}", arch)) end old_binaries << filename |