9 |
exit 1 |
exit 1 |
10 |
} |
} |
11 |
|
|
12 |
|
decho() |
13 |
|
{ |
14 |
|
if [[ ${DEBUG} = 1 ]] |
15 |
|
then |
16 |
|
echo "DEBUG: $@" >&2 |
17 |
|
fi |
18 |
|
} |
19 |
|
|
20 |
# include all needed files |
# include all needed files |
21 |
[ -f /etc/mage.rc.global ] && \ |
[ -f /etc/mage.rc.global ] && \ |
22 |
source /etc/mage.rc.global || \ |
source /etc/mage.rc.global || \ |
135 |
|
|
136 |
DFILE="$1" |
DFILE="$1" |
137 |
|
|
138 |
if [[ ${DEBUG} = 1 ]] |
# debug info |
139 |
then |
decho "depwalking magefile '${DFILE}'" |
140 |
echo "DEBUG: depwalking magefile '${DFILE}'" >&2 |
decho |
|
echo >&2 |
|
|
fi |
|
141 |
|
|
142 |
source ${DFILE} |
source ${DFILE} |
143 |
|
|
197 |
|
|
198 |
if [ -z "${MY_DEPEND}" ] |
if [ -z "${MY_DEPEND}" ] |
199 |
then |
then |
200 |
if [[ ${DEBUG} = 1 ]] |
decho "MY_DEPEND is empty; deps of '${DFILE}' ignored" |
|
then |
|
|
echo "DEBUG: MY_DEPEND is empty; deps of '${DFILE}' ignored" >&2 |
|
|
fi |
|
201 |
return 1 |
return 1 |
202 |
fi |
fi |
203 |
|
|
204 |
while read SYM DEPNAME |
while read SYM DEPNAME |
205 |
do |
do |
206 |
if [[ ${DEBUG} = 1 ]] |
# debug info |
207 |
then |
decho "DEPNAME='${DEPNAME}'" |
|
echo "DEBUG: DEPNAME='${DEPNAME}'" >&2 |
|
|
fi |
|
208 |
|
|
209 |
# exclude empty depnames |
# exclude empty depnames |
210 |
[[ -z ${DEPNAME} ]] && continue |
[[ -z ${DEPNAME} ]] && continue |
246 |
then |
then |
247 |
depwalking ${HIGHEST_DEPFILE} |
depwalking ${HIGHEST_DEPFILE} |
248 |
ALLDEPS="${ALLDEPS} ${HIGHEST_DEPFILE}" |
ALLDEPS="${ALLDEPS} ${HIGHEST_DEPFILE}" |
249 |
if [[ ${DEBUG} = 1 ]] |
decho "added '${HIGHEST_DEPFILE}' to ALLDEPS" |
|
then |
|
|
echo "DEBUG: added '${HIGHEST_DEPFILE}' to ALLDEPS" >&2 |
|
|
fi |
|
250 |
fi |
fi |
251 |
fi |
fi |
252 |
done << EOF |
done << EOF |
277 |
# get the highest mage file from mage-db |
# get the highest mage file from mage-db |
278 |
MAGEFILE="$(get_highest_magefile ${PCAT} ${PNAME})" |
MAGEFILE="$(get_highest_magefile ${PCAT} ${PNAME})" |
279 |
|
|
280 |
if [[ ${DEBUG} = 1 ]] |
# debug info |
281 |
then |
decho "dep='${dep}'" |
282 |
echo "DEBUG: dep='${dep}'" >&2 |
decho "PCAT='${PCAT}'" |
283 |
echo "DEBUG: PCAT='${PCAT}'" >&2 |
decho "PNAME='${PNAME}'" |
284 |
echo "DEBUG: PNAME='${PNAME}'" >&2 |
decho "MAGEFILE='${MAGEFILE}'" |
|
echo "DEBUG: MAGEFILE='${MAGEFILE}'" >&2 |
|
|
fi |
|
285 |
|
|
286 |
# if no install candidate was found, record this |
# if no install candidate was found, record this |
287 |
# and process with the next one |
# and process with the next one |
288 |
if [[ -z ${MAGEFILE} ]] |
if [[ -z ${MAGEFILE} ]] |
289 |
then |
then |
290 |
NO_UPGRADE_CANDIDATE="${NO_UPGRADE_CANDIDATE} ${PCAT}/${PNAME}" |
NO_UPGRADE_CANDIDATE="${NO_UPGRADE_CANDIDATE} ${PCAT}/${PNAME}" |
291 |
if [[ ${DEBUG} = 1 ]] |
decho "added to NO_UPGRADE_CANDIDATE" |
|
then |
|
|
echo "DEBUG: added to NO_UPGRADE_CANDIDATE" >&2 |
|
|
fi |
|
292 |
continue |
continue |
293 |
fi |
fi |
294 |
|
|
296 |
PVER="$(magename2pver ${MAGEFILE})" |
PVER="$(magename2pver ${MAGEFILE})" |
297 |
PBUILD="$(magename2pbuild ${MAGEFILE})" |
PBUILD="$(magename2pbuild ${MAGEFILE})" |
298 |
|
|
299 |
if [[ ${DEBUG} = 1 ]] |
# debug info |
300 |
then |
decho "PVER='${PVER}'" |
301 |
echo "DEBUG: PVER='${PVER}'" >&2 |
decho "PBUILD='${PBUILD}'" |
|
echo "DEBUG: PBUILD='${PBUILD}'" >&2 |
|
|
fi |
|
302 |
|
|
303 |
# do not walk files which are installed |
# do not walk files which are installed |
304 |
if [ ! -d ${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ] |
if [ ! -d ${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ] |
310 |
# (if not exists already) |
# (if not exists already) |
311 |
if checklist_alldeps "${MAGEFILE}" |
if checklist_alldeps "${MAGEFILE}" |
312 |
then |
then |
313 |
if [[ ${DEBUG} = 1 ]] |
decho "added '${MAGEFILE}' to ALLDEPS" |
|
then |
|
|
echo "DEBUG: added '${MAGEFILE}' to ALLDEPS" >&2 |
|
|
fi |
|
314 |
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
315 |
fi |
fi |
316 |
else |
else |
317 |
if [[ ${DEBUG} = 1 ]] |
# debug info |
318 |
then |
decho "ignored package" |
319 |
echo "DEBUG: ignored package" >&2 |
decho |
|
echo >&2 |
|
320 |
fi |
fi |
321 |
fi |
fi |
322 |
done |
done |
337 |
# (if not exists already) |
# (if not exists already) |
338 |
if checklist_alldeps "${MAGEFILE}" |
if checklist_alldeps "${MAGEFILE}" |
339 |
then |
then |
340 |
if [[ ${DEBUG} = 1 ]] |
decho "added '${MAGEFILE}' to ALLDEPS" |
|
then |
|
|
echo "DEBUG: added '${MAGEFILE}' to ALLDEPS" >&2 |
|
|
fi |
|
341 |
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
342 |
fi |
fi |
343 |
fi |
fi |