mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-08 23:18:10 -05:00
Fix crew files command (#13806)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user