Magellan Linux

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

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

revision 240 by niro, Sun Sep 11 19:47:08 2005 UTC revision 258 by niro, Tue Oct 4 14:35:21 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.3 2005-09-11 19:47:08 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.7 2005-10-04 14:35:21 niro Exp $
4    
5  mage_setup()  mage_setup()
6  {  {
# Line 1667  is_newer_mage_version_available() Line 1667  is_newer_mage_version_available()
1667   local newest_mage   local newest_mage
1668   local installed_mage   local installed_mage
1669    
1670   newest_mage="$( CATEGORIE=app-mage MAGENAME=mage get_highest_magefile;echo $(basename ${MAGEFILE} .mage) )"   newest_mage="$(basename $(get_highest_magefile app-mage mage) .mage)"
1671   installed_mage="$(magequery -n mage | cut -d' ' -f5)"   installed_mage="$(magequery -n mage | cut -d' ' -f5)"
1672    
1673   if [[ ${newest_mage} > ${installed_mage} ]]   if [[ ${newest_mage} > ${installed_mage} ]]
# Line 1960  get_value_from_magefile() Line 1960  get_value_from_magefile()
1960   local PKGTYPE   local PKGTYPE
1961   local preinstall   local preinstall
1962   local postinstall   local postinstall
1963     local preremove
1964     local postremove
1965    
1966   # sanity checks   # sanity checks
1967   [ -f ${magefile} ] && source ${magefile} || \   [ -f ${magefile} ] && source ${magefile} || \
# Line 1969  get_value_from_magefile() Line 1971  get_value_from_magefile()
1971   source ${magefile}   source ${magefile}
1972   eval value=\$$(echo ${var})   eval value=\$$(echo ${var})
1973   echo "${value}"   echo "${value}"
1974    
1975     # unset these functions
1976     unset -f preinstall
1977     unset -f postinstall
1978     unset -f preremove
1979     unset -f postremove
1980  }  }
1981    
1982  mage_install()  mage_install()
# Line 1985  mage_install() Line 1993  mage_install()
1993   local PKGTYPE   local PKGTYPE
1994   local preinstall   local preinstall
1995   local postinstall   local postinstall
1996     local preremove
1997     local postremove
1998    
1999   local pcat   local pcat
2000   local pname   local pname
# Line 2146  mage_install() Line 2156  mage_install()
2156  # echo -ne "${COLBLUE}${pcat}/${COLDEFAULT}"  # echo -ne "${COLBLUE}${pcat}/${COLDEFAULT}"
2157  # echo -ne "${COLGREEN}${pname}-${pver}-${pbuild}${COLDEFAULT} "  # echo -ne "${COLGREEN}${pname}-${pver}-${pbuild}${COLDEFAULT} "
2158   echo "successfully installed."   echo "successfully installed."
2159    
2160     # unset these functions
2161     unset -f preinstall
2162     unset -f postinstall
2163     unset -f preremove
2164     unset -f postremove
2165  }  }
2166    
2167  md5sum_packages()  md5sum_packages()
# Line 2304  mage_uninstall() Line 2320  mage_uninstall()
2320   local PKGTYPE   local PKGTYPE
2321   local preinstall   local preinstall
2322   local postinstall   local postinstall
2323     local preremove
2324     local postremove
2325    
2326   local pcat   local pcat
2327   local pname   local pname
# Line 2401  mage_uninstall() Line 2419  mage_uninstall()
2419  # echo -ne "${COLBLUE}${pcat}/${COLDEFAULT}"  # echo -ne "${COLBLUE}${pcat}/${COLDEFAULT}"
2420  # echo -ne "${COLGREEN}${pname}-${pver}-${pbuild}${COLDEFAULT} "  # echo -ne "${COLGREEN}${pname}-${pver}-${pbuild}${COLDEFAULT} "
2421   echo "successfully removed."   echo "successfully removed."
2422    
2423     # unset these functions
2424     unset -f preinstall
2425     unset -f postinstall
2426     unset -f preremove
2427     unset -f postremove
2428  }  }
2429    
2430  show_etc_update_mesg() {  show_etc_update_mesg() {
# Line 2499  pkgsearch() Line 2523  pkgsearch()
2523   unset ipbuild   unset ipbuild
2524   done   done
2525  }  }
2526    
2527    export_inherits()
2528    {
2529     local include="$1"
2530     shift
2531    
2532     while [ "$1" ]
2533     do
2534     local functions="$1"
2535    
2536     # sanity checks
2537     [ -z "${include}" ] && die "export_inherits(): \$include not given."
2538     [ -z "${functions}" ] && die "export_inherits(): \$functions not given."
2539    
2540     eval "${functions}() { ${include}_${functions} ; }"
2541    
2542     # debug
2543     [[ ${MAGEDEBUG} = on ]] && typeset -f "${functions}"
2544    
2545     shift
2546     done
2547    }

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