Magellan Linux

Diff of /branches/mage-next/src/mage4.functions.sh

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

trunk/mage/usr/lib/mage/mage4.functions.sh revision 2365 by niro, Mon Jan 6 12:56:50 2014 UTC branches/mage-next/src/mage4.functions.sh revision 2560 by niro, Wed Jan 29 12:12:22 2014 UTC
# Line 3054  mage_uninstall() Line 3054  mage_uninstall()
3054   unset -f postremove   unset -f postremove
3055  }  }
3056    
3057    # rerun_pkgfunctions [method] pkg1 pkg2 pkg3
3058    rerun_pkgfunctions()
3059    {
3060     local method
3061     local list
3062     local pcat
3063     local pname
3064     local pver
3065     local pbuild
3066     local magefile
3067     local i
3068    
3069     # very basic getops
3070     case $1 in
3071     --method) shift; method="$1" ;;
3072     esac
3073     shift
3074     local list="$@"
3075    
3076     # sanity check
3077     case ${method} in
3078     preinstall|postinstall) ;;
3079     preremove|postremove) ;;
3080     *) die "rerun_pkgfunctions(): Unknown method '${method}'." ;;
3081     esac
3082    
3083     if [[ -n ${MROOT} ]]
3084     then
3085     echo -ne ${COLRED}
3086     echo "!! running in MROOT=${MROOT}"
3087     echo -ne ${COLDEFAULT}
3088     echo
3089     fi
3090    
3091     for pkg in ${list}
3092     do
3093     pcat=$(dep2pcat ${pkg})
3094     pname=$(magename2pname ${pkg})
3095     pver=$(magename2pver ${pkg})
3096     pbuild=$(magename2pbuild ${pkg})
3097     magefile="${MROOT}${INSTALLDB}/${pcat}/${pname}-${pver}-${pbuild}/${pname}-${pver}-${pbuild}.mage"
3098    
3099     if [ -e ${magefile} ]
3100     then
3101     source ${magefile}
3102     if [ -n "$(typeset -f ${method})" ]
3103     then
3104     echo -e " ${COLBLUE}***${COLDEFAULT} running ${method} for ${pkg} ... "
3105     ${method}
3106     else
3107     echo "No ${method}() for pkg '${pkg}' defined. Doing nothing."
3108     fi
3109     unset -f preinstall postinstall preremove postremove
3110     else
3111     die "Magefile '${magefile}' does not exist."
3112     fi
3113     done
3114    }
3115    
3116  show_etc_update_mesg()  show_etc_update_mesg()
3117  {  {
3118   [ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0   [ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0

Legend:
Removed from v.2365  
changed lines
  Added in v.2560