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.9 2005-12-01 12:40:21 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.sh,v 1.17 2008-06-16 09:29:57 niro Exp $ |
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 |
|
|
|
# for tests only |
|
|
#source /home/tjoke/alx-cvs/magellan-src/mage/usr/lib/mage/mage.rc.global |
|
|
#source /etc/mage.rc |
|
|
#source /home/tjoke/alx-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh |
|
|
#MLIBDIR=/home/tjoke/alx-cvs/magellan-src/mage/usr/lib/mage |
|
|
|
|
|
## 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} ] && [[ $1 != update ]] && [[ $1 != update-tarball ]] |
36 |
then |
then |
37 |
echo |
echo |
38 |
echo "Please choose an profile from the mage tree." |
echo "Please choose an profile from the mage tree." |
41 |
fi |
fi |
42 |
|
|
43 |
# default messages |
# default messages |
44 |
showversion() { |
showversion() |
45 |
|
{ |
46 |
local MAGEVERSION="$(< ${MLIBDIR}/version)" |
local MAGEVERSION="$(< ${MLIBDIR}/version)" |
47 |
|
|
48 |
echo -en "Magellan Package Manager v${MAGEVERSION} " |
echo -en "Magellan Package Manager v${MAGEVERSION} " |
49 |
echo -e "-- Niels Rogalla (niro@magellan-linux.de)" |
echo -e "-- Niels Rogalla (niro@magellan-linux.de)" |
50 |
} |
} |
51 |
|
|
52 |
print_usage(){ |
print_usage() |
53 |
showversion |
{ |
54 |
echo |
#showversion |
55 |
|
#echo |
56 |
echo "Usage: $(basename $0) [option] pkgname ..." |
echo "Usage: $(basename $0) [option] pkgname ..." |
57 |
echo "Options:" |
echo "Options:" |
58 |
echo " pretend - pretends dependencies of a package" |
echo " pretend - pretends dependencies of a package" |
60 |
echo " install - installs a package" |
echo " install - installs a package" |
61 |
echo " srcinstall - installs a package from source" |
echo " srcinstall - installs a package from source" |
62 |
echo " uninstall - removes a package" |
echo " uninstall - removes a package" |
63 |
echo " update - updates mage-tree" |
echo " update - updates the mage-tree via rsync" |
64 |
|
echo " update-tarball - updates the mage-tree via a tarball" |
65 |
echo " uppretend - pretend dependencies for a system upgrade" |
echo " uppretend - pretend dependencies for a system upgrade" |
66 |
echo " upgrade - runs a complete system upgrade" |
echo " upgrade - runs a complete system upgrade" |
67 |
echo " srcuppretend - pretend dependencies for a system upgrade from source" |
echo " srcuppretend - pretend dependencies for a system upgrade from source" |
68 |
echo " srcupgrade - runs a complete system upgrade from source" |
echo " srcupgrade - runs a complete system upgrade from source" |
69 |
|
echo " pretend-build-prerequisites" |
70 |
|
echo " install-build-prerequisites" |
71 |
echo " search - searches mage-tree for a package" |
echo " search - searches mage-tree for a package" |
72 |
echo " clean - removes *all* downloaded packages" |
echo " clean - removes *all* downloaded packages" |
73 |
echo " unpack - unpacks *all* needed package for 'foo'" |
echo " unpack - unpacks *all* needed package for 'foo'" |
74 |
echo " download - downloads *all* needed packages for 'foo'" |
echo " download - downloads *all* needed packages for 'foo'" |
75 |
|
echo " print-features - prints all enabled mage-features" |
76 |
echo " version - prints version info" |
echo " version - prints version info" |
77 |
echo " regen-mage-tree - regenerates the whole mage database (for devs only)" |
echo " regen-mage-tree - regenerates the whole mage database (for devs only)" |
78 |
echo |
echo |
80 |
# echo "NOINSTALL=yes $(basename $0) srcinstall PACKAGE" |
# echo "NOINSTALL=yes $(basename $0) srcinstall PACKAGE" |
81 |
# echo "Builds a Package with its dependencies, but won't install anything." |
# echo "Builds a Package with its dependencies, but won't install anything." |
82 |
# echo |
# echo |
83 |
echo "USE_UNSTABLE=true $(basename $0) [src]install PACKAGE" |
echo "MAGE_DISTRIBUTION=unstable $(basename $0) [src]install PACKAGE" |
84 |
echo "Overrides stable packages; you can install packages that are marked unstable." |
echo "Overrides stable packages; you can install packages that are marked unstable." |
85 |
echo |
echo |
86 |
echo "USE_TESTING=true $(basename $0) [src]install PACKAGE" |
echo "MAGE_DISTRIBUTION=testing $(basename $0) [src]install PACKAGE" |
87 |
echo "Overrides stable packages; you can install packages that are marked testing." |
echo "Overrides stable packages; you can install packages that are marked testing." |
88 |
echo |
echo |
89 |
echo "NOCOLORS=true $(basename $0) [src]install PACKAGE" |
echo "NOCOLORS=true $(basename $0) [src]install PACKAGE" |
95 |
showversion |
showversion |
96 |
echo |
echo |
97 |
|
|
|
# before anything run mage_setup |
|
|
mage_setup || die "error in mage_setup()" |
|
|
|
|
98 |
# install method |
# install method |
99 |
METHOD="$1" |
METHOD="$1" |
100 |
|
|
101 |
# initial unversionized packagename, gets overridden later |
# initial unversionized packagename, gets overridden later on |
102 |
MAGENAME="$2" |
MAGENAME="$2" |
103 |
|
|
104 |
if [[ ${METHOD} != upgrade ]] && \ |
if [[ ${METHOD} != upgrade ]] && |
105 |
[[ ${METHOD} != srcupgrade ]] && \ |
[[ ${METHOD} != srcupgrade ]] && |
106 |
[[ ${METHOD} != uppretend ]] && \ |
[[ ${METHOD} != uppretend ]] && |
107 |
[[ ${METHOD} != srcuppretend ]] && \ |
[[ ${METHOD} != srcuppretend ]] && |
108 |
[[ ${METHOD} != update ]] && \ |
[[ ${METHOD} != update ]] && |
109 |
[[ ${METHOD} != clean ]] && \ |
[[ ${METHOD} != update-tarball ]] && |
110 |
[[ ${METHOD} != version ]] && \ |
[[ ${METHOD} != clean ]] && |
111 |
[[ ${METHOD} != search ]] && \ |
[[ ${METHOD} != version ]] && |
112 |
[[ ${METHOD} != regen-mage-tree ]] |
[[ ${METHOD} != search ]] && |
113 |
|
[[ ${METHOD} != regen-mage-tree ]] && |
114 |
|
[[ ${METHOD} != print-features ]] |
115 |
then |
then |
116 |
[[ -z ${METHOD} ]] || [[ -z ${MAGENAME} ]] && print_usage && exit 1 |
[[ -z ${METHOD} ]] || [[ -z ${MAGENAME} ]] && print_usage && exit 1 |
117 |
fi |
fi |
123 |
BUILDDIR=${MROOT}/${BUILDDIR} |
BUILDDIR=${MROOT}/${BUILDDIR} |
124 |
fi |
fi |
125 |
|
|
126 |
|
# before anything run mage_setup |
127 |
|
mage_setup || die "error in mage_setup()" |
128 |
|
|
129 |
|
# load supported mage features |
130 |
|
load_mage_features |
131 |
|
|
132 |
|
# query debug mode |
133 |
|
if mqueryfeature "debug" |
134 |
|
then |
135 |
|
depwalker_debug="--debug" |
136 |
|
else |
137 |
|
depwalker_debug="" |
138 |
|
fi |
139 |
|
|
140 |
case ${METHOD} in |
case ${METHOD} in |
141 |
download) |
download) |
142 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
148 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
149 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
150 |
|
|
151 |
|
# package is masked |
152 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
153 |
|
|
154 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
155 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
156 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
163 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
164 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
165 |
--pver ${PVER} \ |
--pver ${PVER} \ |
166 |
--pbuild ${PBUILD})" |
--pbuild ${PBUILD} \ |
167 |
|
${depwalker_debug})" |
168 |
fetch_packages ${ALLDEPS} || die "fetching packages" |
fetch_packages ${ALLDEPS} || die "fetching packages" |
169 |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
170 |
;; |
;; |
179 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
180 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
181 |
|
|
182 |
|
# package is masked |
183 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
184 |
|
|
185 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
186 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
187 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
194 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
195 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
196 |
--pver ${PVER} \ |
--pver ${PVER} \ |
197 |
--pbuild ${PBUILD})" |
--pbuild ${PBUILD} \ |
198 |
|
${depwalker_debug})" |
199 |
fetch_packages ${ALLDEPS} || die "fetching packages" |
fetch_packages ${ALLDEPS} || die "fetching packages" |
200 |
;; |
;; |
201 |
|
|
202 |
pretend|srcpretend) |
pretend|srcpretend|pretend-build-prerequisites) |
203 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
204 |
PCAT="$(pname2pcat ${MAGENAME})" |
PCAT="$(pname2pcat ${MAGENAME})" |
205 |
|
|
209 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
210 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
211 |
|
|
212 |
|
# package is masked |
213 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
214 |
|
|
215 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
216 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
217 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
232 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
233 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
234 |
--pver ${PVER} \ |
--pver ${PVER} \ |
235 |
--pbuild ${PBUILD} |
--pbuild ${PBUILD} \ |
236 |
|
${depwalker_debug} |
237 |
;; |
;; |
238 |
|
|
239 |
install) |
install|install-build-prerequisites) |
240 |
|
have_root_privileges || die "You must be root to run this operation." |
241 |
|
|
242 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
243 |
PCAT="$(pname2pcat ${MAGENAME})" |
PCAT="$(pname2pcat ${MAGENAME})" |
244 |
|
|
248 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
249 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
250 |
|
|
251 |
|
# package is masked |
252 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
253 |
|
|
254 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
255 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
256 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
271 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
272 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
273 |
--pver ${PVER} \ |
--pver ${PVER} \ |
274 |
--pbuild ${PBUILD})" |
--pbuild ${PBUILD} \ |
275 |
|
${depwalker_debug})" |
276 |
|
|
277 |
# first fetch all packages |
# first fetch all packages |
278 |
fetch_packages ${ALLDEPS} || die "fetching packages" |
fetch_packages ${ALLDEPS} || die "fetching packages" |
279 |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
|
unpack_packages ${ALLDEPS} || die "unpacking packages" |
|
280 |
install_packages ${ALLDEPS} || die "installing packages" |
install_packages ${ALLDEPS} || die "installing packages" |
281 |
;; |
;; |
282 |
|
|
283 |
srcinstall) |
srcinstall) |
284 |
|
have_root_privileges || die "You must be root to run this operation." |
285 |
|
|
286 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
287 |
PCAT="$(pname2pcat ${MAGENAME})" |
PCAT="$(pname2pcat ${MAGENAME})" |
288 |
|
|
292 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
293 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
294 |
|
|
295 |
|
# package is masked |
296 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
297 |
|
|
298 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
299 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
300 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
315 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
316 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
317 |
--pver ${PVER} \ |
--pver ${PVER} \ |
318 |
--pbuild ${PBUILD})" |
--pbuild ${PBUILD} \ |
319 |
|
${depwalker_debug})" |
320 |
|
|
321 |
install_packages --src-install ${ALLDEPS} || die "src-installing packages" |
install_packages --src-install ${ALLDEPS} || die "src-installing packages" |
322 |
;; |
;; |
323 |
|
|
324 |
uninstall) |
uninstall) |
325 |
ALLDEPS="$(get_uninstall_candidates --pname ${MAGENAME})" |
have_root_privileges || die "You must be root to run this operation." |
326 |
if [ -z "${ALLDEPS}" ] |
|
327 |
then |
ALLDEPS="$(get_uninstall_candidates --pname ${MAGENAME})" |
328 |
die "No package installed named '${MAGENAME}'." |
if [ -z "${ALLDEPS}" ] |
329 |
fi |
then |
330 |
uninstall_packages ${ALLDEPS} |
die "No package installed named '${MAGENAME}'." |
331 |
|
fi |
332 |
|
uninstall_packages ${ALLDEPS} |
333 |
;; |
;; |
334 |
|
|
335 |
uppretend|srcuppretend) |
uppretend|srcuppretend) |
338 |
--pcat ${METHOD} \ |
--pcat ${METHOD} \ |
339 |
--pname ${METHOD} \ |
--pname ${METHOD} \ |
340 |
--pver ${METHOD} \ |
--pver ${METHOD} \ |
341 |
--pbuild ${METHOD} |
--pbuild ${METHOD} \ |
342 |
|
${depwalker_debug} |
343 |
;; |
;; |
344 |
|
|
345 |
upgrade) |
upgrade) |
346 |
|
have_root_privileges || die "You must be root to run this operation." |
347 |
|
|
348 |
# get all dependencies of *all* installed packages |
# get all dependencies of *all* installed packages |
349 |
# fake pcat,pname,pver,pbuild ... |
# fake pcat,pname,pver,pbuild ... |
350 |
ALLDEPS="$(${MLIBDIR}/depwalker.sh \ |
ALLDEPS="$(${MLIBDIR}/depwalker.sh \ |
352 |
--pcat ${METHOD} \ |
--pcat ${METHOD} \ |
353 |
--pname ${METHOD} \ |
--pname ${METHOD} \ |
354 |
--pver ${METHOD} \ |
--pver ${METHOD} \ |
355 |
--pbuild ${METHOD})" |
--pbuild ${METHOD} \ |
356 |
|
${depwalker_debug})" |
357 |
|
|
358 |
# first fetch all packages |
# first fetch all packages |
359 |
fetch_packages ${ALLDEPS} || die "fetching packages" |
fetch_packages ${ALLDEPS} || die "fetching packages" |
360 |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
|
unpack_packages ${ALLDEPS} || die "unpacking packages" |
|
361 |
install_packages ${ALLDEPS} || die "installing packages" |
install_packages ${ALLDEPS} || die "installing packages" |
362 |
;; |
;; |
363 |
|
|
364 |
srcupgrade) |
srcupgrade) |
365 |
|
have_root_privileges || die "You must be root to run this operation." |
366 |
|
|
367 |
# get all dependencies of *all* installed packages |
# get all dependencies of *all* installed packages |
368 |
# fake pcat,pname,pver,pbuild ... |
# fake pcat,pname,pver,pbuild ... |
369 |
ALLDEPS="$(${MLIBDIR}/depwalker.sh \ |
ALLDEPS="$(${MLIBDIR}/depwalker.sh \ |
371 |
--pcat ${METHOD} \ |
--pcat ${METHOD} \ |
372 |
--pname ${METHOD} \ |
--pname ${METHOD} \ |
373 |
--pver ${METHOD} \ |
--pver ${METHOD} \ |
374 |
--pbuild ${METHOD})" |
--pbuild ${METHOD} \ |
375 |
|
${depwalker_debug})" |
376 |
|
|
377 |
install_packages --src-install ${ALLDEPS} || die "src-installing packages" |
install_packages --src-install ${ALLDEPS} || die "src-installing packages" |
378 |
;; |
;; |
382 |
;; |
;; |
383 |
|
|
384 |
unpack) |
unpack) |
385 |
|
have_root_privileges || die "You must be root to run this operation." |
386 |
|
|
387 |
# first of all get the right pkg which going to be installed |
# first of all get the right pkg which going to be installed |
388 |
PCAT="$(pname2pcat ${MAGENAME})" |
PCAT="$(pname2pcat ${MAGENAME})" |
389 |
|
|
393 |
# source the highest magefile of this pkg |
# source the highest magefile of this pkg |
394 |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME})) |
395 |
|
|
396 |
|
# package is masked |
397 |
|
[ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation." |
398 |
|
|
399 |
# convert PKGNAME to PNAME/PVER/PBUILD |
# convert PKGNAME to PNAME/PVER/PBUILD |
400 |
# we're working *only* with these three vars from here on |
# we're working *only* with these three vars from here on |
401 |
PNAME="$(pkgname2pname ${PKGNAME})" |
PNAME="$(pkgname2pname ${PKGNAME})" |
408 |
--pcat ${PCAT} \ |
--pcat ${PCAT} \ |
409 |
--pname ${PNAME} \ |
--pname ${PNAME} \ |
410 |
--pver ${PVER} \ |
--pver ${PVER} \ |
411 |
--pbuild ${PBUILD})" |
--pbuild ${PBUILD} \ |
412 |
|
${depwalker_debug})" |
413 |
|
|
414 |
fetch_packages ${ALLDEPS} || die "fetching packages" |
fetch_packages ${ALLDEPS} || die "fetching packages" |
415 |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
md5sum_packages ${ALLDEPS} || die "md5 sum packages" |
416 |
unpack_packages ${ALLDEPS} || die "unpacking packages" |
unpack_packages ${ALLDEPS} || die "unpacking packages" |
417 |
;; |
;; |
418 |
|
|
419 |
update) |
update) |
420 |
|
have_root_privileges || die "You must be root to run this operation." |
421 |
syncmage |
syncmage |
422 |
;; |
;; |
423 |
|
|
424 |
|
update-tarball) |
425 |
|
have_root_privileges || die "You must be root to run this operation." |
426 |
|
syncmage_tarball |
427 |
|
;; |
428 |
|
|
429 |
clean) |
clean) |
430 |
|
have_root_privileges || die "You must be root to run this operation." |
431 |
cleanpkg |
cleanpkg |
432 |
;; |
;; |
433 |
|
|
434 |
version) |
version) |
435 |
showversion |
# showversion |
436 |
|
exit 0 |
437 |
;; |
;; |
438 |
|
|
439 |
regen-mage-tree) |
regen-mage-tree) |
440 |
|
have_root_privileges || die "You must be root to run this operation." |
441 |
|
|
442 |
if [ -z "${SMAGESCRIPTSDIR}" ] || [ ! -d "${SMAGESCRIPTSDIR}" ] |
if [ -z "${SMAGESCRIPTSDIR}" ] || [ ! -d "${SMAGESCRIPTSDIR}" ] |
443 |
then |
then |
444 |
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." |
450 |
done |
done |
451 |
;; |
;; |
452 |
|
|
453 |
|
print-features) |
454 |
|
mprintfeatures |
455 |
|
;; |
456 |
|
|
457 |
*) |
*) |
458 |
print_usage |
print_usage |
459 |
;; |
;; |