97 |
|
|
98 |
# other needed vars |
# other needed vars |
99 |
ALLDEPS="" |
ALLDEPS="" |
|
MAGEFILE="${MAGEDIR}/${PCAT}/${PNAME}/${PNAME}-${PVER}-${PBUILD}.mage" |
|
100 |
|
|
101 |
# much faster than fgrep |
# much faster than fgrep |
102 |
checklist_alldeps() |
checklist_alldeps() |
125 |
return 0 |
return 0 |
126 |
} |
} |
127 |
|
|
|
all_depends() |
|
|
{ |
|
|
local pname="$1" |
|
|
local pver="$2" |
|
|
local pbuild="$3" |
|
|
|
|
|
sql "select categories.pcat, |
|
|
depends.pname, |
|
|
depends.pver, |
|
|
depends.pbuild |
|
|
from depends |
|
|
inner join packages |
|
|
on depends.pkg_id=packages.id |
|
|
and packages.pname='${pname}' |
|
|
and packages.pver='${pver}' |
|
|
and packages.pbuild='${pbuild}' |
|
|
inner join categories |
|
|
on depends.pcat_id=categories.id" |
|
|
} |
|
|
|
|
|
all_sdepends() |
|
|
{ |
|
|
local pname="$1" |
|
|
local pver="$2" |
|
|
local pbuild="$3" |
|
|
|
|
|
sql "select categories.pcat, |
|
|
sdepends.pname, |
|
|
sdepends.pver, |
|
|
sdepends.pbuild |
|
|
from sdepends |
|
|
inner join packages |
|
|
on sdepends.pkg_id=packages.id |
|
|
and packages.pname='${pname}' |
|
|
and packages.pver='${pver}' |
|
|
and packages.pbuild='${pbuild}' |
|
|
inner join categories |
|
|
on sdepends.pcat_id=categories.id" |
|
|
} |
|
|
|
|
|
|
|
128 |
##################### |
##################### |
129 |
## rumwandern /path/to/mage/file/.mage |
## rumwandern /path/to/mage/file/.mage |
130 |
rumwandern() |
rumwandern() |
235 |
# maybe later ? |
# maybe later ? |
236 |
#[ -d ${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ] && exit 3 |
#[ -d ${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ] && exit 3 |
237 |
|
|
238 |
# # [[ ${METHOD} = pretend ]] || \ |
[[ ${METHOD} = pretend ]] || \ |
239 |
# # [[ ${METHOD} = srcpretend ]] || \ |
[[ ${METHOD} = srcpretend ]] || \ |
240 |
# # [[ ${METHOD} = uppretend ]] || \ |
[[ ${METHOD} = uppretend ]] || \ |
241 |
# # [[ ${METHOD} = srcuppretend ]] && \ |
[[ ${METHOD} = srcuppretend ]] && \ |
242 |
# # echo -n "Calculating dependencies ... " |
echo -n "Calculating dependencies ... " |
243 |
# # |
|
244 |
# # |
|
245 |
# # if [[ ${METHOD} = upgrade ]] || \ |
if [[ ${METHOD} = upgrade ]] || \ |
246 |
# # [[ ${METHOD} = srcupgrade ]] || \ |
[[ ${METHOD} = srcupgrade ]] || \ |
247 |
# # [[ ${METHOD} = uppretend ]] || \ |
[[ ${METHOD} = uppretend ]] || \ |
248 |
# # [[ ${METHOD} = srcuppretend ]] |
[[ ${METHOD} = srcuppretend ]] |
249 |
# # then |
then |
250 |
# # INSTDEPS="$(${MLIBDIR}/magequery.sh -i)" |
INSTDEPS=$(DBFILE="${MAGE_INSTALL_DB}" sql "select categories.pcat,packages.pname,packages.pver,packages.pbuild from packages inner join categories on categories.id=packages.pcat_id") |
251 |
# # for dep in ${INSTDEPS} |
for dep in ${INSTDEPS} |
252 |
# # do |
do |
253 |
# # PCAT="$(magename2pcat ${dep} installdb)" |
PCAT="$(echo ${dep} | cut -d'|' -f1)" |
254 |
# # PNAME="$(magename2pname ${dep})" |
PNAME="$(echo ${dep} | cut -d'|' -f2)" |
255 |
# # |
|
256 |
# # # get the highest mage file from mage-db |
# get the highest mage file from mage-db |
257 |
# # MAGEFILE="$(get_highest_magefile ${PCAT} ${PNAME})" |
state="${MAGE_DISTRIBUTION}" |
258 |
# # |
highest=$(highest_pkg ${PNAME} ${state}) |
259 |
# # # if no install candidate was found, record this |
|
260 |
# # # and process with the next one |
# if no install candidate was found, record this |
261 |
# # if [[ -z ${MAGEFILE} ]] |
# and process with the next one |
262 |
# # then |
if [[ -z ${highest} ]] |
263 |
# # NO_UPGRADE_CANDIDATE="${NO_UPGRADE_CANDIDATE} ${PCAT}/${PNAME}" |
then |
264 |
# # continue |
NO_UPGRADE_CANDIDATE="${NO_UPGRADE_CANDIDATE} ${PCAT}/${PNAME}" |
265 |
# # fi |
continue |
266 |
# # |
fi |
267 |
# # # now get the pver&pbuild from the new file |
|
268 |
# # PVER="$(magename2pver ${MAGEFILE})" |
# now get the pver&pbuild from the new file |
269 |
# # PBUILD="$(magename2pbuild ${MAGEFILE})" |
PVER="${highest%%|*}" |
270 |
# # |
PBUILD="${highest##*|}" |
271 |
# # # do not wander files which are installed |
|
272 |
# # if [ ! -d ${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ] |
# do not walk through files which are already installed |
273 |
# # then |
if ! is_installed --pcat "${PCAT}" --pname "${PNAME}" --pver "${PVER}" --pbuild "${PBUILD}" |
274 |
# # # get dependencies the package |
then |
275 |
# # rumwandern ${MAGEFILE} |
# get dependencies the package |
276 |
# # |
rumwandern "${PNAME}" "${PVER}" "${PBUILD}" |
277 |
# # # now add the package itself to the dependencies |
|
278 |
# # # (if not exists already) |
# now add the package itself to the dependencies |
279 |
# # #if [ -z "$(echo ${ALLDEPS} | fgrep "${MAGEFILE}")" ] |
# (if not exists already) |
280 |
# # if checklist_alldeps "${MAGEFILE}" |
fullname="${PCAT}/${PNAME}-${PVER}-${PBUILD}" |
281 |
# # then |
if checklist_alldeps "${fullname}" |
282 |
# # ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
then |
283 |
# # fi |
ALLDEPS="${ALLDEPS} ${fullname}" |
284 |
# # fi |
fi |
285 |
# # done |
fi |
286 |
# # else |
done |
287 |
# # # get dependencies the package |
else |
288 |
# # rumwandern ${MAGEFILE} |
# get dependencies the package |
289 |
# # |
rumwandern "${PNAME}" "${PVER}" "${PBUILD}" |
290 |
# # # now add the package itself to the dependencies |
|
291 |
# # ALLDEPS="${ALLDEPS} ${MAGEFILE}" |
# now add the package itself to the dependencies |
292 |
# # fi |
ALLDEPS="${ALLDEPS} ${PCAT}/${PNAME}-${PVER}-${PBUILD}" |
293 |
# # |
fi |
294 |
# # [[ ${METHOD} = pretend ]] || \ |
|
295 |
# # [[ ${METHOD} = srcpretend ]] || \ |
[[ ${METHOD} = pretend ]] || \ |
296 |
# # [[ ${METHOD} = uppretend ]] || \ |
[[ ${METHOD} = srcpretend ]] || \ |
297 |
# # [[ ${METHOD} = srcuppretend ]] && \ |
[[ ${METHOD} = uppretend ]] || \ |
298 |
# # echo "done" |
[[ ${METHOD} = srcuppretend ]] && \ |
299 |
# # |
echo "done" |
300 |
# # |
|
301 |
# # ## show output of pretend |
|
302 |
# # if [[ ${METHOD} = pretend ]] || \ |
## show output of pretend |
303 |
# # [[ ${METHOD} = srcpretend ]] || \ |
if [[ ${METHOD} = pretend ]] || \ |
304 |
# # [[ ${METHOD} = uppretend ]] || \ |
[[ ${METHOD} = srcpretend ]] || \ |
305 |
# # [[ ${METHOD} = srcuppretend ]] |
[[ ${METHOD} = uppretend ]] || \ |
306 |
# # then |
[[ ${METHOD} = srcuppretend ]] |
307 |
# # # this is a little bit faster |
then |
308 |
# # declare -i x=0 |
# this is a little bit faster |
309 |
# # echo -n "Building dependencies list ... " |
declare -i x=0 |
310 |
# # for i in ${ALLDEPS} |
echo -n "Building dependencies list ... " |
311 |
# # do |
for i in ${ALLDEPS} |
312 |
# # (( x++ )) |
do |
313 |
# # k="$x" |
(( x++ )) |
314 |
# # [ ${x} -le 9 ] && k="0${k}" |
k="$x" |
315 |
# # #[ ${x} -le 99 ] && k="0${k}" |
[ ${x} -le 9 ] && k="0${k}" |
316 |
# # PCAT="$(magename2pcat ${i})" |
#[ ${x} -le 99 ] && k="0${k}" |
317 |
# # PNAME="$(magename2pname ${i})" |
if [ -z "${list}" ] |
318 |
# # PVER="$(magename2pver ${i})" |
then |
319 |
# # PBUILD="$(magename2pbuild ${i})" |
list="\t${COLBLUE}[${k}] ${COLGREEN}${i}${COLDEFAULT}" |
320 |
# # if [ -z "${list}" ] |
else |
321 |
# # then |
list="${list} |
322 |
# # list="\t${COLBLUE}[${k}] ${COLGREEN}${PCAT}/${PNAME}-${PVER}-${PBUILD}${COLDEFAULT}" |
\t${COLBLUE}[${k}] ${COLGREEN}${i}${COLDEFAULT}" |
323 |
# # else |
fi |
324 |
# # list="${list} |
done |
325 |
# # \t${COLBLUE}[${k}] ${COLGREEN}${PCAT}/${PNAME}-${PVER}-${PBUILD}${COLDEFAULT}" |
echo "done" |
326 |
# # fi |
echo -e "${list}" |
327 |
# # unset PCAT PNAME PVER PBUILD |
echo |
328 |
# # done |
|
329 |
# # echo "done" |
if [[ ! -z ${NO_UPGRADE_CANDIDATE} ]] |
330 |
# # echo -e "${list}" |
then |
331 |
# # echo |
echo -e "${COLRED}Currently no candidates found for:${COLDEFAULT}" |
332 |
# # |
for i in ${NO_UPGRADE_CANDIDATE} |
333 |
# # if [[ ! -z ${NO_UPGRADE_CANDIDATE} ]] |
do |
334 |
# # then |
echo -e "${COLRED} ${i}${COLDEFAULT}" |
335 |
# # echo -e "${COLRED}Currently no candidates found for:${COLDEFAULT}" |
done |
336 |
# # for i in ${NO_UPGRADE_CANDIDATE} |
echo |
337 |
# # do |
echo -e "${COLRED}Please consider to uninstall all of them first,${COLDEFAULT}" |
338 |
# # echo -e "${COLRED} ${i}${COLDEFAULT}" |
echo -e "${COLRED}because these packages does not exist in this distribution${COLDEFAULT}" |
339 |
# # done |
echo -e "${COLRED}anymore and there will be no further support for them.${COLDEFAULT}" |
340 |
# # echo |
echo |
341 |
# # echo -e "${COLRED}Please consider to uninstall all of them first,${COLDEFAULT}" |
fi |
342 |
# # echo -e "${COLRED}because these packages does not exist in this distribution${COLDEFAULT}" |
fi |
343 |
# # echo -e "${COLRED}anymore and there will be no further support for them.${COLDEFAULT}" |
|
344 |
# # echo |
## return output from src/install deps |
345 |
# # fi |
[[ ${METHOD} = install ]] || \ |
346 |
# # fi |
[[ ${METHOD} = srcinstall ]] || \ |
347 |
# # |
[[ ${METHOD} = upgrade ]] || \ |
348 |
# # ## return output from src/install deps |
[[ ${METHOD} = srcupgrade ]] && \ |
349 |
# # [[ ${METHOD} = install ]] || \ |
echo "${ALLDEPS}" |
350 |
# # [[ ${METHOD} = srcinstall ]] || \ |
|
351 |
# # [[ ${METHOD} = upgrade ]] || \ |
# delete ${BUILDDIR}/virtuals if exists as not needed anymore |
352 |
# # [[ ${METHOD} = srcupgrade ]] && \ |
#[ -d ${BUILDDIR}/virtuals ] && rm -rf ${BUILDDIR}/virtuals |
|
# # echo "${ALLDEPS}" |
|
|
# # |
|
|
# # # delete ${BUILDDIR}/virtuals if exists as not needed anymore |
|
|
# # #[ -d ${BUILDDIR}/virtuals ] && rm -rf ${BUILDDIR}/virtuals |
|
|
|
|
|
#all_depends "${PNAME}" "${PVER}" "${PBUILD}" |
|
|
#all_depends "${PNAME}" "${MAGE_DISTRIBUTION}" |
|
|
#retval=$(default_virtualname_to_pkgname "virtual" "opengl") |
|
|
#depcat=${retval%%|*} |
|
|
#depname=${retval##*|} |
|
|
#echo "depcat='${depcat}'" |
|
|
#echo "depname='${depname}'" |
|
|
|
|
|
rumwandern "${PNAME}" "${PVER}" "${PBUILD}" |
|
|
# add the package itself |
|
|
ALLDEPS="${ALLDEPS} ${PCAT}/${PNAME}-${PVER}-${PBUILD}" |
|
|
declare -i x=0 |
|
|
for i in ${ALLDEPS} |
|
|
do |
|
|
(( x++ )) |
|
|
k="$x" |
|
|
[ ${x} -le 9 ] && k="0${k}" |
|
|
#[ ${x} -le 99 ] && k="0${k}" |
|
|
echo -e "\t[${k}] ${i}" |
|
|
done |
|
|
echo |
|