mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
Fix using 'crew download' to get package binaries for no_source_build and gem_compile_needed packages. (#11120)
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2916b94a71
commit
a902671bc6
15
bin/crew
15
bin/crew
@@ -471,7 +471,7 @@ def download
|
|||||||
|
|
||||||
if !url
|
if !url
|
||||||
abort "No precompiled binary or source is available for #{@device[:architecture]}.".lightred
|
abort "No precompiled binary or source is available for #{@device[:architecture]}.".lightred
|
||||||
elsif url.casecmp?('SKIP') || (@pkg.no_source_build? || @pkg.gem_compile_needed?)
|
elsif url.casecmp?('SKIP') || ((@pkg.no_source_build? || @pkg.gem_compile_needed?) && caller.grep(/download_command/).empty?)
|
||||||
puts 'Skipping source download...'
|
puts 'Skipping source download...'
|
||||||
elsif @pkg.build_from_source
|
elsif @pkg.build_from_source
|
||||||
puts 'Downloading source...'
|
puts 'Downloading source...'
|
||||||
@@ -488,9 +488,10 @@ def download
|
|||||||
# We want to skip when no_source_build is true during the build,
|
# We want to skip when no_source_build is true during the build,
|
||||||
# but when we have built a binary we are in upgrade, and we need
|
# but when we have built a binary we are in upgrade, and we need
|
||||||
# download since we need to extract the just generated binary.
|
# download since we need to extract the just generated binary.
|
||||||
next if (@pkg.no_source_build? || @pkg.gem_compile_needed?) && !@pkg.in_upgrade && !@pkg.in_install
|
next if (@pkg.no_source_build? || @pkg.gem_compile_needed?) && !@pkg.in_upgrade && caller.grep(/download_command/).empty?
|
||||||
case File.basename(filename)
|
case File.basename(filename)
|
||||||
# Sources that download with our internal downloader
|
# Sources that download with our internal downloader.
|
||||||
|
# This also covers all precompiled binaries.
|
||||||
when /\.zip$/i, /\.(tar(\.(gz|bz2|xz|lzma|lz|zst))?|tgz|tbz|tpxz|txz)$/i, /\.deb$/i, /\.AppImage$/i, /\.gem$/i
|
when /\.zip$/i, /\.(tar(\.(gz|bz2|xz|lzma|lz|zst))?|tgz|tbz|tpxz|txz)$/i, /\.deb$/i, /\.AppImage$/i, /\.gem$/i
|
||||||
# Recall file from cache if requested
|
# Recall file from cache if requested
|
||||||
if CREW_CACHE_ENABLED
|
if CREW_CACHE_ENABLED
|
||||||
@@ -514,6 +515,10 @@ def download
|
|||||||
puts 'Archive copied from cache'.green if CREW_VERBOSE
|
puts 'Archive copied from cache'.green if CREW_VERBOSE
|
||||||
end
|
end
|
||||||
puts 'Archive found in cache'.lightgreen
|
puts 'Archive found in cache'.lightgreen
|
||||||
|
unless caller.grep(/download_command/).empty?
|
||||||
|
puts 'Downloaded to: '.lightblue + File.join(CREW_BREW_DIR, filename).blue
|
||||||
|
FileUtils.rm_rf @extract_dir
|
||||||
|
end
|
||||||
return { source:, filename: }
|
return { source:, filename: }
|
||||||
else
|
else
|
||||||
puts 'Cached archive checksum mismatch. 😔 Will download.'.lightred
|
puts 'Cached archive checksum mismatch. 😔 Will download.'.lightred
|
||||||
@@ -541,6 +546,10 @@ def download
|
|||||||
puts 'Archive copied to cache'.green if CREW_VERBOSE
|
puts 'Archive copied to cache'.green if CREW_VERBOSE
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
unless caller.grep(/download_command/).empty?
|
||||||
|
puts 'Downloaded to: '.lightblue + File.join(CREW_BREW_DIR, filename).blue
|
||||||
|
FileUtils.rm_rf @extract_dir
|
||||||
|
end
|
||||||
return { source:, filename: }
|
return { source:, filename: }
|
||||||
|
|
||||||
when /^SKIP$/i
|
when /^SKIP$/i
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
require 'etc'
|
require 'etc'
|
||||||
|
|
||||||
OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
|
OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
|
||||||
CREW_VERSION ||= '1.56.6' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
CREW_VERSION ||= '1.56.7' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
||||||
|
|
||||||
# Kernel architecture.
|
# Kernel architecture.
|
||||||
KERN_ARCH ||= Etc.uname[:machine]
|
KERN_ARCH ||= Etc.uname[:machine]
|
||||||
|
|||||||
Reference in New Issue
Block a user