diff options
author | Pascal Terjan <pterjan@mageia.org> | 2020-12-31 19:32:50 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2020-12-31 19:36:33 +0000 |
commit | 3d8c6dd1e3ae2f90ba6afe9931f4c2104edbed97 (patch) | |
tree | 792353a5792622642227ac1e3a25541c60a7ec08 /modules | |
parent | 9e2728b289c71f062951ee78f6c515cc78c20908 (diff) | |
download | puppet-3d8c6dd1e3ae2f90ba6afe9931f4c2104edbed97.tar puppet-3d8c6dd1e3ae2f90ba6afe9931f4c2104edbed97.tar.gz puppet-3d8c6dd1e3ae2f90ba6afe9931f4c2104edbed97.tar.bz2 puppet-3d8c6dd1e3ae2f90ba6afe9931f4c2104edbed97.tar.xz puppet-3d8c6dd1e3ae2f90ba6afe9931f4c2104edbed97.zip |
Fix cleanup to correctly wait for 7d
It was checking if there is another version of the src, but using
the name of the package instead of the name of the src, and those
are usually different in the case we care most about (libraries).
Diffstat (limited to 'modules')
-rwxr-xr-x | modules/buildsystem/templates/cleaner.rb | 8 | ||||
-rw-r--r-- | modules/buildsystem/templates/cleaner_test.rb | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/modules/buildsystem/templates/cleaner.rb b/modules/buildsystem/templates/cleaner.rb index c1d89d7b..e9ff8cb6 100755 --- a/modules/buildsystem/templates/cleaner.rb +++ b/modules/buildsystem/templates/cleaner.rb @@ -149,13 +149,13 @@ def check_binaries(srcs, srcages, path, used_srcs) src = l2[0] filename = l2[1].rstrip if ! srcs[src] then - name = name_from_filename(filename) - if srcages[name] then + srcname = name_from_filename(src) + if srcages[srcname] then # The src.rpm is gone but there is a different version of it # Only delete old binaries after 7d - next unless srcages[name][1] < Time.now.to_i - 24*60*60*7 + next unless srcages[srcname][1] < Time.now.to_i - 24*60*60*7 # Do not delete if the new version of the package hasn't been built for this arch yet - next unless used_here_srcs[srcages[name][0]] + next unless used_here_srcs[srcages[srcname][0]] end old_binaries << filename end diff --git a/modules/buildsystem/templates/cleaner_test.rb b/modules/buildsystem/templates/cleaner_test.rb index 85d46a4b..b8b9ad84 100644 --- a/modules/buildsystem/templates/cleaner_test.rb +++ b/modules/buildsystem/templates/cleaner_test.rb @@ -15,12 +15,12 @@ class TestCleaner < Test::Unit::TestCase def test_old # Package was built on this arch and src.rpm for new version is 15d old - setpackages(['foo-43-1.src.rpm:foo-43-1.armv7hl.rpm', 'foo-42-1.src.rpm:foo-42-1.armv7hl.rpm']) + setpackages(['foo-43-1.src.rpm:libfoo2-43-1.armv7hl.rpm', 'foo-42-1.src.rpm:libfoo1-42-1.armv7hl.rpm']) srcages = {} srcages['foo'] = [ 'foo-43-1.src.rpm', Time.now.to_i - 15*24*3600 ] srcs = {} srcs['foo-43-1.src.rpm'] = true - assert_equal(['foo-42-1.armv7hl.rpm'], check_binaries(srcs, srcages, '', nil)) + assert_equal(['libfoo1-42-1.armv7hl.rpm'], check_binaries(srcs, srcages, '', nil)) end def test_recent |