Allow crew to handle git urls (#5933)

* Catch git urls in crew

* bump version

* simplify
This commit is contained in:
satmandu
2021-07-07 10:44:30 -04:00
committed by GitHub
parent d20067a1c6
commit cf2ada53e8
2 changed files with 12 additions and 5 deletions

View File

@@ -642,8 +642,9 @@ def download
puts "No precompiled binary available for your platform, downloading source..."
end
Dir.chdir CREW_BREW_DIR do
@git = uri.scheme =~ /git/ ? true : false
Dir.chdir CREW_BREW_DIR do
case File.basename(filename)
# Sources that download with curl
when /\.zip$/i, /\.(tar(\.(gz|bz2|xz|lz))?|tgz|tbz|tpxz|txz)$/i, /\.deb$/i, /\.AppImage$/i
@@ -694,8 +695,16 @@ def download
end
return {source: source, filename: filename}
# Sources that download with git
when /^SKIP$/i
Dir.mkdir @extract_dir
# Source URLs which end with .git are git sources.
when /\.git$/i
@git = true
end
# Handle git sources.
if @git == true
# Recall repository from cache if requested
if CREW_CACHE_ENABLED
if @pkg.git_branch.nil? || @pkg.git_branch.empty?
@@ -748,8 +757,6 @@ def download
system "sha256sum #{cachefile} > #{cachefile}.sha256"
puts 'Git repo cached.'.lightgreen
end
when /^SKIP$/i
Dir.mkdir @extract_dir
end
end
return {source: source, filename: filename}

View File

@@ -1,6 +1,6 @@
# Defines common constants used in different parts of crew
CREW_VERSION = '1.11.6'
CREW_VERSION = '1.11.7'
ARCH_ACTUAL = `uname -m`.strip
# This helps with virtualized builds on aarch64 machines