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 ...@@ -941,20 +941,37 @@ def resolve_dependencies
return if @dependencies.empty? return if @dependencies.empty?
puts 'The following packages also need to be installed: ' puts 'The following packages also need to be installed: '
i = 0 deps = @dependencies
last_deps = [] begin_packages = []
end_packages = []
first_packages = ["shared_mime_info"]
last_packages = ["curl", "ghc", "mandb", "gtk3", "gtk4", "sommelier"] last_packages = ["curl", "ghc", "mandb", "gtk3", "gtk4", "sommelier"]
@dependencies.each do |dep| @dependencies.each do |dep|
if last_packages.include?(dep) depends = nil
@dependencies.delete_at(i) File.open("#{CREW_PACKAGES_PATH}#{dep}.rb") do |f|
last_deps.push(dep) 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 end
i += 1 i += 1
end end
@dependencies.concat last_deps.sort @dependencies = (begin_packages + deps + end_packages).uniq
@dependencies.each do |dep| @dependencies.each do |dep|
print dep + ' ' print dep + ' '
......
# Defines common constants used in different parts of crew # Defines common constants used in different parts of crew
CREW_VERSION = '1.8.15' CREW_VERSION = '1.9.1'
ARCH_ACTUAL = `uname -m`.strip ARCH_ACTUAL = `uname -m`.strip
# This helps with virtualized builds on aarch64 machines # 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