39 |
mecho " methods:" |
mecho " methods:" |
40 |
mecho " install - installs given package" |
mecho " install - installs given package" |
41 |
mecho " uninstall - uninstalls given package" |
mecho " uninstall - uninstalls given package" |
42 |
|
mecho " update - updates the package database" |
43 |
|
mecho " upgrade - upgrades the whole system" |
44 |
mecho "or" |
mecho "or" |
45 |
mecho "get mage.package [method] [package]" |
mecho "get mage.package [method] [package]" |
46 |
mecho " package information operations" |
mecho " package information operations" |
54 |
local method="$1" |
local method="$1" |
55 |
local package="$2" |
local package="$2" |
56 |
[[ -z ${method} ]] && help_mage_package && return 1 |
[[ -z ${method} ]] && help_mage_package && return 1 |
|
[[ -z ${package} ]] && help_mage_package && return 1 |
|
57 |
|
|
58 |
case ${method} in |
case ${method} in |
59 |
install|uninstall) mage "${method}" "${package}" && mecho "done" || mecho "failed" ;; |
install|uninstall) |
60 |
|
[[ -z ${package} ]] && help_mage_package && return |
61 |
|
mage "${method}" "${package}" && mecho "done" || mecho "failed" |
62 |
|
;; |
63 |
|
update|upgrade) |
64 |
|
mage "${method}" && mecho "done" || mecho "failed" |
65 |
|
;; |
66 |
*) help_mage_package && return 1 ;; |
*) help_mage_package && return 1 ;; |
67 |
esac |
esac |
68 |
} |
} |