--- branches/mage-sql/usr/lib/mage/sql_functions.sh 2010/07/17 10:45:30 1114 +++ branches/mage-sql/usr/lib/mage/sql_functions.sh 2010/07/17 10:48:23 1115 @@ -260,219 +260,6 @@ sql "select pcat,pname from virtual_defaults where vcat='${vcat}' and vname='${vname}'" } -ALLDEPS="" -#ALREADY_PROCESSED="" -resolv_pkgs() -{ - local method="$1" - local pname="$2" - local state="$3" - local depcat - local depname - local depver - local depbuild - local highest - local fullname - local searchcmd - local searchcmd2 - local pkgid - #local ALL_DEPS - - case ${method} in - --install) - searchcmd="all_depends ${pname} ${state}" - searchcmd2="" - ;; - --src-install) - searchcmd="all_depends ${pname} ${state}" - searchcmd2="all_sdepends ${pname} ${state}" - ;; - esac - - [[ -z ${pname} ]] && return 1 - - echo - echo "processing pname=${pname}" - echo "before ALL_DEPS=${ALL_DEPS[*]}" - read - - ALL_DEPS+=($(${searchcmd})) - ALL_DEPS+=($(${searchcmd2})) - - echo "after ALL_DEPS=${ALL_DEPS[*]}" - read - - for line in ${ALL_DEPS[${i}]} - do -# for (( i=0; i ${depname}" - resolv_pkgs "${method}" "${depname}" "${state}" - ALLDEPS="${ALLDEPS} ${fullname}" - fi - - # list of all processed pnames, to speed things up -# ALREADY_PROCESSED="${ALREADY_PROCESSED} ${depname}" - - # unset all vars - unset depname - unset depcat - unset depver - unset depbuild - unset fullname - unset shighest -# done << EOF -#$(${searchcmd}) -#$(${searchcmd2}) -#EOF -# done - done -} - -# start_depwanderer pname state -start_depwanderer() -{ - local highest - local method="$1" - local pname="$2" - local pver - local pbuild - local pcat - local state="$3" - local x i - - # get some suitable pkg info - highest=$(highest_pkg "${pname}" "${state}") - pver="${highest%|*}" - pbuild="${highest##*|}" - pcat=$(sql "select categories.pcat - from packages - inner join categories - on packages.pcat_id=categories.id - where packages.pname='${pname}' - and packages.pver='${pver}' - and packages.pbuild='${pbuild}'") - - # already installed ?? - if is_installed --pcat "${pcat}" --pname "${pname}" --pver "${pver}" --pbuild "${pbuild}" - then - echo "Package ${pcat}/${pname}-${pver}-${pbuild} already installed." - return 2 - fi - - resolv_pkgs "${method}" "${pname}" "${state}" - declare -i x=1 - for i in ${ALLDEPS} - do - #echo "${x}: ${i}" - echo "${i}" - ((x++)) - done - - # add the package itself to the dependencies - #echo "$((x++)): ${pcat}/${pname}-${pver}-${pbuild}" - echo "${pcat}/${pname}-${pver}-${pbuild}" -} - - # fetch_packages /path/to/mage/file1 /path/to/mage/file2 fetch_packages() {