Magellan Linux

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

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

revision 189 by niro, Sun Jul 31 18:50:19 2005 UTC revision 190 by niro, Fri Aug 19 02:22:37 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/mage3.functions.sh,v 1.15 2005-07-31 18:50:19 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage3.functions.sh,v 1.16 2005-08-19 02:22:37 niro Exp $
4    
5  mage_setup() {  mage_setup() {
6   install -d $INSTALLDB   install -d $INSTALLDB
# Line 485  remove_symlinks() { Line 485  remove_symlinks() {
485   # 1=keep me   #   # 1=keep me   #
486   case ${RETVAL} in   case ${RETVAL} in
487   0)   0)
488   echo -e "\t<<< LINK: $pathto"   if [ "${VERBOSE}" == "on" ]
489   rm "$pathto"   then
490     echo -e "\t<<< LINK: $pathto"
491     fi
492     rm "$pathto"
493   ;;   ;;
494   1)   1)
495   echo -e "${COLRED}! mtime${COLDEFAULT} === LINK: $pathto"   if [ "${VERBOSE}" == "on" ]
496     then
497     echo -e "${COLRED}! mtime${COLDEFAULT} === LINK: $pathto"
498     fi
499   ;;   ;;
500   esac   esac
501   else   else
502   echo -e "${COLRED}! exist${COLDEFAULT} === LINK: $pathto"   if [ "${VERBOSE}" == "on" ]
503     then
504     echo -e "${COLRED}! exist${COLDEFAULT} === LINK: $pathto"
505     fi
506   fi   fi
507   fi   fi
508   done < ${INSTALLDB}/${PKGNAME}/.symlinks   done < ${INSTALLDB}/${PKGNAME}/.symlinks
# Line 534  remove_files() { Line 543  remove_files() {
543   # 1=keep me   #   # 1=keep me   #
544   case ${RETVAL} in   case ${RETVAL} in
545   0)   0)
546   echo -e "\t<<< FILE: $pathto"   if [ "${VERBOSE}" == "on" ]
547     then
548     echo -e "\t<<< FILE: $pathto"
549     fi
550   rm "$pathto"   rm "$pathto"
551   ;;   ;;
552   1)   1)
553   echo -e "${COLRED}! mtime${COLDEFAULT} === FILE: $pathto"   if [ "${VERBOSE}" == "on" ]
554     then
555     echo -e "${COLRED}! mtime${COLDEFAULT} === FILE: $pathto"
556     fi
557   ;;   ;;
558   esac   esac
559   else   else
560   echo -e "${COLRED}! exist${COLDEFAULT} === FILE: $pathto"   if [ "${VERBOSE}" == "on" ]
561     then
562     echo -e "${COLRED}! exist${COLDEFAULT} === FILE: $pathto"
563     fi
564   fi   fi
565   fi   fi
566   done < ${INSTALLDB}/${PKGNAME}/.files   done < ${INSTALLDB}/${PKGNAME}/.files
# Line 572  remove_blockdevices() { Line 590  remove_blockdevices() {
590   do   do
591   if [ ! -z "$pathto" ]   if [ ! -z "$pathto" ]
592   then   then
593   echo -e "\t<<< PIPE: $pathto"   if [ "${VERBOSE}" == "on" ]
594     then
595     echo -e "\t<<< PIPE: $pathto"
596     fi
597   rm "$pathto"   rm "$pathto"
598   fi   fi
599   done < ${INSTALLDB}/${PKGNAME}/.pipes   done < ${INSTALLDB}/${PKGNAME}/.pipes
# Line 602  remove_characterdevices() { Line 623  remove_characterdevices() {
623   do   do
624   if [ ! -z "$pathto" ]   if [ ! -z "$pathto" ]
625   then   then
626   echo -e "\t<<< CHAR: $pathto"   if [ "${VERBOSE}" == "on" ]
627     then
628     echo -e "\t<<< CHAR: $pathto"
629     fi
630   rm "$pathto"   rm "$pathto"
631   fi   fi
632   done < ${INSTALLDB}/${PKGNAME}/.char   done < ${INSTALLDB}/${PKGNAME}/.char
# Line 641  remove_directories() { Line 665  remove_directories() {
665   then   then
666   if [ -e "$pathto" ]   if [ -e "$pathto" ]
667   then   then
668   echo -e "\t<<< DIR:  $pathto"   if [ "${VERBOSE}" == "on" ]
669     then
670     echo -e "\t<<< DIR:  $pathto"
671     fi
672   rmdir "$pathto" &> /dev/null   rmdir "$pathto" &> /dev/null
673   if [ "$?" -ne "0" ]   if [ "$?" -ne "0" ]
674   then   then
675   #moves the cursor up   if [ "${VERBOSE}" == "on" ]
676   echo -en \\033[A   then
677   echo -e "${COLRED}! empty${COLDEFAULT} === DIR:  $pathto"   #moves the cursor up
678     echo -en \\033[A
679     echo -e "${COLRED}! empty${COLDEFAULT} === DIR:  $pathto"
680     fi
681   fi   fi
682   else   else
683   echo -e "${COLRED}! exist${COLDEFAULT} === DIR:  $pathto"   if [ "${VERBOSE}" == "on" ]
684     then
685     echo -e "${COLRED}! exist${COLDEFAULT} === DIR:  $pathto"
686     fi
687   fi   fi
688   fi   fi
689   done < ${INSTALLDB}/${PKGNAME}/.dirs   done < ${INSTALLDB}/${PKGNAME}/.dirs
# Line 976  get_highest_magefile(){ Line 1009  get_highest_magefile(){
1009   #CATEGORIE=$1   #CATEGORIE=$1
1010   #PKGNAME=$2   #PKGNAME=$2
1011    
1012   for i in ${MAGEDIR}/${CATEGORIE}/${MAGENAME}/*   for i in $(ls --format=single-column -v ${MAGEDIR}/${CATEGORIE}/${MAGENAME}/*)
1013   do   do
1014   #we exclude subdirs (for stuff like a md5sum dir)   #we exclude subdirs (for stuff like a md5sum dir)
1015   if [ ! -d ${i} ]   if [ ! -d ${i} ]

Legend:
Removed from v.189  
changed lines
  Added in v.190