diff options
Diffstat (limited to 'modules/buildsystem')
-rwxr-xr-x | modules/buildsystem/templates/cleaner.rb | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/modules/buildsystem/templates/cleaner.rb b/modules/buildsystem/templates/cleaner.rb index 906a03c6..45e683d9 100755 --- a/modules/buildsystem/templates/cleaner.rb +++ b/modules/buildsystem/templates/cleaner.rb @@ -83,8 +83,8 @@ def process archs.each{|arch| bin_path = "#{base_path}/#{version}/#{arch}/media/#{media}" debug_path = bin_path.sub("/media/", "/media/debug/") - old_packages = check_binaries($srcs, $srcages, bin_path, $used_srcs) - old_debug_packages = check_binaries($srcs, {}, debug_path, nil) + old_packages = check_binaries(arch, $srcs, $srcages, src_path, bin_path, $used_srcs) + old_debug_packages = check_binaries(arch, $srcs, {}, src_path, debug_path, nil) move_packages(bin_path, old_path, old_packages, auto) move_packages(debug_path, old_path, old_debug_packages, auto) } @@ -162,7 +162,24 @@ def name_from_filename(filename) filename.sub(/-[^-]*-[^-]*$/, '') end -def check_binaries(srcs, srcages, path, used_srcs) +def arch_wanted(src, arch) + exclusive_arch = `rpmquery -p #{src} --qf '[%{EXCLUSIVEARCH} ]'`.rstrip + if exclusive_arch != "" then + if !exclusive_arch.split(/ /).include?(arch) then + return false + end + end + exclude_arch = `rpmquery -p #{src} --qf '[%{EXCLUDEARCH} ]'`.rstrip + if exclude_arch != "" then + if exclude_arch.split(/ /).include?(arch) then + return false + end + end + + return true +end + +def check_binaries(arch, srcs, srcages, src_path, path, used_srcs) used_here_srcs = {} all_versions = {} packages(path) {|src, filename, buildtime| @@ -192,7 +209,9 @@ def check_binaries(srcs, srcages, path, used_srcs) # Do not delete newer binaries, upload may be in progress next unless buildtime < srcages[srcname][1] # Do not delete if the new version of the package hasn't been built for this arch yet - next unless used_here_srcs[srcages[srcname][0]] + # 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 end |