Commit 35515c65 authored by Ed Reel's avatar Ed Reel Committed by Chris Thurber

Add reinstall command (#3730)

parent 1c03c690
......@@ -90,6 +90,7 @@ Where available commands are:
* install - `install package(s) along with dependencies after prompting for confirmation`
* list - `available or installed packages`
* postinstall - `display postinstall messages of package(s)`
* reinstall - `remove and install package(s)`
* remove - `remove package(s)`
* search - `look for package(s)`
* update - `update crew itself`
......
......@@ -28,6 +28,7 @@ Usage:
crew install [-k|--keep] [-s|--build-from-source] [-S|--recursive-build] [-v|--verbose] <name> ...
crew list (available|installed)
crew postinstall <name> ...
crew reinstall [-v|--verbose] <name> ...
crew remove [-v|--verbose] <name> ...
crew search [-v|--verbose] [<name> ...]
crew update
......@@ -206,6 +207,10 @@ def help (pkgName)
puts "Display postinstall messages of package(s)."
puts "Usage: crew postinstall <package1> [<package2> ...]"
puts "The package(s) must be currently installed."
when "reinstall"
puts "Remove and install package(s)."
puts "Usage: crew reinstall [-v|--verbose] <package1> [<package2> ...]"
puts "If `-v` or `--verbose` is present, extra information will be displayed."
when "remove"
puts "Remove package(s)."
puts "Usage: crew remove [-v|--verbose] <package1> [<package2> ...]"
......@@ -240,7 +245,7 @@ def help (pkgName)
puts "Usage: crew whatprovides <pattern> ..."
puts "The <pattern> is a search string which can contain regular expressions."
else
puts "Available commands: build, const, download, files, install, list ,remove, search, update, upgrade, whatprovides"
puts "Available commands: build, const, download, files, install, list, postinstall, reinstall ,remove, search, update, upgrade, whatprovides"
end
end
......@@ -943,6 +948,15 @@ def postinstall_command (args)
end
end
def reinstall_command (args)
args["<name>"].each do |name|
remove name
@pkgName = name
search @pkgName
install
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.2.6'
CREW_VERSION = '1.2.7'
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