You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2023/01/15 13:07:45 UTC

[arrow] branch master updated: GH-33626: [Packaging][RPM] Don't remove metadata for non-target arch (#33672)

This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 4bb7d9488a GH-33626: [Packaging][RPM] Don't remove metadata for non-target arch (#33672)
4bb7d9488a is described below

commit 4bb7d9488a5b1a296f26a1a177da40bf25db8e68
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Sun Jan 15 22:07:39 2023 +0900

    GH-33626: [Packaging][RPM] Don't remove metadata for non-target arch (#33672)
    
    # Which issue does this PR close?
    
    Closes #33626
    
    # Rationale for this change
    
    ADBC reuses dev/release/05-binary-upload.sh for its RPM packages. ADBC only provides x86_64 packages. ADBC doesn't provide aarch64 packages for now.
    
    In this situation, ADBC release deletes Yum repository metadata for aarch64 unexpectedly. dev/release/05-binary-upload.sh should not touch Yum repository metadata for aarch64 in ADBC release.
    
    # What changes are included in this PR?
    
    Copy Yum repository metadata for non-target architecture as-is.
    
    # Are these changes tested?
    
    Yes.
    
    # Are there any user-facing changes?
    
    No.
    * Closes: #33626
    
    Authored-by: Sutou Kouhei <ko...@clear-code.com>
    Signed-off-by: Sutou Kouhei <ko...@clear-code.com>
---
 dev/release/05-binary-upload.sh |  1 +
 dev/release/binary-task.rb      | 32 ++++++++++++++++++--------------
 dev/release/post-02-binary.sh   |  1 +
 3 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/dev/release/05-binary-upload.sh b/dev/release/05-binary-upload.sh
index 5404e0261a..ae240c02dd 100755
--- a/dev/release/05-binary-upload.sh
+++ b/dev/release/05-binary-upload.sh
@@ -132,5 +132,6 @@ docker_run \
     GPG_KEY_ID="${GPG_KEY_ID}" \
     RC=${rc} \
     STAGING=${STAGING:-no} \
+    VERBOSE=${VERBOSE:-no} \
     VERSION=${version} \
     YUM_TARGETS=$(IFS=,; echo "${yum_targets[*]}")
diff --git a/dev/release/binary-task.rb b/dev/release/binary-task.rb
index 9b9bb6ed86..e13e053e4a 100644
--- a/dev/release/binary-task.rb
+++ b/dev/release/binary-task.rb
@@ -1556,24 +1556,28 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";
       target_dir = "#{incoming_dir}/#{distribution}/#{distribution_version}"
       target_dir = Pathname(target_dir)
       next unless target_dir.directory?
-      Dir.glob("#{target_dir}/**/repodata") do |repodata|
-        rm_rf(repodata, verbose: verbose?)
-      end
-      target_dir.glob("*") do |arch_dir|
-        next unless arch_dir.directory?
-        base_repodata_dir = [
-          base_dir,
-          distribution,
-          distribution_version,
-          File.basename(arch_dir),
-          "repodata",
-        ].join("/")
-        if File.exist?(base_repodata_dir)
+
+      base_target_dir = Pathname(base_dir) + distribution + distribution_version
+      if base_target_dir.exist?
+        base_target_dir.glob("*") do |base_arch_dir|
+          next unless base_arch_dir.directory?
+
+          base_repodata_dir = base_arch_dir + "repodata"
+          next unless base_repodata_dir.exist?
+
+          target_repodata_dir = target_dir + base_arch_dir.basename + "repodata"
+          rm_rf(target_repodata_dir, verbose: verbose?)
+          mkdir_p(target_repodata_dir.parent, verbose: verbose?)
           cp_r(base_repodata_dir,
-               arch_dir.to_s,
+               target_repodata_dir,
                preserve: true,
                verbose: verbose?)
         end
+      end
+
+      target_dir.glob("*") do |arch_dir|
+        next unless arch_dir.directory?
+
         packages = Tempfile.new("createrepo-c-packages")
         Pathname.glob("#{arch_dir}/*/*.rpm") do |rpm|
           relative_rpm = rpm.relative_path_from(arch_dir)
diff --git a/dev/release/post-02-binary.sh b/dev/release/post-02-binary.sh
index f46bd73bf9..980f6e3c19 100755
--- a/dev/release/post-02-binary.sh
+++ b/dev/release/post-02-binary.sh
@@ -105,5 +105,6 @@ docker_run \
     ARTIFACTS_DIR="${tmp_dir}/artifacts" \
     RC=${rc} \
     STAGING=${STAGING:-no} \
+    VERBOSE=${VERBOSE:-no} \
     VERSION=${version} \
     YUM_TARGETS=$(IFS=,; echo "${yum_targets[*]}")