From fcce2116b02b5719039f0f331fd81648f264bcdc Mon Sep 17 00:00:00 2001 From: Maximilian Downey Twiss Date: Thu, 6 Mar 2025 14:13:23 +1100 Subject: [PATCH] Rework wildcard parameters in crew upstream (#11471) Co-authored-by: Ed Reel --- bin/crew | 11 +++-------- lib/const.rb | 2 +- tools/version.rb | 8 +++----- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/bin/crew b/bin/crew index d3f548411..16dfaa727 100755 --- a/bin/crew +++ b/bin/crew @@ -1817,14 +1817,9 @@ def upload_command(args) end def upstream_command(args) - puts "#{'Package'.ljust(35)}#{'Status'.ljust(20)}#{'Current'.ljust(20)}Upstream" - puts "#{'-------'.ljust(35)}#{'------'.ljust(20)}#{'-------'.ljust(20)}--------" - args[''].each do |name| - name.gsub!('.rb', '') - search name - Dir.chdir CREW_PACKAGES_PATH do - system "../tools/version.rb #{name} #{@short_verbose} -n" - end + # Pass the whole argument input to tools/version.rb, stripping out any file extensions that occur as a result of using a wildcard argument in a directory where it matches files. + Dir.chdir CREW_PACKAGES_PATH do + system "../tools/version.rb #{args[''].join(' ').gsub('.rb', '')} #{@short_verbose}" end end diff --git a/lib/const.rb b/lib/const.rb index bbb917f73..1a1e91304 100644 --- a/lib/const.rb +++ b/lib/const.rb @@ -3,7 +3,7 @@ require 'etc' OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0' -CREW_VERSION ||= '1.57.5' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION +CREW_VERSION ||= '1.57.6' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION # Kernel architecture. KERN_ARCH ||= Etc.uname[:machine] diff --git a/tools/version.rb b/tools/version.rb index 34f1e8629..077bbeb57 100755 --- a/tools/version.rb +++ b/tools/version.rb @@ -2,7 +2,7 @@ if ARGV.include?('-h') || ARGV.include?('--help') abort <<~EOM - Usage: ./version.rb [] [-h, --help, -n, --no-header, -v, --verbose] + Usage: ./version.rb [] [-h, --help, -v, --verbose] Example: ./version.rb abcde -v The can contain '*': ./version.rb xorg_* If is omitted, all packages will be checked. @@ -104,10 +104,8 @@ else end if filelist.length.positive? - unless ARGV.include?('-n') || ARGV.include?('--no-header') - puts "#{'Package'.ljust(35)}#{'Status'.ljust(20)}#{'Current'.ljust(20)}Upstream" - puts "#{'-------'.ljust(35)}#{'------'.ljust(20)}#{'-------'.ljust(20)}--------" - end + puts "#{'Package'.ljust(35)}#{'Status'.ljust(20)}#{'Current'.ljust(20)}Upstream" + puts "#{'-------'.ljust(35)}#{'------'.ljust(20)}#{'-------'.ljust(20)}--------" filelist.each do |filename| pkg = Package.load_package(filename) # Instead of typing out the name of every python package, we just use a regex here.