Changeset View
Changeset View
Standalone View
Standalone View
contrib/gitian-builder/bin/gbuild
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | opts.on("-u PAIRS", "--url PAIRS", "comma separated list of DIRECTORY=URL pairs") do |v| | ||||
@options[:url] = v | @options[:url] = v | ||||
end | end | ||||
opts.on("-o", "--cache-read-only", "only use existing cache files, do not update them") do |v| | opts.on("-o", "--cache-read-only", "only use existing cache files, do not update them") do |v| | ||||
@options[:cache_ro] = v | @options[:cache_ro] = v | ||||
end | end | ||||
opts.on("--skip-fetch", "skip fetching the latest git objects and refs from the remote source") do |v| | opts.on("--skip-fetch", "skip fetching the latest git objects and refs from the remote source") do |v| | ||||
@options[:skip_fetch] = v | @options[:skip_fetch] = v | ||||
end | end | ||||
opts.on("--skip-cleanup", "skip cleaning up the target VM. this may be useful for copying additional files from the target after the build") do |v| | |||||
@options[:skip_cleanup] = v | |||||
end | |||||
end.parse! | end.parse! | ||||
if !ENV["USE_LXC"] and !ENV["USE_DOCKER"] and !ENV["USE_VBOX"] and !File.exist?("/dev/kvm") | if !ENV["USE_LXC"] and !ENV["USE_DOCKER"] and !ENV["USE_VBOX"] and !File.exist?("/dev/kvm") | ||||
$stderr.puts "\n************* WARNING: kvm not loaded, this will probably not work out\n\n" | $stderr.puts "\n************* WARNING: kvm not loaded, this will probably not work out\n\n" | ||||
end | end | ||||
base_dir = Pathname.new(__FILE__).expand_path.dirname.parent | base_dir = Pathname.new(__FILE__).expand_path.dirname.parent | ||||
libexec_dir = base_dir + 'libexec' | libexec_dir = base_dir + 'libexec' | ||||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | if enable_cache && !@options[:cache_ro] | ||||
system! "copy-from-target #{@quiet_flag} cache/#{package_name}/ #{cache_dir}" | system! "copy-from-target #{@quiet_flag} cache/#{package_name}/ #{cache_dir}" | ||||
system! "copy-from-target #{@quiet_flag} cache/common/ #{cache_dir}" | system! "copy-from-target #{@quiet_flag} cache/common/ #{cache_dir}" | ||||
end | end | ||||
base_manifest = File.read("var/base-#{suite}-#{arch}.manifest") | base_manifest = File.read("var/base-#{suite}-#{arch}.manifest") | ||||
base_manifests["#{suite}-#{arch}"] = base_manifest | base_manifests["#{suite}-#{arch}"] = base_manifest | ||||
end | end | ||||
end | end | ||||
unless @options[:skip_cleanup] | |||||
info "Cleaning up target" | |||||
system "stop-target" | |||||
end | |||||
out_dir = File.join(build_dir, "out") | out_dir = File.join(build_dir, "out") | ||||
out_sums = {} | out_sums = {} | ||||
cache_common_dir = File.join(cache_dir, "common") | cache_common_dir = File.join(cache_dir, "common") | ||||
cache_package_dir = File.join(cache_dir, "#{package_name}") | cache_package_dir = File.join(cache_dir, "#{package_name}") | ||||
cache_common_sums = {} | cache_common_sums = {} | ||||
cache_package_sums = {} | cache_package_sums = {} | ||||
info "Generating report" | info "Generating report" | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |