Commit cf2ada53 authored by satmandu's avatar satmandu Committed by GitHub

Allow crew to handle git urls (#5933)

* Catch git urls in crew

* bump version

* simplify
parent d20067a1
......@@ -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}
......
# 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
......
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