Allow for crew download to handle is_fake packages. (#10581)

* Allow for crew download to handle is_fake packages.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* refactor is_fake downloads

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
Satadru Pramanik, DO, MPH, MEng
2024-10-08 15:32:50 -04:00
committed by GitHub
parent 856133afcc
commit 002be279ed
2 changed files with 26 additions and 2 deletions

View File

@@ -1742,7 +1742,31 @@ def download_command(args)
search @pkg_name
@pkg.build_from_source = true if @opt_source
print_current_package CREW_VERBOSE
download
if ARGV.intersect?(%w[download]) && @pkg.is_fake?
fake_pkg_deplist = @pkg.get_deps_list(return_attr: true).flat_map(&:keys).uniq
until fake_pkg_deplist.blank?
puts "Will download the following packages: #{fake_pkg_deplist.join(' ')}".orange
fake_pkg_deplist.each_with_index do |fake_pkg_dep, index|
@pkg_name = fake_pkg_dep
search @pkg_name
@pkg.build_from_source = true if @opt_source
if @pkg.is_fake?
puts "Expanding #{fake_pkg_dep}...".lightpurple
expanded_pkg_list = @pkg.get_deps_list(return_attr: true).flat_map(&:keys).uniq
fake_pkg_deplist.push(*expanded_pkg_list)
fake_pkg_deplist.delete(@pkg_name)
next fake_pkg_dep
end
total_files_to_check = fake_pkg_deplist.length
numlength = total_files_to_check.to_s.length
puts "[#{(index + 1).to_s.rjust(numlength)}/#{total_files_to_check}] Downloading #{fake_pkg_dep}...".blue
download
fake_pkg_deplist.delete(@pkg_name)
end
end
else
download
end
end
end

View File

@@ -3,7 +3,7 @@
require 'etc'
OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
CREW_VERSION ||= '1.53.9' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
CREW_VERSION ||= '1.54.0' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
# Kernel architecture.
KERN_ARCH ||= Etc.uname[:machine]