| 2015 | end |
| 2016 | |
| 2017 | def define_yum_rc_tasks |
| 2018 | namespace :yum do |
| 2019 | namespace :rc do |
| 2020 | base_dir = "#{yum_rc_repositories_dir}/base" |
| 2021 | incoming_dir = "#{yum_rc_repositories_dir}/incoming" |
| 2022 | upload_dir = "#{yum_rc_repositories_dir}/upload" |
| 2023 | |
| 2024 | desc "Copy RPM packages" |
| 2025 | task :copy do |
| 2026 | yum_targets.each do |distribution, distribution_version| |
| 2027 | progress_label = "Copying: #{distribution} #{distribution_version}" |
| 2028 | progress_reporter = ProgressReporter.new(progress_label) |
| 2029 | |
| 2030 | destination_dir = File.join(incoming_dir, |
| 2031 | distribution, |
| 2032 | distribution_version) |
| 2033 | rm_rf(destination_dir, verbose: verbose?) |
| 2034 | mkdir_p(destination_dir, verbose: verbose?) |
| 2035 | |
| 2036 | source_dir_prefix = |
| 2037 | "#{artifacts_dir}/#{distribution}-#{distribution_version}" |
| 2038 | # apache/arrow uses almalinux-10-{amd64,arm64}.tar.gz but |
| 2039 | # apache/arrow-adbc uses almalinux-10.tar.gz So the |
| 2040 | # following glob must much both of them. |
| 2041 | Dir.glob("#{source_dir_prefix}*.tar.gz") do |tar_gz| |
| 2042 | sh("tar", "xf", tar_gz, "-C", incoming_dir) |
| 2043 | progress_reporter.advance |
| 2044 | end |
| 2045 | |
| 2046 | case "#{distribution}-#{distribution_version}" |
| 2047 | when "almalinux-10", |
| 2048 | "almalinux-9", |
| 2049 | "almalinux-8", |
| 2050 | "amazon-linux-2023", |
| 2051 | "centos-9-stream" |
| 2052 | # Adjust source packages directory for backward |
| 2053 | # compatibility. We don't need this for new supported |
| 2054 | # distribution because we don't need to care about |
| 2055 | # backward compatibility for them. |
| 2056 | # |
| 2057 | # Example: |
| 2058 | # almalinux/10/Source/Packages/ -> |
| 2059 | # almalinux/10/Source/SPackages/ |
| 2060 | mv(File.join(destination_dir, "Source", "Packages"), |
| 2061 | File.join(destination_dir, "Source", "SPackages"), |
| 2062 | verbose: true) |
| 2063 | end |
| 2064 | |
| 2065 | progress_reporter.finish |
| 2066 | end |
| 2067 | end |
| 2068 | |
| 2069 | desc "Download repodata for RC Yum repositories" |
| 2070 | task :download do |
| 2071 | yum_distributions.each do |distribution| |
| 2072 | distribution_dir = "#{base_dir}/#{distribution}" |
| 2073 | download_distribution(:artifactory, |
| 2074 | distribution, |