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 2025/05/06 01:51:32 UTC

(arrow) branch main updated: GH-46240: [Release][Packaging] Fix a bug that existing APT repositories' metadata are lost (#46287)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 260c2f0de3 GH-46240: [Release][Packaging] Fix a bug that existing APT repositories' metadata are lost (#46287)
260c2f0de3 is described below

commit 260c2f0de32e95bb544073ada7838adc47051916
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Tue May 6 10:51:25 2025 +0900

    GH-46240: [Release][Packaging] Fix a bug that existing APT repositories' metadata are lost (#46287)
    
    ### Rationale for this change
    
    APT repositories' metadata for 20.0.0 RC 2 don't have existing packages such as 19.0.1 packages. We should keep metadata for existing packages and append metadata for new packages.
    
    ### What changes are included in this PR?
    
    * Fix paths for existing metadata
    * Fix pattern for detecting new packages
      * This is for apache/arrow-adbc#2769
    
    ### Are these changes tested?
    
    Yes. I tested this with ADBC 18 RC 0.
    
    ### Are there any user-facing changes?
    
    No.
    * GitHub Issue: #46240
    
    Authored-by: Sutou Kouhei <ko...@clear-code.com>
    Signed-off-by: Sutou Kouhei <ko...@clear-code.com>
---
 dev/release/binary-task.rb | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/dev/release/binary-task.rb b/dev/release/binary-task.rb
index 70d7aa24c0..ff47edb0c5 100644
--- a/dev/release/binary-task.rb
+++ b/dev/release/binary-task.rb
@@ -1649,7 +1649,10 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";
             rm_rf(pool_dir, verbose: verbose?)
             mkdir_p(pool_dir, verbose: verbose?)
             source_dir_prefix = "#{artifacts_dir}/#{distribution}-#{code_name}"
-            Dir.glob("#{source_dir_prefix}-*/*") do |path|
+            # apache/arrow uses debian-bookworm-{amd64,arm64} but
+            # apache/arrow-adbc uses debian-bookworm. So the following
+            # glob must much both of them.
+            Dir.glob("#{source_dir_prefix}*/*") do |path|
               base_name = File.basename(path)
               package_name = ENV["DEB_PACKAGE_NAME"]
               if package_name.nil? or package_name.empty?
@@ -1686,16 +1689,17 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";
 
         desc "Download dists/ for RC APT repositories"
         task :download do
-          apt_distributions.each do |distribution|
+          apt_targets.each do |distribution, code_name, component|
             not_checksum_pattern = /.+(?<!\.asc|\.sha512)\z/
-            base_distribution_dir = "#{base_dir}/#{distribution}"
+            base_distribution_dir =
+              "#{base_dir}/#{distribution}/dists/#{code_name}"
             pattern = not_checksum_pattern
             download_distribution(:artifactory,
                                   distribution,
                                   base_distribution_dir,
                                   :base,
                                   pattern: pattern,
-                                  prefix: "dists")
+                                  prefix: "dists/#{code_name}")
           end
         end