Commit e8b5d84d authored by Ed Reel's avatar Ed Reel Committed by GitHub

Fix crew buildessential dependency resolution (#5662)

parent a2c13ef6
...@@ -511,7 +511,7 @@ def upgrade ...@@ -511,7 +511,7 @@ def upgrade
puts "#{@pkg.name} is already up to date.".lightgreen puts "#{@pkg.name} is already up to date.".lightgreen
end end
else else
# Make a installed packages list belong to the dependency order # Make an installed packages list belong to the dependency order
dependencies = [] dependencies = []
@device[:installed_packages].each do |package| @device[:installed_packages].each do |package|
# skip package if it is dependent other packages previously checked # skip package if it is dependent other packages previously checked
...@@ -520,6 +520,7 @@ def upgrade ...@@ -520,6 +520,7 @@ def upgrade
dependencies = [ package[:name] ].concat(dependencies) dependencies = [ package[:name] ].concat(dependencies)
# expand dependencies and add it to the dependencies list # expand dependencies and add it to the dependencies list
search package[:name], true search package[:name], true
@dependencies = []
exp_dep = expand_dependencies exp_dep = expand_dependencies
dependencies = exp_dep.concat(dependencies) dependencies = exp_dep.concat(dependencies)
end end
...@@ -849,17 +850,6 @@ def resolve_dependencies_and_install ...@@ -849,17 +850,6 @@ def resolve_dependencies_and_install
end end
def expand_dependencies def expand_dependencies
@dependencies = []
if @pkg.build_from_source
# make sure all buildessential packages are installed
pkgname = @pkg.name
search 'buildessential', true
check_deps = @pkg.dependencies.map {|k, v| k}
check_deps.each do |dep|
@dependencies << dep unless @device[:installed_packages].include?(dep)
end
search pkgname, true
end
def push_dependencies def push_dependencies
if @pkg.is_binary?(@device[:architecture]) || if @pkg.is_binary?(@device[:architecture]) ||
(!@pkg.in_upgrade && !@pkg.build_from_source && @device[:installed_packages].any? { |pkg| pkg[:name] == @pkg.name }) (!@pkg.in_upgrade && !@pkg.build_from_source && @device[:installed_packages].any? { |pkg| pkg[:name] == @pkg.name })
...@@ -884,6 +874,15 @@ end ...@@ -884,6 +874,15 @@ end
def resolve_dependencies def resolve_dependencies
abort "Package #{@pkg.name} is not compatible with your device architecture (#{ARCH}) :/".lightred unless @pkg.compatibility.include?('all') or @pkg.compatibility.include?(ARCH) abort "Package #{@pkg.name} is not compatible with your device architecture (#{ARCH}) :/".lightred unless @pkg.compatibility.include?('all') or @pkg.compatibility.include?(ARCH)
@dependencies = []
if @pkg.build_from_source
# make sure all buildessential packages are installed
pkgname = @pkg.name
search 'buildessential', true
expand_dependencies
search pkgname, true
end
expand_dependencies expand_dependencies
# leave only not installed packages in dependencies # leave only not installed packages in dependencies
......
# Defines common constants used in different parts of crew # Defines common constants used in different parts of crew
CREW_VERSION = '1.8.9' CREW_VERSION = '1.8.10'
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