Commit 37621db6 authored by Ed Reel's avatar Ed Reel

Add const command

parent a0cc6548
...@@ -57,17 +57,18 @@ Usage ...@@ -57,17 +57,18 @@ Usage
Where available commands are: Where available commands are:
* build [build package(s) from source and store the archive and checksum in the current working directory] * build - `build package(s) from source and store the archive and checksum in the current working directory`
* download [download package(s) to `CREW_BREW_DIR` (`/usr/local/tmp/crew` by default), but don't install] * const - `display constant(s)`
* files [display installed files of package(s).] * download - `download package(s) to CREW_BREW_DIR (/usr/local/tmp/crew by default), but don't install`
* help [get information about command usage] * files - `display installed files of package(s)`
* install [install package(s) along with dependencies after prompting for confirmation] * help - `get information about command usage`
* list [available or installed packages] * install - `install package(s) along with dependencies after prompting for confirmation`
* remove [remove package(s)] * list - `available or installed packages`
* search [look for a package] * remove - `remove package(s)`
* update [update crew itself] * search - `look for package(s)`
* upgrade [update all or specific package(s)] * update - `update crew itself`
* whatprovides [regex search for package(s) that contains file(s)] * upgrade - `update all or specific package(s)`
* whatprovides - `regex search for package(s) that contains file(s)`
Available packages are listed in the [packages directory](https://github.com/skycocker/chromebrew/tree/master/packages). Available packages are listed in the [packages directory](https://github.com/skycocker/chromebrew/tree/master/packages).
......
...@@ -22,6 +22,7 @@ Chromebrew - Package manager for Chrome OS http://skycocker.github.io/chromebrew ...@@ -22,6 +22,7 @@ Chromebrew - Package manager for Chrome OS http://skycocker.github.io/chromebrew
Usage: Usage:
crew build [-k|--keep] [-v|--verbose] <name> ... crew build [-k|--keep] [-v|--verbose] <name> ...
crew download [-v|--verbose] <name> ... crew download [-v|--verbose] <name> ...
crew const [<name> ...]
crew files <name> ... crew files <name> ...
crew help [<command>] crew help [<command>]
crew install [-k|--keep] [-s|--build-from-source] [-v|--verbose] <name> ... crew install [-k|--keep] [-s|--build-from-source] [-v|--verbose] <name> ...
...@@ -173,6 +174,10 @@ def help (pkgName) ...@@ -173,6 +174,10 @@ def help (pkgName)
puts "Build package(s) from source and place the archive and checksum in the current working directory." puts "Build package(s) from source and place the archive and checksum in the current working directory."
puts "If `-k` or `--keep` is present, the `CREW_BREW_DIR` (#{CREW_BREW_DIR}) directory will remain." puts "If `-k` or `--keep` is present, the `CREW_BREW_DIR` (#{CREW_BREW_DIR}) directory will remain."
puts "If `-v` or `--verbose` is present, extra information will be displayed." puts "If `-v` or `--verbose` is present, extra information will be displayed."
when "const"
puts "Display constant(s)."
puts "Usage: crew const [<const1> <const2> ...]"
puts "If no constants are provided, all constants will be displayed."
when "download" when "download"
puts "Download package(s)." puts "Download package(s)."
puts "Usage: crew download [-v|--verbose] <package1> [<package2> ...]" puts "Usage: crew download [-v|--verbose] <package1> [<package2> ...]"
...@@ -229,6 +234,36 @@ def help (pkgName) ...@@ -229,6 +234,36 @@ def help (pkgName)
end end
end end
def const (var)
if var
value = eval(var)
puts "#{var}=#{value}"
else
vars = [
'ARCH',
'ARCH_LIB',
'CHROMEOS_RELEASE',
'CREW_BREW_DIR',
'CREW_CONFIG_PATH',
'CREW_DEST_DIR',
'CREW_DEST_LIB_PREFIX',
'CREW_DEST_PREFIX',
'CREW_LIB_PATH',
'CREW_LIB_PREFIX',
'CREW_NOT_COMPRESS',
'CREW_NOT_STRIP',
'CREW_NPROC',
'CREW_PREFIX',
'CREW_VERSION',
'USER'
]
vars.each { |var|
value = eval(var)
puts "#{var}=#{value}"
}
end
end
def files (pkgName) def files (pkgName)
filelist = "#{CREW_PREFIX}/etc/crew/meta/#{pkgName}.filelist" filelist = "#{CREW_PREFIX}/etc/crew/meta/#{pkgName}.filelist"
if File.exists? "#{filelist}" if File.exists? "#{filelist}"
...@@ -832,6 +867,16 @@ def download_command (args) ...@@ -832,6 +867,16 @@ def download_command (args)
end end
end end
def const_command (args)
unless args["<name>"].empty?
args["<name>"].each do |name|
const name
end
else
const nil
end
end
def files_command (args) def files_command (args)
args["<name>"].each do |name| args["<name>"].each do |name|
@pkgName = name @pkgName = name
......
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