Magellan Linux

Diff of /trunk/mage/usr/lib/mage/mage4.functions.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 239 by niro, Sat Sep 10 13:35:55 2005 UTC revision 240 by niro, Sun Sep 11 19:47:08 2005 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # Magellan Linux Installer Functions (mage.functions.sh)  # Magellan Linux Installer Functions (mage.functions.sh)
3  # $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 $
4    
5  mage_setup()  mage_setup()
6  {  {
# Line 744  remove_files() Line 744  remove_files()
744   do   do
745   [ -z "${pathto}" ] && continue   [ -z "${pathto}" ] && continue
746    
747   if [ -e "${MROOT}${pathto}" ]   if [ ! -e "${MROOT}${pathto}" ]
748   then   then
749   [[ ${VERBOSE} = on ]] && \   [[ ${VERBOSE} = on ]] && \
750   echo -e "${COLRED}! exist${COLDEFAULT} === FILE: ${MROOT}${pathto}"   echo -e "${COLRED}! exist${COLDEFAULT} === FILE: ${MROOT}${pathto}"
# Line 932  remove_directories() Line 932  remove_directories()
932    
933   [ ! -f ${MROOT}${INSTALLDB}/${pfull}/.char ] && die "remove_directories() .dirs not found"   [ ! -f ${MROOT}${INSTALLDB}/${pfull}/.char ] && die "remove_directories() .dirs not found"
934    
  # uninstall of dirs ## added small hack to fix dirs  
  # must be reverse -> smage2 doesn't sort them  
  # -> using tac  
   
935   # sets fieldseperator to "§" instead of " "   # sets fieldseperator to "§" instead of " "
936   IFS=§   IFS=§
937    
938   while read pathto posix   # reversed order is mandatory !
939     tac ${MROOT}${INSTALLDB}/${pfull}/.dirs | while read pathto posix
940   do   do
941   [ -z "${pathto}" ] && continue   [ -z "${pathto}" ] && continue
942    
# Line 954  remove_directories() Line 951  remove_directories()
951   if [ -f "${MROOT}${pathto}/.keep" ]   if [ -f "${MROOT}${pathto}/.keep" ]
952   then   then
953   [[ ${VERBOSE} = on ]] && \   [[ ${VERBOSE} = on ]] && \
954   echo -e "${COLRED}  .keep${COLDEFAULT} === DIR:  ${MROOT}${pathto}"   echo -e "${COLRED}! .keep${COLDEFAULT} === DIR:  ${MROOT}${pathto}"
955   continue   continue
956   fi   fi
957    
# Line 971  remove_directories() Line 968  remove_directories()
968   [[ ${VERBOSE} = on ]] && \   [[ ${VERBOSE} = on ]] && \
969   echo -e "${COLRED}! empty${COLDEFAULT} === DIR:  ${MROOT}${pathto}"   echo -e "${COLRED}! empty${COLDEFAULT} === DIR:  ${MROOT}${pathto}"
970   fi   fi
971   done < ${MROOT}${INSTALLDB}/${pfull}/.dirs   done
972    
973   # very important: unsetting the '§' fieldseperator   # very important: unsetting the '§' fieldseperator
974   IFS=$'\n'   IFS=$'\n'
# Line 2253  uninstall_packages() Line 2250  uninstall_packages()
2250   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
2251   echo "following candidate(s) will be removed:"   echo "following candidate(s) will be removed:"
2252   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
2253   echo -ne "\033[1m${can_pcat}/${can_pname}:${COLDEFAULT}"   echo -ne "${COLBOLD}${can_pcat}/${can_pname}:${COLDEFAULT}"
2254   echo -e "${COLRED} ${can_ver_list} ${COLDEFAULT}"   echo -e "${COLRED} ${can_ver_list} ${COLDEFAULT}"
2255   echo   echo
2256   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   if [ ${MAGE_UNINSTALL_TIMEOUT} -gt 0 ]
2257   echo "( Press [CTRL+C] to abort )"   then
2258   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
2259   echo -n "Waiting ${MAGE_UNINSTALL_TIMEOUT} seconds ..."   echo "( Press [CTRL+C] to abort )"
2260   for ((i=MAGE_UNINSTALL_TIMEOUT; i >= 0; i--))   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
2261   do   echo -n "Waiting ${MAGE_UNINSTALL_TIMEOUT} seconds ..."
2262   echo -ne "${COLRED} ${i}${COLDEFAULT}"   for ((i=MAGE_UNINSTALL_TIMEOUT; i >= 0; i--))
2263   sleep 1   do
2264   done   echo -ne "${COLRED} ${i}${COLDEFAULT}"
2265   echo   sleep 1
2266   echo   done
2267     echo
2268     echo
2269     fi
2270    
2271   for pkg in ${list}   for pkg in ${list}
2272   do   do
# Line 2341  mage_uninstall() Line 2341  mage_uninstall()
2341   echo -ne "${COLBLUE}${pcat}/${COLDEFAULT}"   echo -ne "${COLBLUE}${pcat}/${COLDEFAULT}"
2342   echo -e "${COLGREEN}${pname}-${pver}-${pbuild}${COLDEFAULT}"   echo -e "${COLGREEN}${pname}-${pver}-${pbuild}${COLDEFAULT}"
2343    
2344   magefile="${MAGEDIR}/${pcat}/${pname}/${pname}-${pver}-${pbuild}.mage"   magefile="${INSTALLDB}/${pcat}/${pname}-${pver}-${pbuild}/${pname}-${pver}-${pbuild}.mage"
2345   source ${magefile}   source ${magefile}
2346    
2347   ## preremove scripts   ## preremove scripts

Legend:
Removed from v.239  
changed lines
  Added in v.240