--- trunk/mage/usr/lib/mage/mage4.functions.sh 2007/03/19 18:05:20 437 +++ trunk/mage/usr/lib/mage/mage4.functions.sh 2007/03/19 20:00:35 445 @@ -1,6 +1,6 @@ #!/bin/bash # Magellan Linux Installer Functions (mage.functions.sh) -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.27 2007-03-19 18:05:20 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.28 2007-03-19 20:00:35 niro Exp $ mage_setup() { @@ -2528,6 +2528,7 @@ local all_installed local ipver local ipbuild + local latest_available # only names no versions result="$(find ${MAGEDIR} -mindepth 2 -maxdepth 2 -type d -name '*'${string}'*'| sed '/profiles/d' | sed '/includes/d')" @@ -2545,37 +2546,46 @@ # get highest version available magefile=$(get_highest_magefile ${pcat} ${pname}) - # now get all needed infos to print a nice output - pver="$(magename2pver ${magefile})" - pbuild="$(magename2pbuild ${magefile})" - state="$(get_value_from_magefile STATE ${magefile})" - description="$(get_value_from_magefile DESCRIPTION ${magefile})" - homepage="$(get_value_from_magefile HOMEPAGE ${magefile})" - - # all installed - for i in $(get_uninstall_candidates --pname ${pname} --pcat ${pcat}) - do - ipver="$(magename2pver ${i})" - ipbuild="$(magename2pbuild ${i})" - - if [[ -z ${all_installed} ]] - then - all_installed="${ipver}-${ipbuild}" - else - all_installed="${all_installed} ${ipver}-${ipbuild}" - fi - done - [[ -z ${all_installed} ]] && all_installed="none" + if [[ ! -z ${magefile} ]] + then + # now get all needed infos to print a nice output + pver="$(magename2pver ${magefile})" + pbuild="$(magename2pbuild ${magefile})" + state="$(get_value_from_magefile STATE ${magefile})" + description="$(get_value_from_magefile DESCRIPTION ${magefile})" + homepage="$(get_value_from_magefile HOMEPAGE ${magefile})" + + # all installed + for i in $(get_uninstall_candidates --pname ${pname} --pcat ${pcat}) + do + ipver="$(magename2pver ${i})" + ipbuild="$(magename2pbuild ${i})" + + if [[ -z ${all_installed} ]] + then + all_installed="${ipver}-${ipbuild}" + else + all_installed="${all_installed} ${ipver}-${ipbuild}" + fi + done + [[ -z ${all_installed} ]] && all_installed="none" + + case ${state} in + stable) state=${COLGREEN}"[s] ";; + testing) state=${COLYELLOW}"[t] ";; + unstable) state=${COLRED}"[u] ";; + old) state=${COLGRAY}"[o] ";; + esac - case ${state} in - stable) state=${COLGREEN}"[s] ";; - testing) state=${COLYELLOW}"[t] ";; - unstable) state=${COLRED}"[u] ";; - old) state=${COLGRAY}"[o] ";; - esac + latest_available="${pver}-${pbuild}" + else + # package is masked + state="${COLRED}[m] " + latest_available="${COLRED}masked for this distribution.${COLDEFAULT}" + fi echo -e "${state}${pcat}/${pname}"${COLDEFAULT} - echo " Latest available: ${pver}-${pbuild}" + echo -e " Latest available: ${latest_available}" echo " Installed versions: ${all_installed}" echo " Description: ${description}" echo " Homepage: ${homepage}"