--- trunk/mage/usr/lib/mage/mage4.functions.sh 2005/09/10 13:35:55 237 +++ trunk/mage/usr/lib/mage/mage4.functions.sh 2005/09/11 19:47:08 240 @@ -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.2 2005-09-10 13:35:55 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.3 2005-09-11 19:47:08 niro Exp $ mage_setup() { @@ -744,7 +744,7 @@ do [ -z "${pathto}" ] && continue - if [ -e "${MROOT}${pathto}" ] + if [ ! -e "${MROOT}${pathto}" ] then [[ ${VERBOSE} = on ]] && \ echo -e "${COLRED}! exist${COLDEFAULT} === FILE: ${MROOT}${pathto}" @@ -932,14 +932,11 @@ [ ! -f ${MROOT}${INSTALLDB}/${pfull}/.char ] && die "remove_directories() .dirs not found" - # uninstall of dirs ## added small hack to fix dirs - # must be reverse -> smage2 doesn't sort them - # -> using tac - # sets fieldseperator to "§" instead of " " IFS=§ - while read pathto posix + # reversed order is mandatory ! + tac ${MROOT}${INSTALLDB}/${pfull}/.dirs | while read pathto posix do [ -z "${pathto}" ] && continue @@ -954,7 +951,7 @@ if [ -f "${MROOT}${pathto}/.keep" ] then [[ ${VERBOSE} = on ]] && \ - echo -e "${COLRED} .keep${COLDEFAULT} === DIR: ${MROOT}${pathto}" + echo -e "${COLRED}! .keep${COLDEFAULT} === DIR: ${MROOT}${pathto}" continue fi @@ -971,7 +968,7 @@ [[ ${VERBOSE} = on ]] && \ echo -e "${COLRED}! empty${COLDEFAULT} === DIR: ${MROOT}${pathto}" fi - done < ${MROOT}${INSTALLDB}/${pfull}/.dirs + done # very important: unsetting the '§' fieldseperator IFS=$'\n' @@ -2253,20 +2250,23 @@ echo -ne "${COLBLUE} --- ${COLDEFAULT}" echo "following candidate(s) will be removed:" echo -ne "${COLBLUE} --- ${COLDEFAULT}" - echo -ne "\033[1m${can_pcat}/${can_pname}:${COLDEFAULT}" + echo -ne "${COLBOLD}${can_pcat}/${can_pname}:${COLDEFAULT}" echo -e "${COLRED} ${can_ver_list} ${COLDEFAULT}" echo - echo -ne "${COLBLUE} --- ${COLDEFAULT}" - echo "( Press [CTRL+C] to abort )" - echo -ne "${COLBLUE} --- ${COLDEFAULT}" - echo -n "Waiting ${MAGE_UNINSTALL_TIMEOUT} seconds ..." - for ((i=MAGE_UNINSTALL_TIMEOUT; i >= 0; i--)) - do - echo -ne "${COLRED} ${i}${COLDEFAULT}" - sleep 1 - done - echo - echo + if [ ${MAGE_UNINSTALL_TIMEOUT} -gt 0 ] + then + echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo "( Press [CTRL+C] to abort )" + echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo -n "Waiting ${MAGE_UNINSTALL_TIMEOUT} seconds ..." + for ((i=MAGE_UNINSTALL_TIMEOUT; i >= 0; i--)) + do + echo -ne "${COLRED} ${i}${COLDEFAULT}" + sleep 1 + done + echo + echo + fi for pkg in ${list} do @@ -2341,7 +2341,7 @@ echo -ne "${COLBLUE}${pcat}/${COLDEFAULT}" echo -e "${COLGREEN}${pname}-${pver}-${pbuild}${COLDEFAULT}" - magefile="${MAGEDIR}/${pcat}/${pname}/${pname}-${pver}-${pbuild}.mage" + magefile="${INSTALLDB}/${pcat}/${pname}-${pver}-${pbuild}/${pname}-${pver}-${pbuild}.mage" source ${magefile} ## preremove scripts