Commit 488b60b9 authored by satmandu's avatar satmandu Committed by GitHub

crew deps (#5733)

* crew deps

* Add deps

* bump

* Add deps to readme
parent 71f495c5
...@@ -79,6 +79,7 @@ Where available commands are: ...@@ -79,6 +79,7 @@ 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`
* const - `display constant(s)` * const - `display constant(s)`
* deps - `display dependencies of package(s)`
* download - `download package(s) to CREW_BREW_DIR (/usr/local/tmp/crew by default), but don't install` * download - `download package(s) to CREW_BREW_DIR (/usr/local/tmp/crew by default), but don't install`
* files - `display installed files of package(s)` * files - `display installed files of package(s)`
* help - `get information about command usage` * help - `get information about command usage`
......
...@@ -23,6 +23,7 @@ Chromebrew - Package manager for Chrome OS http://skycocker.github.io/chromebrew ...@@ -23,6 +23,7 @@ Chromebrew - Package manager for Chrome OS http://skycocker.github.io/chromebrew
Usage: Usage:
crew build [options] [-k|--keep] <name> ... crew build [options] [-k|--keep] <name> ...
crew const [options] [<name> ...] crew const [options] [<name> ...]
crew deps [options] <name> ...
crew download [options] <name> ... crew download [options] <name> ...
crew files [options] <name> ... crew files [options] <name> ...
crew help [<command>] crew help [<command>]
...@@ -73,7 +74,7 @@ ENV["XZ_OPT"] = ENV['CREW_XZ_OPT'] || "-7e -T #{CREW_NPROC}" ...@@ -73,7 +74,7 @@ ENV["XZ_OPT"] = ENV['CREW_XZ_OPT'] || "-7e -T #{CREW_NPROC}"
CURL = ENV['CURL'] || 'curl' CURL = ENV['CURL'] || 'curl'
# All available crew commands. # All available crew commands.
@cmds = ["build", "const", "download", "files", "help", "install", "list", "postinstall", "reinstall", "remove", "search", "update", "upgrade", "whatprovides"] @cmds = ["build", "const", "deps", "download", "files", "help", "install", "list", "postinstall", "reinstall", "remove", "search", "update", "upgrade", "whatprovides"]
# Parse arguments using docopt # Parse arguments using docopt
require_relative '../lib/docopt' require_relative '../lib/docopt'
...@@ -322,6 +323,9 @@ def help(pkgName) ...@@ -322,6 +323,9 @@ def help(pkgName)
puts "Display constant(s)." puts "Display constant(s)."
puts "Usage: crew const [<const1> <const2> ...]" puts "Usage: crew const [<const1> <const2> ...]"
puts "If no constants are provided, all constants will be displayed." puts "If no constants are provided, all constants will be displayed."
when "deps"
puts "Display dependencies of package(s)."
puts "Usage: crew deps <package1> [<package2> ...]"
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> ...]"
...@@ -982,7 +986,7 @@ def expand_dependencies ...@@ -982,7 +986,7 @@ def expand_dependencies
# check all dependencies recursively # check all dependencies recursively
check_deps.each do |dep| check_deps.each do |dep|
# build unique dependencies list # build unique dependencies list
unless @dependencies.include?(dep) || dep == @pkgName unless @dependencies&.include?(dep) || dep == @pkgName
@dependencies << dep @dependencies << dep
search dep, true search dep, true
push_dependencies push_dependencies
...@@ -1256,15 +1260,6 @@ def build_command(args) ...@@ -1256,15 +1260,6 @@ def build_command(args)
end end
end end
def download_command(args)
args["<name>"].each do |name|
@pkgName = name
search @pkgName
print_current_package @opt_verbose
download
end
end
def const_command(args) def const_command(args)
unless args["<name>"].empty? unless args["<name>"].empty?
args["<name>"].each do |name| args["<name>"].each do |name|
...@@ -1275,6 +1270,26 @@ def const_command(args) ...@@ -1275,6 +1270,26 @@ def const_command(args)
end end
end end
def deps_command(args)
args["<name>"].each do |name|
@dependencies = []
@pkgName = name
search @pkgName
print_current_package
expand_dependencies
puts @dependencies
end
end
def download_command(args)
args["<name>"].each do |name|
@pkgName = name
search @pkgName
print_current_package @opt_verbose
download
end
end
def files_command(args) def files_command(args)
args["<name>"].each do |name| args["<name>"].each do |name|
@pkgName = name @pkgName = name
......
# Defines common constants used in different parts of crew # Defines common constants used in different parts of crew
CREW_VERSION = '1.9.4' CREW_VERSION = '1.9.5'
ARCH_ACTUAL = `uname -m`.strip ARCH_ACTUAL = `uname -m`.strip
# This helps with virtualized builds on aarch64 machines # This helps with virtualized builds on aarch64 machines
......
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