Commit 4accb25d authored by Damian Montero's avatar Damian Montero Committed by GitHub

Merge pull request #1233 from uberhacker/add-crew-files-command

Add crew files command
parents 186385c2 cda8c3ae
...@@ -21,6 +21,7 @@ Chromebrew - Package manager for Chrome OS http://skycocker.github.io/chromebrew ...@@ -21,6 +21,7 @@ Chromebrew - Package manager for Chrome OS http://skycocker.github.io/chromebrew
Usage: Usage:
crew build [-k|--keep] <name> ... crew build [-k|--keep] <name> ...
crew download <name> ... crew download <name> ...
crew files <name> ...
crew help [<command>] crew help [<command>]
crew install [-k|--keep] [-s|--build-from-source] <name> ... crew install [-k|--keep] [-s|--build-from-source] <name> ...
crew remove <name> ... crew remove <name> ...
...@@ -132,6 +133,10 @@ def help (pkgName) ...@@ -132,6 +133,10 @@ def help (pkgName)
puts "Download package(s)." puts "Download package(s)."
puts "Usage: crew download <package1> [<package2> ...]" puts "Usage: crew download <package1> [<package2> ...]"
puts "Download package(s) to `CREW_BREW_DIR` (#{CREW_BREW_DIR}), but don't install." puts "Download package(s) to `CREW_BREW_DIR` (#{CREW_BREW_DIR}), but don't install."
when "files"
puts "Display installed files of package(s)."
puts "Usage: crew files <package1> [<package2> ...]"
puts "The package(s) must be currently installed."
when "install" when "install"
puts "Install package(s)." puts "Install package(s)."
puts "Usage: crew install [-k|--keep] [-s|--build-from-source] <package1> [<package2> ...]" puts "Usage: crew install [-k|--keep] [-s|--build-from-source] <package1> [<package2> ...]"
...@@ -169,7 +174,18 @@ def help (pkgName) ...@@ -169,7 +174,18 @@ def help (pkgName)
puts "Usage: crew whatprovides <pattern> ..." puts "Usage: crew whatprovides <pattern> ..."
puts "The <pattern> is a search string which can contain regular expressions." puts "The <pattern> is a search string which can contain regular expressions."
else else
puts "Available commands: build, download, install, remove, search, update, upgrade, whatprovides" puts "Available commands: build, download, files, install, remove, search, update, upgrade, whatprovides"
end
end
def files (pkgName)
filelist = "#{CREW_PREFIX}/etc/crew/meta/#{pkgName}.filelist"
if File.exists? "#{filelist}"
system "sort #{filelist}"
lines = `wc -l "#{filelist}"`.strip.split(' ')[0].to_i
puts "Total found: #{lines}".lightgreen
else
puts "Package #{pkgName} is not installed. :(".lightred
end end
end end
...@@ -695,6 +711,14 @@ def download_command (args) ...@@ -695,6 +711,14 @@ def download_command (args)
end end
end end
def files_command (args)
args["<name>"].each do |name|
@pkgName = name
search @pkgName
files name
end
end
def help_command (args) def help_command (args)
if args["<command>"] if args["<command>"]
help args["<command>"] help args["<command>"]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment