1 |
#!/bin/sh |
#!/bin/bash |
2 |
# Magellan Linux Installer (mage.sh) |
# Magellan Linux Installer (mage.sh) |
3 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.sh,v 1.13 2006-04-27 11:52:59 niro Exp $ |
# $Id$ |
4 |
|
|
5 |
# default die function |
# default die function |
6 |
die() |
die() |
7 |
{ |
{ |
8 |
|
xtitleclean |
9 |
|
mqueryfeature "debug" && echo -e ${COLRED}"Exited ${BASH_SOURCE} at line no ${BASH_LINENO}."${COLDEFAULT} |
10 |
echo -e ${COLRED}"$@"${COLDEFAULT} |
echo -e ${COLRED}"$@"${COLDEFAULT} |
11 |
exit 1 |
exit 1 |
12 |
} |
} |
16 |
source /etc/mage.rc.global || \ |
source /etc/mage.rc.global || \ |
17 |
die "/etc/mage.rc.global missing" |
die "/etc/mage.rc.global missing" |
18 |
|
|
19 |
[ -f /etc/mage.rc ] && source /etc/mage.rc || \ |
[ -f ${MAGERC} ] && source ${MAGERC} || \ |
20 |
die "Your /etc/mage.rc is missing. Aborting." |
die "Your ${MAGERC} is missing. Aborting." |
21 |
|
|
22 |
[ -f ${MLIBDIR}/mage4.functions.sh ] && \ |
[ -f ${MLIBDIR}/mage4.functions.sh ] && \ |
23 |
source ${MLIBDIR}/mage4.functions.sh || \ |
source ${MLIBDIR}/mage4.functions.sh || \ |
24 |
die "mage functions missing" |
die "mage functions missing" |
25 |
|
|
|
## only for tests -> normally in /etc/rc.d/init.d/functions |
|
|
COLRED="\033[1;6m\033[31m" |
|
|
COLGREEN="\033[1;6m\033[32m" |
|
|
COLYELLOW="\033[1;6m\033[33m" |
|
|
COLBLUE="\033[1;6m\033[34m" |
|
|
COLMAGENTA="\033[1;6m\033[35m" |
|
|
COLWHITE="\033[1;6m\033[37m" |
|
|
COLGRAY="\033[0;6m\033[37m" |
|
|
COLBOLD="\033[1m" |
|
|
COLDEFAULT="\033[0m" |
|
|
|
|
|
if [[ ${NOCOLORS} = true ]] |
|
|
then |
|
|
COLRED="" |
|
|
COLGREEN="" |
|
|
COLYELLOW="" |
|
|
COLBLUE="" |
|
|
COLMAGENTA="" |
|
|
COLWHITE="" |
|
|
COLGRAY="" |
|
|
COLBOLD="" |
|
|
COLDEFAULT="" |
|
|
fi |
|
|
|
|
26 |
# export default path |
# export default path |
27 |
export PATH="${PATH}:${MLIBDIR}" |
export PATH="${PATH}:${MLIBDIR}" |
28 |
|
|
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 ]] |
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 mage-tree" |
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" |
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" |
71 |
echo " srcuppretend - pretend dependencies for a system upgrade from source" |
echo " srcuppretend - pretend dependencies for a system upgrade from source" |
72 |
echo " srcupgrade - runs a complete system upgrade from source" |
echo " srcupgrade - runs a complete system upgrade from source" |
73 |
|
echo " pretend-build-prerequisites - prints build prerequisites" |
74 |
|
echo " install-build-prerequisites - install build prerequisites" |
75 |
|
echo " run-preinstall - runs preinstall part of an installed package" |
76 |
|
echo " run-postinstall - runs postinstall part of an installed package" |
77 |
echo " search - searches mage-tree for a package" |
echo " search - searches mage-tree for a package" |
78 |
echo " clean - removes *all* downloaded packages" |
echo " clean - removes *all* downloaded packages" |
79 |
echo " unpack - unpacks *all* needed package for 'foo'" |
echo " unpack - unpacks *all* needed package for 'foo'" |
80 |
echo " download - downloads *all* needed packages for 'foo'" |
echo " download - downloads *all* needed packages for 'foo'" |
81 |
|
echo " print-features - prints all enabled mage-features" |
82 |
echo " version - prints version info" |
echo " version - prints version info" |
83 |
echo " regen-mage-tree - regenerates the whole mage database (for devs only)" |
echo " regen-mage-tree - regenerates the whole mage database (for devs only)" |
84 |
echo |
echo |
104 |
# install method |
# install method |
105 |
METHOD="$1" |
METHOD="$1" |
106 |
|
|
107 |
# initial unversionized packagename, gets overridden later |
# initial unversionized packagename, gets overridden later on |
108 |
MAGENAME="$2" |
MAGENAME="$2" |
109 |
|
|
110 |
if [[ ${METHOD} != upgrade ]] && \ |
if [[ ${METHOD} != upgrade ]] && |
111 |
[[ ${METHOD} != srcupgrade ]] && \ |
[[ ${METHOD} != srcupgrade ]] && |
112 |
[[ ${METHOD} != uppretend ]] && \ |
[[ ${METHOD} != uppretend ]] && |
113 |
[[ ${METHOD} != srcuppretend ]] && \ |
[[ ${METHOD} != srcuppretend ]] && |
114 |
[[ ${METHOD} != update ]] && \ |
[[ ${METHOD} != update ]] && |
115 |
[[ ${METHOD} != clean ]] && \ |
[[ ${METHOD} != update-rsync ]] && |
116 |
[[ ${METHOD} != version ]] && \ |
[[ ${METHOD} != update-tarball ]] && |
117 |
[[ ${METHOD} != search ]] && \ |
[[ ${METHOD} != clean ]] && |
118 |
[[ ${METHOD} != regen-mage-tree ]] |
[[ ${METHOD} != version ]] && |
119 |
|
[[ ${METHOD} != search ]] && |
120 |
|
[[ ${METHOD} != regen-mage-tree ]] && |
121 |
|
[[ ${METHOD} != print-features ]] |
122 |
then |
then |
123 |
[[ -z ${METHOD} ]] || [[ -z ${MAGENAME} ]] && print_usage && exit 1 |
[[ -z ${METHOD} ]] || [[ -z ${MAGENAME} ]] && print_usage && exit 1 |
124 |
fi |
fi |
133 |
# before anything run mage_setup |
# before anything run mage_setup |
134 |
mage_setup || die "error in mage_setup()" |
mage_setup || die "error in mage_setup()" |
135 |
|
|
136 |
|
# load supported mage features |
137 |
|
load_mage_features |
138 |
|
|
139 |
|
# query debug mode |
140 |
|
if mqueryfeature "debug" |
141 |
|
then |
142 |
|
depwalker_debug="--debug" |
143 |
|
else |
144 |
|
depwalker_debug="" |
145 |
|
fi |
146 |
|
|
147 |
case ${METHOD} in |
case ${METHOD} in |
148 |
download) |
download) |
149 |
|
have_root_privileges || die "You must be root to run this operation." |
150 |
|
|
151 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
152 |
PCAT="$(pname2pcat ${MAGENAME})" |
PCAT="$(pname2pcat ${MAGENAME})" |
153 |
|
|
157 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
158 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
159 |
|
|
160 |
# package does not exists |
# package is masked |
161 |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
162 |
|
|
163 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
164 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
172 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
173 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
174 |
--pver ${PVER} \ |
--pver ${PVER} \ |
175 |
--pbuild ${PBUILD})" |
--pbuild ${PBUILD} \ |
176 |
|
${depwalker_debug})" |
177 |
fetch_packages ${ALLDEPS} || die "fetching packages" |
fetch_packages ${ALLDEPS} || die "fetching packages" |
178 |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
179 |
;; |
;; |
180 |
|
|
181 |
srcdownload) |
srcdownload) |
182 |
|
have_root_privileges || die "You must be root to run this operation." |
183 |
|
|
184 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
185 |
PCAT="$(pname2pcat ${MAGENAME})" |
PCAT="$(pname2pcat ${MAGENAME})" |
186 |
|
|
190 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
191 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
192 |
|
|
193 |
# package does not exists |
# package is masked |
194 |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
195 |
|
|
196 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
197 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
205 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
206 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
207 |
--pver ${PVER} \ |
--pver ${PVER} \ |
208 |
--pbuild ${PBUILD})" |
--pbuild ${PBUILD} \ |
209 |
|
${depwalker_debug})" |
210 |
fetch_packages ${ALLDEPS} || die "fetching packages" |
fetch_packages ${ALLDEPS} || die "fetching packages" |
211 |
;; |
;; |
212 |
|
|
213 |
pretend|srcpretend) |
pretend|srcpretend|pretend-build-prerequisites) |
214 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
215 |
PCAT="$(pname2pcat ${MAGENAME})" |
PCAT="$(pname2pcat ${MAGENAME})" |
216 |
|
|
220 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
221 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
222 |
|
|
223 |
# package does not exists |
# package is masked |
224 |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
225 |
|
|
226 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
227 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
243 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
244 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
245 |
--pver ${PVER} \ |
--pver ${PVER} \ |
246 |
--pbuild ${PBUILD} |
--pbuild ${PBUILD} \ |
247 |
|
${depwalker_debug} |
248 |
;; |
;; |
249 |
|
|
250 |
install) |
install|install-build-prerequisites) |
251 |
|
have_root_privileges || die "You must be root to run this operation." |
252 |
|
|
253 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
254 |
PCAT="$(pname2pcat ${MAGENAME})" |
PCAT="$(pname2pcat ${MAGENAME})" |
255 |
|
|
259 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
260 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
261 |
|
|
262 |
# package does not exists |
# package is masked |
263 |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
264 |
|
|
265 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
266 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
282 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
283 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
284 |
--pver ${PVER} \ |
--pver ${PVER} \ |
285 |
--pbuild ${PBUILD})" |
--pbuild ${PBUILD} \ |
286 |
|
${depwalker_debug})" |
287 |
|
|
288 |
# first fetch all packages |
# first fetch all packages |
289 |
fetch_packages ${ALLDEPS} || die "fetching packages" |
fetch_packages ${ALLDEPS} || die "fetching packages" |
290 |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
|
unpack_packages ${ALLDEPS} || die "unpacking packages" |
|
291 |
install_packages ${ALLDEPS} || die "installing packages" |
install_packages ${ALLDEPS} || die "installing packages" |
292 |
;; |
;; |
293 |
|
|
294 |
srcinstall) |
srcinstall) |
295 |
|
have_root_privileges || die "You must be root to run this operation." |
296 |
|
|
297 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
298 |
PCAT="$(pname2pcat ${MAGENAME})" |
PCAT="$(pname2pcat ${MAGENAME})" |
299 |
|
|
303 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
304 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
305 |
|
|
306 |
# package does not exists |
# package is masked |
307 |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
308 |
|
|
309 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
310 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
326 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
327 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
328 |
--pver ${PVER} \ |
--pver ${PVER} \ |
329 |
--pbuild ${PBUILD})" |
--pbuild ${PBUILD} \ |
330 |
|
${depwalker_debug})" |
331 |
|
|
332 |
install_packages --src-install ${ALLDEPS} || die "src-installing packages" |
install_packages --src-install ${ALLDEPS} || die "src-installing packages" |
333 |
;; |
;; |
334 |
|
|
335 |
uninstall) |
uninstall) |
336 |
ALLDEPS="$(get_uninstall_candidates --pname ${MAGENAME})" |
have_root_privileges || die "You must be root to run this operation." |
337 |
if [ -z "${ALLDEPS}" ] |
|
338 |
then |
ALLDEPS="$(get_uninstall_candidates --pname ${MAGENAME})" |
339 |
die "No package installed named '${MAGENAME}'." |
if [ -z "${ALLDEPS}" ] |
340 |
fi |
then |
341 |
uninstall_packages ${ALLDEPS} |
die "No package installed named '${MAGENAME}'." |
342 |
|
fi |
343 |
|
uninstall_packages ${ALLDEPS} |
344 |
|
;; |
345 |
|
|
346 |
|
run-preinstall|run-postinstall) |
347 |
|
have_root_privileges || die "You must be root to run this operation." |
348 |
|
|
349 |
|
ALLDEPS="$(get_uninstall_candidates --pname ${MAGENAME})" |
350 |
|
if [ -z "${ALLDEPS}" ] |
351 |
|
then |
352 |
|
die "No package installed named '${MAGENAME}'." |
353 |
|
fi |
354 |
|
rerun_pkgfunctions --method "${METHOD//run-}" ${ALLDEPS} |
355 |
;; |
;; |
356 |
|
|
357 |
uppretend|srcuppretend) |
uppretend|srcuppretend) |
360 |
--pcat ${METHOD} \ |
--pcat ${METHOD} \ |
361 |
--pname ${METHOD} \ |
--pname ${METHOD} \ |
362 |
--pver ${METHOD} \ |
--pver ${METHOD} \ |
363 |
--pbuild ${METHOD} |
--pbuild ${METHOD} \ |
364 |
|
${depwalker_debug} |
365 |
;; |
;; |
366 |
|
|
367 |
upgrade) |
upgrade) |
368 |
|
have_root_privileges || die "You must be root to run this operation." |
369 |
|
|
370 |
# get all dependencies of *all* installed packages |
# get all dependencies of *all* installed packages |
371 |
# fake pcat,pname,pver,pbuild ... |
# fake pcat,pname,pver,pbuild ... |
372 |
ALLDEPS="$(${MLIBDIR}/depwalker.sh \ |
ALLDEPS="$(${MLIBDIR}/depwalker.sh \ |
374 |
--pcat ${METHOD} \ |
--pcat ${METHOD} \ |
375 |
--pname ${METHOD} \ |
--pname ${METHOD} \ |
376 |
--pver ${METHOD} \ |
--pver ${METHOD} \ |
377 |
--pbuild ${METHOD})" |
--pbuild ${METHOD} \ |
378 |
|
${depwalker_debug})" |
379 |
|
|
380 |
# first fetch all packages |
# first fetch all packages |
381 |
fetch_packages ${ALLDEPS} || die "fetching packages" |
fetch_packages ${ALLDEPS} || die "fetching packages" |
382 |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
|
unpack_packages ${ALLDEPS} || die "unpacking packages" |
|
383 |
install_packages ${ALLDEPS} || die "installing packages" |
install_packages ${ALLDEPS} || die "installing packages" |
384 |
;; |
;; |
385 |
|
|
386 |
srcupgrade) |
srcupgrade) |
387 |
|
have_root_privileges || die "You must be root to run this operation." |
388 |
|
|
389 |
# get all dependencies of *all* installed packages |
# get all dependencies of *all* installed packages |
390 |
# fake pcat,pname,pver,pbuild ... |
# fake pcat,pname,pver,pbuild ... |
391 |
ALLDEPS="$(${MLIBDIR}/depwalker.sh \ |
ALLDEPS="$(${MLIBDIR}/depwalker.sh \ |
393 |
--pcat ${METHOD} \ |
--pcat ${METHOD} \ |
394 |
--pname ${METHOD} \ |
--pname ${METHOD} \ |
395 |
--pver ${METHOD} \ |
--pver ${METHOD} \ |
396 |
--pbuild ${METHOD})" |
--pbuild ${METHOD} \ |
397 |
|
${depwalker_debug})" |
398 |
|
|
399 |
install_packages --src-install ${ALLDEPS} || die "src-installing packages" |
install_packages --src-install ${ALLDEPS} || die "src-installing packages" |
400 |
;; |
;; |
404 |
;; |
;; |
405 |
|
|
406 |
unpack) |
unpack) |
407 |
|
have_root_privileges || die "You must be root to run this operation." |
408 |
|
|
409 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
410 |
PCAT="$(pname2pcat ${MAGENAME})" |
PCAT="$(pname2pcat ${MAGENAME})" |
411 |
|
|
415 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
416 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
417 |
|
|
418 |
# package does not exists |
# package is masked |
419 |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' does not exist." |
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
420 |
|
|
421 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
422 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
430 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
431 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
432 |
--pver ${PVER} \ |
--pver ${PVER} \ |
433 |
--pbuild ${PBUILD})" |
--pbuild ${PBUILD} \ |
434 |
|
${depwalker_debug})" |
435 |
|
|
436 |
fetch_packages ${ALLDEPS} || die "fetching packages" |
fetch_packages ${ALLDEPS} || die "fetching packages" |
437 |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
438 |
unpack_packages ${ALLDEPS} || die "unpacking packages" |
unpack_packages ${ALLDEPS} || die "unpacking packages" |
439 |
;; |
;; |
440 |
|
|
441 |
update) |
update) |
442 |
|
have_root_privileges || die "You must be root to run this operation." |
443 |
|
# default to tarball |
444 |
|
[[ -z ${MAGE_UPDATE_METHOD} ]] && MAGE_UPDATE_METHOD="tarball" |
445 |
|
case ${MAGE_UPDATE_METHOD} in |
446 |
|
rsync) syncmage ;; |
447 |
|
tarball) syncmage_tarball ;; |
448 |
|
*) die "Unknown MAGE_UPDATE_METHOD defined." ;; |
449 |
|
esac |
450 |
|
;; |
451 |
|
|
452 |
|
update-rsync) |
453 |
|
have_root_privileges || die "You must be root to run this operation." |
454 |
syncmage |
syncmage |
455 |
;; |
;; |
456 |
|
|
457 |
|
update-tarball) |
458 |
|
have_root_privileges || die "You must be root to run this operation." |
459 |
|
syncmage_tarball |
460 |
|
;; |
461 |
|
|
462 |
clean) |
clean) |
463 |
|
have_root_privileges || die "You must be root to run this operation." |
464 |
cleanpkg |
cleanpkg |
465 |
;; |
;; |
466 |
|
|
470 |
;; |
;; |
471 |
|
|
472 |
regen-mage-tree) |
regen-mage-tree) |
473 |
|
have_root_privileges || die "You must be root to run this operation." |
474 |
|
|
475 |
if [ -z "${SMAGESCRIPTSDIR}" ] || [ ! -d "${SMAGESCRIPTSDIR}" ] |
if [ -z "${SMAGESCRIPTSDIR}" ] || [ ! -d "${SMAGESCRIPTSDIR}" ] |
476 |
then |
then |
477 |
echo "SMAGESCRIPTSDIR not found. Check your mage.rc or check out smage repos." |
echo "SMAGESCRIPTSDIR not found. Check your mage.rc or check out smage repos." |
483 |
done |
done |
484 |
;; |
;; |
485 |
|
|
486 |
|
print-features) |
487 |
|
mprintfeatures |
488 |
|
;; |
489 |
|
|
490 |
*) |
*) |
491 |
print_usage |
print_usage |
492 |
;; |
;; |