diff --git a/contrib/gitian-builder/bin/gbuild b/contrib/gitian-builder/bin/gbuild --- a/contrib/gitian-builder/bin/gbuild +++ b/contrib/gitian-builder/bin/gbuild @@ -221,6 +221,9 @@ opts.on("--skip-fetch", "skip fetching the latest git objects and refs from the remote source") do |v| @options[:skip_fetch] = v 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! if !ENV["USE_LXC"] and !ENV["USE_DOCKER"] and !ENV["USE_VBOX"] and !File.exist?("/dev/kvm") @@ -348,6 +351,11 @@ end end +unless @options[:skip_cleanup] + info "Cleaning up target" + system "stop-target" +end + out_dir = File.join(build_dir, "out") out_sums = {} cache_common_dir = File.join(cache_dir, "common")