mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 23:48:01 -05:00
Return invalid libraries only for library test (#14030)
This commit is contained in:
@@ -15,10 +15,13 @@ class Command
|
|||||||
crew_package_test_path = File.join(CREW_LIB_PATH, 'tests', 'package', name[0].to_s)
|
crew_package_test_path = File.join(CREW_LIB_PATH, 'tests', 'package', name[0].to_s)
|
||||||
crew_package_test = File.join(crew_package_test_path, name)
|
crew_package_test = File.join(crew_package_test_path, name)
|
||||||
|
|
||||||
|
# This pulls the operation from the calling function.
|
||||||
|
operation = caller_locations(1, 2)[0].to_s.split[3].split('_')[0].split('#')[1]
|
||||||
|
|
||||||
# We return true here in order to exit early but behave as if the check passed, so that other operations can continue.
|
# We return true here in order to exit early but behave as if the check passed, so that other operations can continue.
|
||||||
unless File.file?(local_package)
|
unless File.file?(local_package)
|
||||||
# If the operation is a bare 'crew check', then we don't want to silently skip it.
|
# If the operation is a bare 'crew check', then we don't want to silently skip it.
|
||||||
puts 'No local package file found, skipping check.'.lightred if caller_locations(1, 2)[0].to_s.split[3].split('_')[0].split('#')[1].to_s == 'check'
|
puts 'No local package file found, skipping check.'.lightred if operation == 'check'
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -42,9 +45,6 @@ class Command
|
|||||||
to_copy_test = force
|
to_copy_test = force
|
||||||
to_copy_filelist = force
|
to_copy_filelist = force
|
||||||
|
|
||||||
# This pulls the operation from the calling function.
|
|
||||||
operation = caller_locations(1, 2)[0].to_s.split[3].split('_')[0].split('#')[1]
|
|
||||||
|
|
||||||
# Prompt to copy the local repo package to crew if the package is not found.
|
# Prompt to copy the local repo package to crew if the package is not found.
|
||||||
if !force && File.file?(local_package) && !File.file?(crew_package)
|
if !force && File.file?(local_package) && !File.file?(crew_package)
|
||||||
puts "The crew package #{crew_package} does not exist.".yellow
|
puts "The crew package #{crew_package} does not exist.".yellow
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ require 'etc'
|
|||||||
require 'open3'
|
require 'open3'
|
||||||
|
|
||||||
OLD_CREW_VERSION = defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
|
OLD_CREW_VERSION = defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
|
||||||
CREW_VERSION = '1.70.0' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
CREW_VERSION = '1.70.1' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
||||||
|
|
||||||
# Kernel architecture.
|
# Kernel architecture.
|
||||||
KERN_ARCH = Etc.uname[:machine]
|
KERN_ARCH = Etc.uname[:machine]
|
||||||
|
|||||||
@@ -31,17 +31,17 @@ def check_libraries(pkg_path, verbose: false)
|
|||||||
else
|
else
|
||||||
valid_libraries = `grep -E "^#{CREW_LIB_PREFIX}/" "#{filelist}" | grep -vE "^#{CREW_PREFIX}/libexec/" | grep -vE "^#{CREW_PREFIX}/lib/perl" | grep -vE "^#{CREW_PREFIX}/lib/python"`.chomp
|
valid_libraries = `grep -E "^#{CREW_LIB_PREFIX}/" "#{filelist}" | grep -vE "^#{CREW_PREFIX}/libexec/" | grep -vE "^#{CREW_PREFIX}/lib/perl" | grep -vE "^#{CREW_PREFIX}/lib/python"`.chomp
|
||||||
if valid_libraries.empty?
|
if valid_libraries.empty?
|
||||||
puts 'All libraries:'
|
puts 'Invalid libraries:'.lightred
|
||||||
puts libraries
|
puts libraries.lightred
|
||||||
puts 'Invalid library paths.'.lightred
|
|
||||||
puts "Library test for #{name} failed.".lightred
|
puts "Library test for #{name} failed.".lightred
|
||||||
return 1
|
return 1
|
||||||
elsif libraries != valid_libraries
|
elsif libraries != valid_libraries
|
||||||
puts 'All libraries:'
|
libraries_array = libraries.split("\n")
|
||||||
puts libraries
|
valid_libraries_array = valid_libraries.split("\n")
|
||||||
puts 'Valid libraries:'
|
invalid_libraries_array = libraries_array - valid_libraries_array
|
||||||
puts valid_libraries
|
invalid_libraries = invalid_libraries_array.join("\n")
|
||||||
puts 'Invalid library paths.'.lightred
|
puts 'Invalid libraries:'.lightred
|
||||||
|
puts invalid_libraries.lightred
|
||||||
puts "Library test for #{name} failed.".lightred
|
puts "Library test for #{name} failed.".lightred
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user