Magellan Linux

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

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

revision 1758 by niro, Sat Feb 18 13:48:34 2012 UTC revision 1962 by niro, Thu Oct 25 07:17:17 2012 UTC
# Line 1887  count_protected_files() Line 1887  count_protected_files()
1887   count="$(echo ${oldprotected} | sed 's:.*\/._cfg\(.*\)_.*:\1:')"   count="$(echo ${oldprotected} | sed 's:.*\/._cfg\(.*\)_.*:\1:')"
1888   done   done
1889    
1890   # dirty hack to convert 0001 -> 1; 0120 -> 120 etc   # convert 0001 -> 1; 0120 -> 120 etc
1891   x="${#count}"   # use bash internal base functions to this task
1892     x="$((10#${count}))"
1893   for (( i=0; i<x; i++ ))   for (( i=0; i<x; i++ ))
1894   do   do
1895   if [[ ${count:${i}:1} != 0 ]]   if [[ ${count:${i}:1} != 0 ]]
# Line 1898  count_protected_files() Line 1899  count_protected_files()
1899   fi   fi
1900   done   done
1901    
1902   count="${count}+1"   count="$(( ${count}+1 ))"
1903    
1904   # fill output up with zeros   # fill output up with zeros
1905   for (( i=${#count}; i < 4; i++ )); do output="${output}0"; done   for (( i=${#count}; i < 4; i++ )); do output="${output}0"; done
# Line 3119  pkgsearch() Line 3120  pkgsearch()
3120   "") continue;;   "") continue;;
3121   esac   esac
3122    
3123   deps="${deps} $(basename ${dep%-*})"   if [[ -z ${deps} ]]
3124     then
3125     deps="$(basename ${dep%-*})"
3126     else
3127     deps="${deps} $(basename ${dep%-*})"
3128     fi
3129   done << EOF   done << EOF
3130  ${depsfull}  ${depsfull}
3131  EOF  EOF
# Line 3130  EOF Line 3136  EOF
3136   "") continue;;   "") continue;;
3137   esac   esac
3138    
3139   sdeps="${sdeps} $(basename ${dep%-*})"   if [[ -z ${sdeps} ]]
3140     then
3141     sdeps="$(basename ${dep%-*})"
3142     else
3143     sdeps="${sdeps} $(basename ${dep%-*})"
3144     fi
3145   done << EOF   done << EOF
3146  ${sdepsfull}  ${sdepsfull}
3147  EOF  EOF
# Line 3144  EOF Line 3155  EOF
3155   then   then
3156   echo "      License:  ${license}"   echo "      License:  ${license}"
3157   fi   fi
3158   echo "      Depends: ${deps}"   echo "      Depends:  ${deps}"
3159   echo "      SDepends: ${sdeps}"   echo "      SDepends: ${sdeps}"
3160   echo   echo
3161    
# Line 3261  EOF Line 3272  EOF
3272  need_busybox_support()  need_busybox_support()
3273  {  {
3274   local cmd   local cmd
3275     local busybox
3276   cmd="$1"   cmd="$1"
3277    
3278   if [[ -x /bin/busybox ]]   for busybox in {,/usr}/bin/busybox
3279   then   do
3280   if [[ $(readlink $(which ${cmd})) = /bin/busybox ]]   if [[ -x ${busybox} ]]
3281   then   then
3282   # needs busybox support   if [[ $(readlink $(which ${cmd})) = ${busybox} ]]
3283   return 0   then
3284     # needs busybox support
3285     return 0
3286     fi
3287   fi   fi
3288   fi   done
3289    
3290   # no busybox   # no busybox
3291   return 1   return 1
# Line 3441  mqueryfeature() Line 3456  mqueryfeature()
3456    
3457  mprintfeatures()  mprintfeatures()
3458  {  {
3459   echo "Global features:  ${MAGE_FEATURES_GLOBAL[*]}"   echo -e "${COLRED}Global features:${COLDEFAULT} ${MAGE_FEATURES_GLOBAL[*]}"
3460   echo "Local features:   ${MAGE_FEATURES[*]}"   echo -e "${COLYELLOW}Local features:${COLDEFAULT} ${MAGE_FEATURES[*]}"
3461   echo "Current features: ${MAGE_FEATURES_CURRENT[*]}"   echo -e "${COLGREEN}Current features:${COLDEFAULT} ${MAGE_FEATURES_CURRENT[*]}"
3462  }  }

Legend:
Removed from v.1758  
changed lines
  Added in v.1962