Commit 4ffdf54e authored by Ed Reel's avatar Ed Reel Committed by Chris Thurber

Add postinstall command to crew (#3108)

parent 68993069
......@@ -84,6 +84,7 @@ Where available commands are:
* help - `get information about command usage`
* install - `install package(s) along with dependencies after prompting for confirmation`
* list - `available or installed packages`
* postinstall - `display postinstall messages of package(s)`
* remove - `remove package(s)`
* search - `look for package(s)`
* update - `update crew itself`
......
......@@ -27,6 +27,7 @@ Usage:
crew help [<command>]
crew install [-k|--keep] [-s|--build-from-source] [-S|--recursive-build] [-v|--verbose] <name> ...
crew list (available|installed)
crew postinstall <name> ...
crew remove [-v|--verbose] <name> ...
crew search [-v|--verbose] [<name> ...]
crew update
......@@ -201,6 +202,10 @@ def help (pkgName)
when "list"
puts "List available or installed packages"
puts "Usage: crew list (available|installed)"
when "postinstall"
puts "Display postinstall messages of package(s)."
puts "Usage: crew postinstall <package1> [<package2> ...]"
puts "The package(s) must be currently installed."
when "remove"
puts "Remove package(s)."
puts "Usage: crew remove [-v|--verbose] <package1> [<package2> ...]"
......@@ -477,7 +482,7 @@ end
def build_and_preconfigure (target_dir)
Dir.chdir target_dir do
puts "Building from source, this may take a while..."
puts "Building from source, this may take a while..."
# Rename *.la files temporily to *.la_tmp to avoid
# libtool: link: '*.la' is not a valid libtool archive.
......@@ -927,6 +932,17 @@ def list_command (args)
end
end
def postinstall_command (args)
args["<name>"].each do |name|
set_package name, true
if @device[:installed_packages].any? do |elem| elem[:name] == name end
@pkg.postinstall
else
puts "Package #{name} is not installed. :(".lightred
end
end
end
def remove_command (args)
args["<name>"].each do |name|
remove name
......
# Defines common constants used in different parts of crew
CREW_VERSION = '1.1.1'
CREW_VERSION = '1.1.2'
ARCH = `uname -m`.strip
ARCH_LIB = if ARCH == 'x86_64' then 'lib64' else 'lib' end
......
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