1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
|
3 |
#depwalker |
#depwalker |
4 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/depwalker.sh,v 1.6 2007-11-05 16:49:33 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/depwalker.sh,v 1.9 2008-02-26 19:51:40 niro Exp $ |
5 |
|
|
6 |
# default die function |
# default die function |
7 |
die() |
die() |
106 |
return 0 |
return 0 |
107 |
} |
} |
108 |
|
|
109 |
|
checklist_processeddeps() |
110 |
|
{ |
111 |
|
local i |
112 |
|
local item="$1" |
113 |
|
|
114 |
|
for i in ${PROCESSEDDEPS} |
115 |
|
do |
116 |
|
[[ ${i} = ${item} ]] && return 1 |
117 |
|
done |
118 |
|
|
119 |
|
return 0 |
120 |
|
} |
121 |
|
|
122 |
##################### |
##################### |
123 |
## rumwandern /path/to/mage/file/.mage |
## rumwandern /path/to/mage/file/.mage |
124 |
rumwandern() |
rumwandern() |
175 |
|
|
176 |
while read SYM DEPNAME |
while read SYM DEPNAME |
177 |
do |
do |
178 |
|
# exclude empty depnames |
179 |
|
[[ -z ${DEPNAME} ]] && continue |
180 |
|
|
181 |
|
# exclude all already processed deps -without version |
182 |
|
if ! checklist_processeddeps "${DEPNAME%-*}" |
183 |
|
then |
184 |
|
continue |
185 |
|
fi |
186 |
|
|
187 |
|
# mark depfile as processed to prevent double runs -without version |
188 |
|
# but do not add any virtuals to PROCESSEDDEPS or their resolved |
189 |
|
# pkgnames will be ignored and they are missing on the dependecy-list |
190 |
|
if [[ ${DEPNAME/virtual\//} = ${DEPNAME} ]] |
191 |
|
then |
192 |
|
PROCESSEDDEPS="${PROCESSEDDEPS} ${DEPNAME%-*}" |
193 |
|
fi |
194 |
|
|
195 |
HIGHEST_DEPFILE=$(dep2highest_magefile "${DEPNAME}") |
HIGHEST_DEPFILE=$(dep2highest_magefile "${DEPNAME}") |
196 |
|
|
197 |
PCAT="$(magename2pcat ${HIGHEST_DEPFILE})" |
PCAT="$(magename2pcat ${HIGHEST_DEPFILE})" |