MCPcopy Create free account
hub / github.com/apache/arrow / yum_update

Method yum_update

dev/release/binary-task.rb:1951–1995  ·  view source on GitHub ↗
(base_dir, incoming_dir)

Source from the content-addressed store, hash-verified

1949 end
1950
1951 def yum_update(base_dir, incoming_dir)
1952 yum_targets.each do |distribution, distribution_version|
1953 target_dir = "#{incoming_dir}/#{distribution}/#{distribution_version}"
1954 target_dir = Pathname(target_dir)
1955 next unless target_dir.directory?
1956
1957 base_target_dir = Pathname(base_dir) + distribution + distribution_version
1958 if base_target_dir.exist?
1959 base_target_dir.glob("*") do |base_arch_dir|
1960 next unless base_arch_dir.directory?
1961
1962 base_repodata_dir = base_arch_dir + "repodata"
1963 next unless base_repodata_dir.exist?
1964
1965 target_repodata_dir = target_dir + base_arch_dir.basename + "repodata"
1966 rm_rf(target_repodata_dir, verbose: verbose?)
1967 mkdir_p(target_repodata_dir.parent, verbose: verbose?)
1968 cp_r(base_repodata_dir,
1969 target_repodata_dir,
1970 preserve: true,
1971 verbose: verbose?)
1972 end
1973 end
1974
1975 target_dir.glob("*") do |arch_dir|
1976 next unless arch_dir.directory?
1977
1978 packages = Tempfile.new("createrepo-c-packages")
1979 Pathname.glob("#{arch_dir}/*/*.rpm") do |rpm|
1980 relative_rpm = rpm.relative_path_from(arch_dir)
1981 packages.puts(relative_rpm.to_s)
1982 end
1983 packages.close
1984 sh("createrepo_c",
1985 "--pkglist", packages.path,
1986 "--recycle-pkglist",
1987 "--retain-old-md-by-age=0",
1988 "--skip-stat",
1989 "--update",
1990 arch_dir.to_s,
1991 out: default_output,
1992 verbose: verbose?)
1993 end
1994 end
1995 end
1996
1997 def define_yum_staging_tasks
1998 namespace :yum do

Callers

nothing calls this directly

Calls 8

directory?Method · 0.80
exist?Method · 0.80
eachMethod · 0.45
parentMethod · 0.45
newMethod · 0.45
to_sMethod · 0.45
closeMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected