Commit 41dfd1c2 authored by satmandu's avatar satmandu Committed by GitHub

Handle edge case of cachefile already in CREW_BREW_DIR when build restarts (#5772)

* Handle edge case of cachefile already in CREW_BREW_DIR

* bump version
parent c7e0e101
...@@ -653,11 +653,11 @@ def download ...@@ -653,11 +653,11 @@ def download
if Digest::SHA256.hexdigest( File.read(cachefile) ) == sha256sum if Digest::SHA256.hexdigest( File.read(cachefile) ) == sha256sum
begin begin
# Hard link cached file if possible. # Hard link cached file if possible.
FileUtils.ln cachefile, CREW_BREW_DIR, verbose: @fileutils_verbose FileUtils.ln cachefile, CREW_BREW_DIR, force: true, verbose: @fileutils_verbose unless File.identical?(cachefile,CREW_BREW_DIR + '/' + filename)
puts "Archive hard linked from cache".green if @opt_verbose puts "Archive hard linked from cache".green if @opt_verbose
rescue rescue
# Copy cached file if hard link fails. # Copy cached file if hard link fails.
FileUtils.cp cachefile, CREW_BREW_DIR, verbose: @fileutils_verbose FileUtils.cp cachefile, CREW_BREW_DIR, verbose: @fileutils_verbose unless File.identical?(cachefile,CREW_BREW_DIR + '/' + filename)
puts "Archive copied from cache".green if @opt_verbose puts "Archive copied from cache".green if @opt_verbose
end end
puts "Archive found in cache".lightgreen puts "Archive found in cache".lightgreen
......
# Defines common constants used in different parts of crew # Defines common constants used in different parts of crew
CREW_VERSION = '1.9.7' CREW_VERSION = '1.9.8'
ARCH_ACTUAL = `uname -m`.strip ARCH_ACTUAL = `uname -m`.strip
# This helps with virtualized builds on aarch64 machines # This helps with virtualized builds on aarch64 machines
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment