18 |
} |
} |
19 |
|
|
20 |
# include all needed files |
# include all needed files |
21 |
[ -f /etc/mage.rc.global ] && \ |
source @@SYSCONFDIR@@/mage.rc.global || die "@@SYSCONFDIR@@/mage.rc.global missing" |
22 |
source /etc/mage.rc.global || \ |
source ${MAGERC} || die "Your ${MAGERC} is missing. Aborting." |
23 |
die "/etc/mage.rc.global missing" |
source ${MLIBDIR}/mage4.functions.sh || die "mage functions missing" |
24 |
|
source ${MLIBDIR}/smage2.functions.sh || die "smage functions missing" |
|
[ -f ${MAGERC} ] && source ${MAGERC} || \ |
|
|
die "Your ${MAGERC} is missing. Aborting." |
|
|
|
|
|
[ -f ${MLIBDIR}/mage4.functions.sh ] && \ |
|
|
source ${MLIBDIR}/mage4.functions.sh || \ |
|
|
die "mage functions missing" |
|
25 |
|
|
26 |
usage() |
usage() |
27 |
{ |
{ |
39 |
echo " install-build-prerequisites," |
echo " install-build-prerequisites," |
40 |
echo " pretend-build-prerequisites" |
echo " pretend-build-prerequisites" |
41 |
echo " -d --debug enable debug mode" |
echo " -d --debug enable debug mode" |
42 |
|
echo " -s --smage use a smage to calculate dependencies" |
43 |
echo |
echo |
44 |
echo "method, category, name, version and build must be given !" |
echo "method, category, name, version and build must be given !" |
45 |
echo |
echo |
59 |
--pbuild|-b) shift; PBUILD="$1" ;; |
--pbuild|-b) shift; PBUILD="$1" ;; |
60 |
--method|-m) shift; METHOD="$1" ;; |
--method|-m) shift; METHOD="$1" ;; |
61 |
--debug|-d) shift; DEBUG=1 ;; |
--debug|-d) shift; DEBUG=1 ;; |
62 |
|
--smage|-s) shift; SMAGEFILE="$1"; SILENT=1; FVERBOSE=off ;; |
63 |
--help|-h) usage ;; |
--help|-h) usage ;; |
64 |
esac |
esac |
65 |
shift |
shift |
66 |
done |
done |
67 |
|
|
68 |
# sanity checks; abort if not given |
# sanity checks; abort if not given |
69 |
[ -z "${PCAT}" ] && usage |
if [[ -z ${SMAGEFILE} ]] |
70 |
[ -z "${PNAME}" ] && usage |
then |
71 |
[ -z "${PVER}" ] && usage |
[ -z "${PCAT}" ] && usage |
72 |
[ -z "${PBUILD}" ] && usage |
[ -z "${PNAME}" ] && usage |
73 |
|
[ -z "${PVER}" ] && usage |
74 |
|
[ -z "${PBUILD}" ] && usage |
75 |
|
fi |
76 |
[ -z "${METHOD}" ] && usage |
[ -z "${METHOD}" ] && usage |
77 |
|
|
78 |
# check needed global vars |
# check needed global vars |
82 |
|
|
83 |
# other needed vars |
# other needed vars |
84 |
ALLDEPS="" |
ALLDEPS="" |
85 |
|
if [[ -n ${SMAGEFILE} ]] |
86 |
|
then |
87 |
|
if [[ -e ${SMAGEFILE} ]] |
88 |
|
then |
89 |
|
smagesource "${SMAGEFILE}" |
90 |
|
else |
91 |
|
die "Smage file '${SMAGEFILE}' does not exist!" |
92 |
|
fi |
93 |
|
fi |
94 |
MAGEFILE="${MAGEDIR}/${PCAT}/${PNAME}/${PNAME}-${PVER}-${PBUILD}.mage" |
MAGEFILE="${MAGEDIR}/${PCAT}/${PNAME}/${PNAME}-${PVER}-${PBUILD}.mage" |
95 |
|
|
96 |
# much faster than fgrep |
# much faster than fgrep |
302 |
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
303 |
fi |
fi |
304 |
else |
else |
305 |
# debug info |
# debug info |
306 |
decho "ignored package" |
decho "ignored package" |
307 |
decho |
decho |
|
fi |
|
308 |
fi |
fi |
309 |
done |
done |
310 |
else |
else |
|
LOOP_COUNTER=0 |
|
311 |
# get all dependencies of the package |
# get all dependencies of the package |
312 |
depwalking ${MAGEFILE} |
if [[ -n ${SMAGEFILE} ]] |
313 |
|
then |
314 |
|
depwalking "${SMAGEFILE}" |
315 |
|
else |
316 |
|
depwalking "${MAGEFILE}" |
317 |
|
fi |
318 |
fi |
fi |
319 |
|
|
320 |
if [[ ${METHOD} != install-build-prerequisites ]] && |
if [[ ${METHOD} != install-build-prerequisites ]] && |