Fix crew files command (#13806)

This commit is contained in:
Ed Reel
2025-12-11 11:00:39 -06:00
committed by GitHub
parent b4f06001da
commit c92d7e4562
4 changed files with 26 additions and 21 deletions

View File

@@ -4,7 +4,7 @@ require 'etc'
require 'open3'
OLD_CREW_VERSION = defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
CREW_VERSION = '1.68.8' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
CREW_VERSION = '1.68.9' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
# Kernel architecture.
KERN_ARCH = Etc.uname[:machine]
@@ -497,7 +497,7 @@ CREW_DOCOPT = <<~DOCOPT
crew deps [options] [--deep] [-t|--tree] [-b|--include-build-deps] [--exclude-buildessential] [-v|--verbose] <name> ...
crew diskstat [options] [-a|--all] [<count>]
crew download [options] [-s|--source] [-v|--verbose] <name> ...
crew files [options] <name> ...
crew files [options] [-v|--verbose] <name> ...
crew help [options] [<command>] [-v|--verbose] [<subcommand>]
crew install [options] [-f|--force] [-k|--keep] [--regenerate-filelist] [-s|--source] [-S|--recursive-build] [-v|--verbose] <name> ...
crew list [options] [-v|--verbose] (available|compatible|incompatible|essential|installed)

View File

@@ -64,10 +64,8 @@ class ConvenienceFunctions
def self.read_filelist(path, always_calcuate_from_disk: false)
filelist = File.readlines(path, chomp: true)
if filelist.first&.start_with?('# Total size') && !always_calcuate_from_disk
total_size, *contents = filelist
return [total_size[/Total size: (\d+)/, 1].to_i, contents]
return [filelist.first[/Total size: (\d+)/, 1].to_i, filelist]
else
return [get_package_disk_size(filelist), filelist]
end