add new method: gnutar_args
This commit is contained in:
		
							parent
							
								
									ec1a1566bc
								
							
						
					
					
						commit
						ade7118057
					
				@ -242,6 +242,16 @@ module Homebrew
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  alias generic_setup_tar_and_args! setup_tar_and_args!
 | 
					  alias generic_setup_tar_and_args! setup_tar_and_args!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def gnutar_args(mtime)
 | 
				
			||||||
 | 
					    # Ensure tar is set up for reproducibility.
 | 
				
			||||||
 | 
					    # https://reproducible-builds.org/docs/archives/
 | 
				
			||||||
 | 
					    [
 | 
				
			||||||
 | 
					      "--format", "pax", "--owner", "0", "--group", "0", "--sort", "name", "--mtime=#{mtime}",
 | 
				
			||||||
 | 
					      # Set exthdr names to exclude PID (for GNU tar <1.33). Also don't store atime and ctime.
 | 
				
			||||||
 | 
					      "--pax-option", "globexthdr.name=/GlobalHead.%n,exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime"
 | 
				
			||||||
 | 
					    ].freeze
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def formula_ignores(f)
 | 
					  def formula_ignores(f)
 | 
				
			||||||
    ignores = []
 | 
					    ignores = []
 | 
				
			||||||
    cellar_regex = Regexp.escape(HOMEBREW_CELLAR)
 | 
					    cellar_regex = Regexp.escape(HOMEBREW_CELLAR)
 | 
				
			||||||
 | 
				
			|||||||
@ -9,15 +9,7 @@ module Homebrew
 | 
				
			|||||||
  def setup_tar_and_args!(args, mtime)
 | 
					  def setup_tar_and_args!(args, mtime)
 | 
				
			||||||
    generic_setup_tar_and_args!(args, mtime)
 | 
					    generic_setup_tar_and_args!(args, mtime)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Ensure tar is set up for reproducibility.
 | 
					    ["tar", gnutar_args(mtime)].freeze
 | 
				
			||||||
    # https://reproducible-builds.org/docs/archives/
 | 
					 | 
				
			||||||
    gnutar_args = [
 | 
					 | 
				
			||||||
      "--format", "pax", "--owner", "0", "--group", "0", "--sort", "name", "--mtime=#{mtime}",
 | 
					 | 
				
			||||||
      # Set exthdr names to exclude PID (for GNU tar <1.33). Also don't store atime and ctime.
 | 
					 | 
				
			||||||
      "--pax-option", "globexthdr.name=/GlobalHead.%n,exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime"
 | 
					 | 
				
			||||||
    ].freeze
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ["tar", gnutar_args].freeze
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def formula_ignores(f)
 | 
					  def formula_ignores(f)
 | 
				
			||||||
 | 
				
			|||||||
@ -18,14 +18,6 @@ module Homebrew
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    ensure_formula_installed!(gnu_tar, reason: "bottling")
 | 
					    ensure_formula_installed!(gnu_tar, reason: "bottling")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Ensure tar is set up for reproducibility.
 | 
					    ["#{gnu_tar.opt_bin}/gtar", gnutar_args(mtime)].freeze
 | 
				
			||||||
    # https://reproducible-builds.org/docs/archives/
 | 
					 | 
				
			||||||
    gnutar_args = [
 | 
					 | 
				
			||||||
      "--format", "pax", "--owner", "0", "--group", "0", "--sort", "name", "--mtime=#{mtime}",
 | 
					 | 
				
			||||||
      # Set exthdr names to exclude PID (for GNU tar <1.33). Also don't store atime and ctime.
 | 
					 | 
				
			||||||
      "--pax-option", "globexthdr.name=/GlobalHead.%n,exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime"
 | 
					 | 
				
			||||||
    ].freeze
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    ["#{gnu_tar.opt_bin}/gtar", gnutar_args].freeze
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user