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

Method yum_update

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

Source from the content-addressed store, hash-verified

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