Return invalid libraries only for library test (#14030)

This commit is contained in:
Ed Reel
2026-01-03 17:39:09 -06:00
committed by GitHub
parent 7b2ea372f5
commit 7d7c347acb
3 changed files with 13 additions and 13 deletions

View File

@@ -15,10 +15,13 @@ class Command
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)
# 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.
unless File.file?(local_package)
# 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
end
@@ -42,9 +45,6 @@ class Command
to_copy_test = 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.
if !force && File.file?(local_package) && !File.file?(crew_package)
puts "The crew package #{crew_package} does not exist.".yellow

View File

@@ -4,7 +4,7 @@ require 'etc'
require 'open3'
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.
KERN_ARCH = Etc.uname[:machine]

View File

@@ -31,17 +31,17 @@ def check_libraries(pkg_path, verbose: false)
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
if valid_libraries.empty?
puts 'All libraries:'
puts libraries
puts 'Invalid library paths.'.lightred
puts 'Invalid libraries:'.lightred
puts libraries.lightred
puts "Library test for #{name} failed.".lightred
return 1
elsif libraries != valid_libraries
puts 'All libraries:'
puts libraries
puts 'Valid libraries:'
puts valid_libraries
puts 'Invalid library paths.'.lightred
libraries_array = libraries.split("\n")
valid_libraries_array = valid_libraries.split("\n")
invalid_libraries_array = libraries_array - valid_libraries_array
invalid_libraries = invalid_libraries_array.join("\n")
puts 'Invalid libraries:'.lightred
puts invalid_libraries.lightred
puts "Library test for #{name} failed.".lightred
return 1
else