Commit 6f09e053 authored by Ed Reel's avatar Ed Reel Committed by GitHub

Fix crew dependency algorithm (#5719)

parent 91d807f9
......@@ -941,20 +941,37 @@ def resolve_dependencies
return if @dependencies.empty?
puts 'The following packages also need to be installed: '
i = 0
last_deps = []
deps = @dependencies
begin_packages = []
end_packages = []
first_packages = ["shared_mime_info"]
last_packages = ["curl", "ghc", "mandb", "gtk3", "gtk4", "sommelier"]
@dependencies.each do |dep|
if last_packages.include?(dep)
@dependencies.delete_at(i)
last_deps.push(dep)
depends = nil
File.open("#{CREW_PACKAGES_PATH}#{dep}.rb") do |f|
f.each_line do |line|
if line =~ /depends_on/
depends = true
break
end
end
end
begin_packages.push dep if first_packages.include? dep
# if a dependency package has no other dependencies, push to the front
begin_packages.push dep unless depends
end_packages.push dep if last_packages.include? dep
end
i = 0
all_packages = begin_packages + end_packages
deps.each do |dep|
if all_packages.include?(dep)
deps.delete_at(i)
end
i += 1
end
@dependencies.concat last_deps.sort
@dependencies = (begin_packages + deps + end_packages).uniq
@dependencies.each do |dep|
print dep + ' '
......
# Defines common constants used in different parts of crew
CREW_VERSION = '1.8.15'
CREW_VERSION = '1.9.1'
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