32 |
# sanity checks |
# sanity checks |
33 |
[ ! -e ${VIRTUALDB_FILE} ] && touch ${VIRTUALDB_FILE} |
[ ! -e ${VIRTUALDB_FILE} ] && touch ${VIRTUALDB_FILE} |
34 |
|
|
35 |
if [ ! -e ${VIRTUALDB_DEFAULTS} ] && [[ $1 != update ]] && [[ $1 != update-tarball ]] |
if [ ! -e ${VIRTUALDB_DEFAULTS} ] && |
36 |
|
[[ $1 != update ]] && |
37 |
|
[[ $1 != update-rsync ]] && |
38 |
|
[[ $1 != update-tarball ]] |
39 |
then |
then |
40 |
echo |
echo |
41 |
echo "Please choose an profile from the mage tree." |
echo "Please choose an profile from the mage tree." |
63 |
echo " install - installs a package" |
echo " install - installs a package" |
64 |
echo " srcinstall - installs a package from source" |
echo " srcinstall - installs a package from source" |
65 |
echo " uninstall - removes a package" |
echo " uninstall - removes a package" |
66 |
echo " update - updates the mage-tree via rsync" |
echo " update - updates the mage-tree via default sync method" |
67 |
|
echo " update-rsync - updates the mage-tree via rsync" |
68 |
echo " update-tarball - updates the mage-tree via a tarball" |
echo " update-tarball - updates the mage-tree via a tarball" |
69 |
echo " uppretend - pretend dependencies for a system upgrade" |
echo " uppretend - pretend dependencies for a system upgrade" |
70 |
echo " upgrade - runs a complete system upgrade" |
echo " upgrade - runs a complete system upgrade" |
110 |
[[ ${METHOD} != uppretend ]] && |
[[ ${METHOD} != uppretend ]] && |
111 |
[[ ${METHOD} != srcuppretend ]] && |
[[ ${METHOD} != srcuppretend ]] && |
112 |
[[ ${METHOD} != update ]] && |
[[ ${METHOD} != update ]] && |
113 |
|
[[ ${METHOD} != update-rsync ]] && |
114 |
[[ ${METHOD} != update-tarball ]] && |
[[ ${METHOD} != update-tarball ]] && |
115 |
[[ ${METHOD} != clean ]] && |
[[ ${METHOD} != clean ]] && |
116 |
[[ ${METHOD} != version ]] && |
[[ ${METHOD} != version ]] && |
427 |
|
|
428 |
update) |
update) |
429 |
have_root_privileges || die "You must be root to run this operation." |
have_root_privileges || die "You must be root to run this operation." |
430 |
|
# default to tarball |
431 |
|
[[ -z ${MAGE_UPDATE_METHOD} ]] && MAGE_UPDATE_METHOD="tarball" |
432 |
|
case ${MAGE_UPDATE_METHOD} in |
433 |
|
rsync) syncmage ;; |
434 |
|
tarball) syncmage_tarball ;; |
435 |
|
*) die "Unknown MAGE_UPDATE_METHOD defined." ;; |
436 |
|
esac |
437 |
|
;; |
438 |
|
|
439 |
|
update-rsync) |
440 |
|
have_root_privileges || die "You must be root to run this operation." |
441 |
syncmage |
syncmage |
442 |
;; |
;; |
443 |
|
|