29 |
source ${MLIBDIR}/mage4.functions.sh || \ |
source ${MLIBDIR}/mage4.functions.sh || \ |
30 |
die "mage functions missing" |
die "mage functions missing" |
31 |
|
|
32 |
|
[ -f ${MLIBDIR}/smage2.functions.sh ] && \ |
33 |
|
source ${MLIBDIR}/smage2.functions.sh || \ |
34 |
|
die "smage functions missing" |
35 |
|
|
36 |
usage() |
usage() |
37 |
{ |
{ |
38 |
echo |
echo |
44 |
echo " -v --pver version number of the package" |
echo " -v --pver version number of the package" |
45 |
echo " -b --pbuild build number of the package" |
echo " -b --pbuild build number of the package" |
46 |
echo " -m --method which calc method should be used:" |
echo " -m --method which calc method should be used:" |
47 |
echo " install, srcinstall, depend, srcdepend" |
echo " install, srcinstall, pretend, srcpretend" |
48 |
echo " upgrade, srcupgrade," |
echo " upgrade, srcupgrade," |
49 |
echo " install-build-prerequisites," |
echo " install-build-prerequisites," |
50 |
echo " pretend-build-prerequisites" |
echo " pretend-build-prerequisites" |
51 |
echo " -d --debug enable debug mode" |
echo " -d --debug enable debug mode" |
52 |
|
echo " -s --smage use a smage to calculate dependencies" |
53 |
echo |
echo |
54 |
echo "method, category, name, version and build must be given !" |
echo "method, category, name, version and build must be given !" |
55 |
echo |
echo |
69 |
--pbuild|-b) shift; PBUILD="$1" ;; |
--pbuild|-b) shift; PBUILD="$1" ;; |
70 |
--method|-m) shift; METHOD="$1" ;; |
--method|-m) shift; METHOD="$1" ;; |
71 |
--debug|-d) shift; DEBUG=1 ;; |
--debug|-d) shift; DEBUG=1 ;; |
72 |
|
--smage|-s) shift; SMAGEFILE="$1"; SILENT=1; FVERBOSE=off ;; |
73 |
--help|-h) usage ;; |
--help|-h) usage ;; |
74 |
esac |
esac |
75 |
shift |
shift |
76 |
done |
done |
77 |
|
|
78 |
# sanity checks; abort if not given |
# sanity checks; abort if not given |
79 |
[ -z "${PCAT}" ] && usage |
if [[ -z ${SMAGEFILE} ]] |
80 |
[ -z "${PNAME}" ] && usage |
then |
81 |
[ -z "${PVER}" ] && usage |
[ -z "${PCAT}" ] && usage |
82 |
[ -z "${PBUILD}" ] && usage |
[ -z "${PNAME}" ] && usage |
83 |
|
[ -z "${PVER}" ] && usage |
84 |
|
[ -z "${PBUILD}" ] && usage |
85 |
|
fi |
86 |
[ -z "${METHOD}" ] && usage |
[ -z "${METHOD}" ] && usage |
87 |
|
|
88 |
# check needed global vars |
# check needed global vars |
92 |
|
|
93 |
# other needed vars |
# other needed vars |
94 |
ALLDEPS="" |
ALLDEPS="" |
95 |
|
if [[ -n ${SMAGEFILE} ]] |
96 |
|
then |
97 |
|
if [[ -e ${SMAGEFILE} ]] |
98 |
|
then |
99 |
|
smagesource "${SMAGEFILE}" |
100 |
|
else |
101 |
|
die "Smage file '${SMAGEFILE}' does not exist!" |
102 |
|
fi |
103 |
|
fi |
104 |
MAGEFILE="${MAGEDIR}/${PCAT}/${PNAME}/${PNAME}-${PVER}-${PBUILD}.mage" |
MAGEFILE="${MAGEDIR}/${PCAT}/${PNAME}/${PNAME}-${PVER}-${PBUILD}.mage" |
105 |
|
|
106 |
# much faster than fgrep |
# much faster than fgrep |
312 |
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
313 |
fi |
fi |
314 |
else |
else |
315 |
# debug info |
# debug info |
316 |
decho "ignored package" |
decho "ignored package" |
317 |
decho |
decho |
|
fi |
|
318 |
fi |
fi |
319 |
done |
done |
320 |
else |
else |
|
LOOP_COUNTER=0 |
|
321 |
# get all dependencies of the package |
# get all dependencies of the package |
322 |
depwalking ${MAGEFILE} |
if [[ -n ${SMAGEFILE} ]] |
323 |
|
then |
324 |
|
depwalking "${SMAGEFILE}" |
325 |
|
else |
326 |
|
depwalking "${MAGEFILE}" |
327 |
|
fi |
328 |
fi |
fi |
329 |
|
|
330 |
if [[ ${METHOD} != install-build-prerequisites ]] && |
if [[ ${METHOD} != install-build-prerequisites ]] && |