Magellan Linux

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

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

revision 1590 by niro, Thu Dec 29 15:12:05 2011 UTC revision 1648 by niro, Fri Jan 13 20:51:18 2012 UTC
# Line 66  mchecksum() Line 66  mchecksum()
66   case ${method} in   case ${method} in
67   md5) cmd="md5sum" ;;   md5) cmd="md5sum" ;;
68   sha256) cmd="sha256sum" ;;   sha256) cmd="sha256sum" ;;
69   *) die "mchecksum(): unkown method '${method}'" ;;   *) die "mchecksum(): unknown method '${method}'" ;;
70   esac   esac
71    
72   if [[ -d ${rundir} ]]   if [[ -d ${rundir} ]]
# Line 1401  mdownload() Line 1401  mdownload()
1401   real_uris="$(convertmirrors ${uri})"   real_uris="$(convertmirrors ${uri})"
1402    
1403   # verbose or not   # verbose or not
1404   mqueryfeature "!verbose" && wget_opts="--quiet"   mqueryfeature "!verbose" && wget_opts+=" --quiet"
1405    
1406   # filter wget options if busybox was found   # filter wget options if busybox was found
1407   wget_opts="$(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})"   wget_opts+=" $(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})"
1408    
1409   # create outputdir   # create outputdir
1410   [[ ! -d ${outputdir} ]] && install -d "${outputdir}"   [[ ! -d ${outputdir} ]] && install -d "${outputdir}"
# Line 2999  pkgsearch() Line 2999  pkgsearch()
2999   local state   local state
3000   local descriptiom   local descriptiom
3001   local homepage   local homepage
3002     local license
3003   local i   local i
3004   local all_installed   local all_installed
3005   local ipver   local ipver
# Line 3035  pkgsearch() Line 3036  pkgsearch()
3036   state="$(get_value_from_magefile STATE ${magefile})"   state="$(get_value_from_magefile STATE ${magefile})"
3037   description="$(get_value_from_magefile DESCRIPTION ${magefile})"   description="$(get_value_from_magefile DESCRIPTION ${magefile})"
3038   homepage="$(get_value_from_magefile HOMEPAGE ${magefile})"   homepage="$(get_value_from_magefile HOMEPAGE ${magefile})"
3039     license="$(get_value_from_magefile LICENSE ${magefile})"
3040    
3041   # all installed   # all installed
3042   for i in $(get_uninstall_candidates --pname ${pname} --pcat ${pcat})   for i in $(get_uninstall_candidates --pname ${pname} --pcat ${pcat})
3043   do   do
3044   ipver="$(magename2pver ${i})"   ipver="$(magename2pver ${i})"
3045   ipbuild="$(magename2pbuild ${i})"   ipbuild="$(magename2pbuild ${i})"
3046    
3047   if [[ -z ${all_installed} ]]   if [[ -z ${all_installed} ]]
3048   then   then
3049   all_installed="${ipver}-${ipbuild}"   all_installed="${ipver}-${ipbuild}"
# Line 3050  pkgsearch() Line 3052  pkgsearch()
3052   fi   fi
3053   done   done
3054   [[ -z ${all_installed} ]] && all_installed="none"   [[ -z ${all_installed} ]] && all_installed="none"
3055    
3056   case ${state} in   case ${state} in
3057   stable) state=${COLGREEN}"[s] ";;   stable) state=${COLGREEN}"[s] ";;
3058   testing) state=${COLYELLOW}"[t] ";;   testing) state=${COLYELLOW}"[t] ";;
# Line 3095  EOF Line 3097  EOF
3097   echo "      Installed versions: ${all_installed}"   echo "      Installed versions: ${all_installed}"
3098   echo "      Description: ${description}"   echo "      Description: ${description}"
3099   echo "      Homepage: ${homepage}"   echo "      Homepage: ${homepage}"
3100     if [[ ! -z ${license} ]]
3101     then
3102     echo "      License:  ${license}"
3103     fi
3104   echo "      Depends: ${deps}"   echo "      Depends: ${deps}"
3105   echo "      SDepends: ${sdeps}"   echo "      SDepends: ${sdeps}"
3106   echo   echo
# Line 3285  known_mage_feature() Line 3291  known_mage_feature()
3291   ccache|!ccache) retval=0 ;;   ccache|!ccache) retval=0 ;;
3292   check|!check) retval=0 ;;   check|!check) retval=0 ;;
3293   compressdoc|!compressdoc) retval=0 ;;   compressdoc|!compressdoc) retval=0 ;;
3294     debug|!debug) retval=0 ;;
3295   distcc|!distcc) retval=0 ;;   distcc|!distcc) retval=0 ;;
3296   kernelsrcunpack|!kernelsrcunpack) retval=0 ;;   kernelsrcunpack|!kernelsrcunpack) retval=0 ;;
3297   libtool|!libtool) retval=0 ;;   libtool|!libtool) retval=0 ;;
# Line 3293  known_mage_feature() Line 3300  known_mage_feature()
3300   purge|!purge) retval=0 ;;   purge|!purge) retval=0 ;;
3301   qalint|!qalint) retval=0 ;;   qalint|!qalint) retval=0 ;;
3302   regentree|!regentree) retval=0 ;;   regentree|!regentree) retval=0 ;;
3303   stepbystep|!stepbystep) retval=0 ;;   resume|!resume) retval=0 ;;
3304   srcpkgbuild|!srcpkgbuild) retval=0 ;;   srcpkgbuild|!srcpkgbuild) retval=0 ;;
3305   srcpkgtarball|!srcpkgtarball) retval=0 ;;   srcpkgtarball|!srcpkgtarball) retval=0 ;;
3306     static|!static) retval=0 ;;
3307     stepbystep|!stepbystep) retval=0 ;;
3308   strip|!strip) retval=0 ;;   strip|!strip) retval=0 ;;
3309     verbose|!verbose) retval=0 ;;
3310   *) retval=1 ;;   *) retval=1 ;;
3311   esac   esac
3312    
# Line 3305  known_mage_feature() Line 3315  known_mage_feature()
3315    
3316  load_mage_features()  load_mage_features()
3317  {  {
  echo -en "${COLBLUE}---${COLGREEN} Loading mage-features... ${COLDEFAULT}"  
3318   for i in ${MAGE_FEATURES_GLOBAL[*]} ${MAGE_FEATURES[*]}   for i in ${MAGE_FEATURES_GLOBAL[*]} ${MAGE_FEATURES[*]}
3319   do   do
3320   FVERBOSE=off msetfeature ${i}   FVERBOSE=off msetfeature ${i}
3321   done   done
   
  echo -e "${COLGREEN}done${COLDEFAULT}"  
3322  }  }
3323    
3324  msetfeature()  msetfeature()
# Line 3328  msetfeature() Line 3335  msetfeature()
3335    
3336   if ! known_mage_feature "${feature}"   if ! known_mage_feature "${feature}"
3337   then   then
3338   [[ ${FVERBOSE} = off ]] || echo "unkown feature ${feature}, ignoring it"   [[ ${FVERBOSE} = off ]] || echo -e "${COLRED}Unknown feature '${feature}', ignoring it${COLDEFAULT}"
3339   return 3   return 3
3340   fi   fi
3341    
# Line 3336  msetfeature() Line 3343  msetfeature()
3343   do   do
3344   if [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature} ]]   if [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature} ]]
3345   then   then
3346   [[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' already enabled"   [[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' already enabled${COLDEFAULT}"
3347   MAGE_FEATURES_CURRENT[${i}]="${feature}"   MAGE_FEATURES_CURRENT[${i}]="${feature}"
3348   found=1   found=1
3349   elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = !${feature} ]]   elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = !${feature} ]]
3350   then   then
3351   [[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' currently disabled, enabling it!"   [[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' currently disabled, enabling it!${COLDEFAULT}"
3352   MAGE_FEATURES_CURRENT[${i}]="${feature}"   MAGE_FEATURES_CURRENT[${i}]="${feature}"
3353   found=1   found=1
3354   elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature//!} ]]   elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature//!} ]]
3355   then   then
3356   [[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature//!}' currently enabled, disabling it!"   [[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature//!}' currently enabled, disabling it!${COLDEFAULT}"
3357   MAGE_FEATURES_CURRENT[${i}]="${feature}"   MAGE_FEATURES_CURRENT[${i}]="${feature}"
3358   found=1   found=1
3359   fi   fi
# Line 3356  msetfeature() Line 3363  msetfeature()
3363   # it was not declared. in this case enable it   # it was not declared. in this case enable it
3364   if [[ ${found} = 0 ]]   if [[ ${found} = 0 ]]
3365   then   then
3366   [[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' was not declared, enabling it!"   [[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' was not declared, enabling it!${COLDEFAULT}"
3367   MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" )   MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" )
3368   fi   fi
3369    
# Line 3381  mqueryfeature() Line 3388  mqueryfeature()
3388   fi   fi
3389   done   done
3390   else   else
3391     [[ ${FVERBOSE} = off ]] || echo -e "${COLRED}Unknown feature '${feature}', ignoring it${COLDEFAULT}"
3392   retval=3   retval=3
3393   fi   fi
3394    

Legend:
Removed from v.1590  
changed lines
  Added in v.1648