33 |
echo " -b --pbuild build number of the package" |
echo " -b --pbuild build number of the package" |
34 |
echo " -m --method which calc method should be used:" |
echo " -m --method which calc method should be used:" |
35 |
echo " install, srcinstall, depend, srcdepend" |
echo " install, srcinstall, depend, srcdepend" |
36 |
echo " upgrade, srcupgrade" |
echo " upgrade, srcupgrade," |
37 |
|
echo " install-build-prerequisites, pretend-build-prerequisites" |
38 |
echo |
echo |
39 |
echo "method, name, version and build must be given !" |
echo "method, name, version and build must be given !" |
40 |
echo |
echo |
152 |
fi |
fi |
153 |
fi |
fi |
154 |
|
|
155 |
|
if [[ ${METHOD} = install-build-prerequisites ]] || \ |
156 |
|
[[ ${METHOD} = pretend-build-prerequisites ]] |
157 |
|
then |
158 |
|
# only one time |
159 |
|
if [[ ${LOOP_COUNTER} -lt 1 ]] |
160 |
|
then |
161 |
|
# only if SDEPEND is not zero |
162 |
|
if [ -n "${SDEPEND}" ] |
163 |
|
then |
164 |
|
# crlf is substantly needed !! |
165 |
|
if [ -n "${MY_DEPEND}" ] |
166 |
|
then |
167 |
|
MY_DEPEND="${MY_DEPEND} |
168 |
|
${SDEPEND}" |
169 |
|
else |
170 |
|
MY_DEPEND="${SDEPEND}" |
171 |
|
fi |
172 |
|
fi |
173 |
|
fi |
174 |
|
LOOP_COUNTER=${LOOP_COUNTER}+1 |
175 |
|
fi |
176 |
|
|
177 |
unset DEPEND |
unset DEPEND |
178 |
unset SDEPEND |
unset SDEPEND |
179 |
|
|
202 |
fi |
fi |
203 |
|
|
204 |
HIGHEST_DEPFILE=$(dep2highest_magefile "${DEPNAME}") |
HIGHEST_DEPFILE=$(dep2highest_magefile "${DEPNAME}") |
205 |
|
if [[ -z ${HIGHEST_DEPFILE} ]] |
206 |
|
then |
207 |
|
INVALID_DEPS+=" ${DEPNAME}:${DFILE}" |
208 |
|
continue |
209 |
|
fi |
210 |
|
|
211 |
PCAT="$(magename2pcat ${HIGHEST_DEPFILE})" |
PCAT="$(magename2pcat ${HIGHEST_DEPFILE})" |
212 |
PNAME="$(magename2pname ${HIGHEST_DEPFILE})" |
PNAME="$(magename2pname ${HIGHEST_DEPFILE})" |
219 |
#if [ -z "$(echo ${ALLDEPS} | fgrep "${HIGHEST_DEPFILE}")" ] |
#if [ -z "$(echo ${ALLDEPS} | fgrep "${HIGHEST_DEPFILE}")" ] |
220 |
if checklist_alldeps "${HIGHEST_DEPFILE}" |
if checklist_alldeps "${HIGHEST_DEPFILE}" |
221 |
then |
then |
222 |
### check ob DFILE schon installiert ist ### |
### check if the dependency is already installed ### |
223 |
if [ ! -d ${MROOT}${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ] |
if [ ! -d ${MROOT}${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ] |
224 |
then |
then |
225 |
depwalking ${HIGHEST_DEPFILE} |
depwalking ${HIGHEST_DEPFILE} |
235 |
[[ ${METHOD} = pretend ]] || \ |
[[ ${METHOD} = pretend ]] || \ |
236 |
[[ ${METHOD} = srcpretend ]] || \ |
[[ ${METHOD} = srcpretend ]] || \ |
237 |
[[ ${METHOD} = uppretend ]] || \ |
[[ ${METHOD} = uppretend ]] || \ |
238 |
[[ ${METHOD} = srcuppretend ]] && \ |
[[ ${METHOD} = srcuppretend ]] || \ |
239 |
|
[[ ${METHOD} = pretend-build-prerequisites ]] && \ |
240 |
echo -n "Calculating dependencies ... " |
echo -n "Calculating dependencies ... " |
241 |
|
|
242 |
|
|
271 |
then |
then |
272 |
# get dependencies the package |
# get dependencies the package |
273 |
depwalking ${MAGEFILE} |
depwalking ${MAGEFILE} |
|
|
|
|
# now add the package itself to the dependencies |
|
|
# (if not exists already) |
|
|
#if [ -z "$(echo ${ALLDEPS} | fgrep "${MAGEFILE}")" ] |
|
|
if checklist_alldeps "${MAGEFILE}" |
|
|
then |
|
|
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
|
|
fi |
|
274 |
fi |
fi |
275 |
done |
done |
276 |
else |
else |
277 |
|
LOOP_COUNTER=0 |
278 |
# get all dependencies of the package |
# get all dependencies of the package |
279 |
depwalking ${MAGEFILE} |
depwalking ${MAGEFILE} |
280 |
|
fi |
281 |
|
|
282 |
|
if [[ ${METHOD} != install-build-prerequisites ]] && |
283 |
|
[[ ${METHOD} != pretend-build-prerequisites ]] |
284 |
|
then |
285 |
# now add the package itself to the dependencies |
# now add the package itself to the dependencies |
286 |
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
# (if not exists already) |
287 |
|
if checklist_alldeps "${MAGEFILE}" |
288 |
|
then |
289 |
|
ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
290 |
|
fi |
291 |
fi |
fi |
292 |
|
|
293 |
[[ ${METHOD} = pretend ]] || \ |
[[ ${METHOD} = pretend ]] || \ |
294 |
[[ ${METHOD} = srcpretend ]] || \ |
[[ ${METHOD} = srcpretend ]] || \ |
295 |
[[ ${METHOD} = uppretend ]] || \ |
[[ ${METHOD} = uppretend ]] || \ |
296 |
[[ ${METHOD} = srcuppretend ]] && \ |
[[ ${METHOD} = srcuppretend ]] || \ |
297 |
|
[[ ${METHOD} = pretend-build-prerequisites ]] && \ |
298 |
echo "done" |
echo "done" |
299 |
|
|
300 |
|
|
302 |
if [[ ${METHOD} = pretend ]] || \ |
if [[ ${METHOD} = pretend ]] || \ |
303 |
[[ ${METHOD} = srcpretend ]] || \ |
[[ ${METHOD} = srcpretend ]] || \ |
304 |
[[ ${METHOD} = uppretend ]] || \ |
[[ ${METHOD} = uppretend ]] || \ |
305 |
[[ ${METHOD} = srcuppretend ]] |
[[ ${METHOD} = srcuppretend ]] || \ |
306 |
|
[[ ${METHOD} = pretend-build-prerequisites ]] |
307 |
then |
then |
308 |
# this is a little bit faster |
# this is a little bit faster |
309 |
declare -i x=0 |
declare -i x=0 |
331 |
echo -e "${list}" |
echo -e "${list}" |
332 |
echo |
echo |
333 |
|
|
334 |
|
if [[ ! -z ${INVALID_DEPS} ]] |
335 |
|
then |
336 |
|
echo -e "${COLRED}Invalid dependencies found:${COLDEFAULT}" |
337 |
|
for i in ${INVALID_DEPS} |
338 |
|
do |
339 |
|
_dep="${i%%:*}" |
340 |
|
_mage="${i##*:}" |
341 |
|
echo -e "${COLRED} '${_dep}' -> '${_mage}'${COLDEFAULT}" |
342 |
|
done |
343 |
|
echo |
344 |
|
fi |
345 |
|
|
346 |
if [[ ! -z ${NO_UPGRADE_CANDIDATE} ]] |
if [[ ! -z ${NO_UPGRADE_CANDIDATE} ]] |
347 |
then |
then |
348 |
echo -e "${COLRED}Currently no candidates found for:${COLDEFAULT}" |
echo -e "${COLRED}Currently no candidates found for:${COLDEFAULT}" |
362 |
[[ ${METHOD} = install ]] || \ |
[[ ${METHOD} = install ]] || \ |
363 |
[[ ${METHOD} = srcinstall ]] || \ |
[[ ${METHOD} = srcinstall ]] || \ |
364 |
[[ ${METHOD} = upgrade ]] || \ |
[[ ${METHOD} = upgrade ]] || \ |
365 |
[[ ${METHOD} = srcupgrade ]] && \ |
[[ ${METHOD} = srcupgrade ]] || \ |
366 |
|
[[ ${METHOD} = install-build-prerequisites ]] && \ |
367 |
echo "${ALLDEPS}" |
echo "${ALLDEPS}" |