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

Method yum_update

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

Source from the content-addressed store, hash-verified

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