Magellan Linux

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

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

revision 2364 by niro, Mon Jan 6 12:53:31 2014 UTC revision 2724 by niro, Tue Jul 22 14:21:01 2014 UTC
# Line 2563  get_value_from_magefile() Line 2563  get_value_from_magefile()
2563   local SDEPEND   local SDEPEND
2564   local PROVIDE   local PROVIDE
2565   local PKGTYPE   local PKGTYPE
  local MAGE_TARGETS  
2566   local SPLIT_PACKAGE_BASE   local SPLIT_PACKAGE_BASE
2567   local preinstall   local preinstall
2568   local postinstall   local postinstall
# Line 2685  mage_install() Line 2684  mage_install()
2684   echo B:${pbuild}   echo B:${pbuild}
2685   fi   fi
2686    
2687   if [[ -n ${MAGE_TARGETS} ]]   if [[ -n ${SPLIT_PACKAGE_BASE} ]]
  then  
  # basic svn compat  
  if [[ -d ${SMAGESCRIPTSDIR}/.svn ]]  
  then  
  for i in ${SMAGESCRIPTSDIR}/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2  
  do  
  smage2file="${i}"  
  done  
  else  
  smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2  
  fi  
   
  elif [[ -n ${SPLIT_PACKAGE_BASE} ]]  
2688   then   then
2689   # basic svn compat   # basic svn compat
2690   if [[ -d ${SMAGESCRIPTSDIR}/.svn ]]   if [[ -d ${SMAGESCRIPTSDIR}/.svn ]]
# Line 3068  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
# Line 3479  msetfeature() Line 3524  msetfeature()
3524   MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" )   MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" )
3525   fi   fi
3526    
3527   export MAGE_FEATURE_CURRENT   export MAGE_FEATURES_CURRENT
3528   done   done
3529  }  }
3530    

Legend:
Removed from v.2364  
changed lines
  Added in v.2724