Magellan Linux

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

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

revision 1762 by niro, Sat Feb 18 13:56:34 2012 UTC revision 2752 by niro, Thu Aug 14 14:26:07 2014 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.38 2008-10-05 10:32:24 niro Exp $  # $Id$
4    
5  COLRED="\033[1;6m\033[31m"  COLRED="\033[1;6m\033[31m"
6  COLGREEN="\033[1;6m\033[32m"  COLGREEN="\033[1;6m\033[32m"
# Line 46  mchecksum() Line 46  mchecksum()
46   local method   local method
47   local cmd   local cmd
48   local retval   local retval
49     local sum
50     local dest
51    
52   # very basic getops   # very basic getops
53   for i in $*   for i in $*
# Line 72  mchecksum() Line 74  mchecksum()
74   if [[ -d ${rundir} ]]   if [[ -d ${rundir} ]]
75   then   then
76   pushd ${rundir} &> /dev/null   pushd ${rundir} &> /dev/null
77   # be verbose here  
78   ${cmd} -c ${file} #&> /dev/null   # all file must be non-zero
79   retval="$?"   retval=0
80     while read sum dest
81     do
82     if [ ! -s ${dest} ]
83     then
84     echo "${dest}: file is empty ;("
85     retval=127
86     fi
87     done < ${file}
88     if [[ ${retval} != 127 ]]
89     then
90     # be verbose here
91     ${cmd} -c ${file} #&> /dev/null
92     retval="$?"
93     fi
94    
95   popd &> /dev/null   popd &> /dev/null
96   else   else
97   retval=1   retval=1
# Line 102  mcheckemptydir() Line 119  mcheckemptydir()
119   return ${retval}   return ${retval}
120  }  }
121    
122    unpack_package()
123    {
124     local magefile="$1"
125     local pkgname
126     local pkgfile
127     local pkgtype
128     local tar_opts
129    
130     pkgname="$(get_value_from_magefile PKGNAME ${magefile})"
131     pkgfile="${pkgname}.${PKGSUFFIX}"
132     pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"
133    
134     xtitle "[ Unpacking ${pkg} ]"
135    
136     # abort on virtual pkg
137     if [[ ${pkgtype} = virtual ]]
138     then
139     echo -ne " ${COLBLUE}---${COLDEFAULT}"
140     echo " !unpack virtual ${pkgname} ... "
141     continue
142     fi
143    
144     # abort on sources pkg
145     if [[ ${pkgtype} = sources ]]
146     then
147     echo -ne " ${COLBLUE}---${COLDEFAULT}"
148     echo " !unpack sources ${pkgname} ... "
149     continue
150     fi
151    
152     # busybox?
153     if need_busybox_support tar
154     then
155     tar_opts="xjf"
156     else
157     tar_opts="xjmf"
158     fi
159    
160     echo -e " ${COLBLUE}***${COLDEFAULT} unpacking ${pkgfile} ... "
161     tar ${tar_opts} ${PKGDIR}/${pkgfile} -C ${BUILDDIR} || die "Unpacking package ${pkgfile}"
162    }
163    
164  unpack_packages()  unpack_packages()
165  {  {
166   local list="$@"   local list="$@"
167   local magefile   local magefile
  local pkg  
  local pkgtype  
168   local count_current   local count_current
169   local count_total   local count_total
170   local tar_opts   local tar_opts
# Line 120  unpack_packages() Line 177  unpack_packages()
177    
178   for magefile in ${list}   for magefile in ${list}
179   do   do
180   pkg="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}"   unpack_package "${magefile}"
  pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"  
   
181   (( count_current++ ))   (( count_current++ ))
  xtitle "[ (${count_current}/${count_total}) Unpacking ${pkg} ]"  
   
  # abort on virtual pkg  
  if [[ ${pkgtype} = virtual ]]  
  then  
  echo -ne " ${COLBLUE}---${COLDEFAULT}"  
  echo " !unpack virtual (${count_current}/${count_total}): ${pkg/.${PKGSUFFIX}/} ... "  
  continue  
  fi  
   
  # abort on sources pkg  
  if [[ ${pkgtype} = sources ]]  
  then  
  echo -ne " ${COLBLUE}---${COLDEFAULT}"  
  echo " !unpack sources (${count_current}/${count_total}): ${pkg/.${PKGSUFFIX}/} ... "  
  continue  
  fi  
   
  # busybox?  
  if need_busybox_support tar  
  then  
  tar_opts="xjf"  
  else  
  tar_opts="xjmf"  
  fi  
   
  echo -e " ${COLBLUE}***${COLDEFAULT} unpacking (${count_current}/${count_total}): ${pkg} ... "  
  tar ${tar_opts} ${PKGDIR}/${pkg} -C ${BUILDDIR} || die "Unpacking package ${pkg}"  
182   done   done
183    
184   # add a crlf for a better view   # add a crlf for a better view
# Line 734  remove_database_entry() Line 761  remove_database_entry()
761   [ ! -f ${magefile} ] && die "remove_database_entry() ${magefile} not exist."   [ ! -f ${magefile} ] && die "remove_database_entry() ${magefile} not exist."
762    
763   # remove virtuals only if no other exist   # remove virtuals only if no other exist
764   if [[ $(count_installed_pkgs --pcat ${pcat} --pname ${pname}) -le 1 ]]   if [[ $(count_installed_pkgs --pcat=${pcat} --pname=${pname}) -le 1 ]]
765   then   then
766   # first unregister virtuals   # first unregister virtuals
767   provide="$(get_value_from_magefile PROVIDE ${magefile})"   provide="$(get_value_from_magefile PROVIDE ${magefile})"
# Line 763  count_installed_pkgs() Line 790  count_installed_pkgs()
790   local i   local i
791    
792   # very basic getops   # very basic getops
793   for i in $*   for i in $@
794   do   do
795   case $1 in   case ${i} in
796   --pcat|-c) shift; pcat="$1" ;;   --pcat*) pcat="${i#*=}" ;;
797   --pname|-n) shift; pname="$1" ;;   --pname*) pname="${i#*=}" ;;
798   esac   esac
  shift  
799   done   done
800    
801   # sanity checks; abort if not given   # sanity checks; abort if not given
# Line 1376  convertmirrors() Line 1402  convertmirrors()
1402   output+="${mirror}${addon}/${uri/${scheme}/}"   output+="${mirror}${addon}/${uri/${scheme}/}"
1403   done   done
1404   else   else
1405   output="${uri}"   output="${uri}"
1406   fi   fi
1407    
1408   echo "${output}"   echo "${output}"
# Line 1443  fetch_packages() Line 1469  fetch_packages()
1469  {  {
1470   local i   local i
1471   local list="$@"   local list="$@"
1472   local pkg   local pkgname
1473     local pkgfile
1474     local pcat
1475     local pname
1476   local mirr   local mirr
1477   local magefile   local magefile
1478   local md5file   local md5file
# Line 1451  fetch_packages() Line 1480  fetch_packages()
1480   local count_current   local count_current
1481   local count_total   local count_total
1482   local wget_opts   local wget_opts
1483     local fetching
1484    
1485   [ -z "${MIRRORS}" ] && die "You have no mirrors defined. Please edit your ${MAGERC}."   [ -z "${MIRRORS}" ] && die "You have no mirrors defined. Please edit your ${MAGERC}."
1486    
# Line 1465  fetch_packages() Line 1495  fetch_packages()
1495    
1496   for magefile in ${list}   for magefile in ${list}
1497   do   do
1498   pkg="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}"   pkgname="$(get_value_from_magefile PKGNAME ${magefile})"
1499     pkgfile="${pkgname}.${PKGSUFFIX}"
1500   pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"   pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"
1501    
1502     pcat=$(magename2pcat ${magefile})
1503     pname=$(magename2pname ${magefile})
1504     md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5"
1505    
1506   (( count_current++ ))   (( count_current++ ))
1507   xtitle "[ (${count_current}/${count_total}) Fetching ${pkg} ]"   xtitle "[ (${count_current}/${count_total}) Fetching ${pkgfile} ]"
1508    
1509   # abort on virtual pkg   # abort on virtual pkg
1510   if [[ ${pkgtype} = virtual ]]   if [[ ${pkgtype} = virtual ]]
1511   then   then
1512   echo -ne " ${COLBLUE}---${COLDEFAULT}"   echo -ne " ${COLBLUE}---${COLDEFAULT}"
1513   echo " !fetch virtual (${count_current}/${count_total}): ${pkg/.${PKGSUFFIX}/} ... "   echo " !fetch virtual (${count_current}/${count_total}): ${pkgname} ... "
1514   continue   continue
1515   fi   fi
1516    
# Line 1483  fetch_packages() Line 1518  fetch_packages()
1518   if [[ ${pkgtype} = sources ]]   if [[ ${pkgtype} = sources ]]
1519   then   then
1520   echo -ne " ${COLBLUE}---${COLDEFAULT}"   echo -ne " ${COLBLUE}---${COLDEFAULT}"
1521   echo " !fetch sources (${count_current}/${count_total}): ${pkg/.${PKGSUFFIX}/} ... "   echo " !fetch sources (${count_current}/${count_total}): ${pkgname} ... "
1522   continue   continue
1523   fi   fi
1524    
1525   # abort if already exist   # check if FETCHING is required
1526   if [ -f ${PKGDIR}/${pkg} ]   if [ ! -f "${md5file}" ]
1527     then
1528     fetching=true
1529     else
1530     if mchecksum --rundir "${PKGDIR}" --file "${md5file}" --method md5 &> /dev/null
1531     then
1532     # md5's ok, no fetching required
1533     fetching=false
1534     else
1535     fetching=true
1536     fi
1537     fi
1538    
1539     if [[ ${fetching} = false ]]
1540   then   then
1541   echo -ne " ${COLBLUE}***${COLDEFAULT}"   echo -ne " ${COLBLUE}***${COLDEFAULT}"
1542   echo " fetch complete (${count_current}/${count_total}): ${pkg} ... "   echo " fetch complete (${count_current}/${count_total}): ${pkgfile} ... "
1543   continue   continue
1544     else
1545     echo -ne " ${COLBLUE}***${COLDEFAULT}"
1546     echo -e " fetching (${count_current}/${count_total}): ${pkgfile} ... "
1547     mdownload --uri "package://${pkgfile}" --dir "${PKGDIR}" || die "Could not download ${pkgfile}"
1548   fi   fi
1549    
1550   echo -ne " ${COLBLUE}***${COLDEFAULT}"   # sanity check, not really needed but to be sure
1551   echo -e " fetching (${count_current}/${count_total}): ${pkg} ... "   if [ ! -f ${PKGDIR}/${pkgfile} ]
  mdownload --uri "package://${pkg}" --dir "${PKGDIR}" || die "Could not download ${pkg}"  
  if [ ! -f ${PKGDIR}/${pkg} ]  
1552   then   then
1553   die "Package '${pkg}' after download not found in '${PKGDIR}'"   die "Package '${pkgfile}' after download not found in '${PKGDIR}'"
1554   fi   fi
1555   done   done
1556    
# Line 1605  syncmage_tarball() Line 1655  syncmage_tarball()
1655   then   then
1656   if ! mcheckemptydir ${MAGEDIR}   if ! mcheckemptydir ${MAGEDIR}
1657   then   then
1658   find ${MAGEDIR} -mindepth 1 -maxdepth 1 | xarg --no-run-if-empty rm -r   find ${MAGEDIR} -mindepth 1 -maxdepth 1 | xargs --no-run-if-empty rm -r
1659   fi   fi
1660   else   else
1661   rm -rf ${MAGEDIR}   rm -rf ${MAGEDIR}
# Line 1763  get_highest_magefile() Line 1813  get_highest_magefile()
1813   then   then
1814   HIGHEST_MAGEFILE=${magefile}   HIGHEST_MAGEFILE=${magefile}
1815   #for debug only   #for debug only
1816   mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}"   mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}" >&2
1817   fi   fi
1818   done   done
1819    
# Line 1887  count_protected_files() Line 1937  count_protected_files()
1937   count="$(echo ${oldprotected} | sed 's:.*\/._cfg\(.*\)_.*:\1:')"   count="$(echo ${oldprotected} | sed 's:.*\/._cfg\(.*\)_.*:\1:')"
1938   done   done
1939    
1940   # dirty hack to convert 0001 -> 1; 0120 -> 120 etc   # convert 0001 -> 1; 0120 -> 120 etc
1941   x="${#count}"   # use bash internal base functions to this task
1942     x="$((10#${count}))"
1943   for (( i=0; i<x; i++ ))   for (( i=0; i<x; i++ ))
1944   do   do
1945   if [[ ${count:${i}:1} != 0 ]]   if [[ ${count:${i}:1} != 0 ]]
# Line 2204  sminclude() Line 2255  sminclude()
2255   then   then
2256   for i in $*   for i in $*
2257   do   do
2258   echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc"   [[ ${SILENT} = 1 ]] || echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc"
2259   source ${SMAGESCRIPTSDIR}/include/${i}.sminc   source ${SMAGESCRIPTSDIR}/include/${i}.sminc
2260   done   done
2261   echo   [[ ${SILENT} = 1 ]] || echo
2262   fi   fi
2263  }  }
2264    
# Line 2511  get_value_from_magefile() Line 2562  get_value_from_magefile()
2562   local SDEPEND   local SDEPEND
2563   local PROVIDE   local PROVIDE
2564   local PKGTYPE   local PKGTYPE
  local MAGE_TARGETS  
2565   local SPLIT_PACKAGE_BASE   local SPLIT_PACKAGE_BASE
2566   local preinstall   local preinstall
2567   local postinstall   local postinstall
# Line 2633  mage_install() Line 2683  mage_install()
2683   echo B:${pbuild}   echo B:${pbuild}
2684   fi   fi
2685    
2686   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} ]]  
2687   then   then
2688   # basic svn compat   # basic svn compat
2689   if [[ -d ${SMAGESCRIPTSDIR}/.svn ]]   if [[ -d ${SMAGESCRIPTSDIR}/.svn ]]
# Line 2688  mage_install() Line 2725  mage_install()
2725   if [[ ${PKGTYPE} != virtual ]] && \   if [[ ${PKGTYPE} != virtual ]] && \
2726   [[ ${PKGTYPE} != sources ]]   [[ ${PKGTYPE} != sources ]]
2727   then   then
2728     unpack_package "${magefile}"
2729   echo -e " ${COLBLUE}***${COLDEFAULT} merging files into system ... "   echo -e " ${COLBLUE}***${COLDEFAULT} merging files into system ... "
2730   build_doinstall ${PKGNAME}   build_doinstall ${PKGNAME}
2731   fi   fi
# Line 2776  md5sum_packages() Line 2814  md5sum_packages()
2814   pname=$(magename2pname ${magefile})   pname=$(magename2pname ${magefile})
2815   pkgname="$(get_value_from_magefile PKGNAME ${magefile})"   pkgname="$(get_value_from_magefile PKGNAME ${magefile})"
2816   md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5"   md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5"
2817   pkgfile="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}"   pkgfile="${pkgname}.${PKGSUFFIX}"
2818   pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"   pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"
2819    
2820   (( count_current++ ))   (( count_current++ ))
# Line 2786  md5sum_packages() Line 2824  md5sum_packages()
2824   if [[ ${pkgtype} = virtual ]]   if [[ ${pkgtype} = virtual ]]
2825   then   then
2826   echo -ne " ${COLBLUE}---${COLDEFAULT}"   echo -ne " ${COLBLUE}---${COLDEFAULT}"
2827   echo " !md5sum virtual (${count_current}/${count_total}): ${pkgfile/.${PKGSUFFIX}/} ... "   echo " !md5sum virtual (${count_current}/${count_total}): ${pkgname} ... "
2828   continue   continue
2829   fi   fi
2830    
# Line 2794  md5sum_packages() Line 2832  md5sum_packages()
2832   if [[ ${pkgtype} = sources ]]   if [[ ${pkgtype} = sources ]]
2833   then   then
2834   echo -ne " ${COLBLUE}---${COLDEFAULT}"   echo -ne " ${COLBLUE}---${COLDEFAULT}"
2835   echo " !md5sum sources (${count_current}/${count_total}): ${pkgfile/.${PKGSUFFIX}/} ... "   echo " !md5sum sources (${count_current}/${count_total}): ${pkgname} ... "
2836   continue   continue
2837   fi   fi
2838    
# Line 2842  uninstall_packages() Line 2880  uninstall_packages()
2880   pbuild=$(magename2pbuild ${pkg})   pbuild=$(magename2pbuild ${pkg})
2881   can_pcat="${pcat}"   can_pcat="${pcat}"
2882   can_pname="${pname}"   can_pname="${pname}"
2883    
2884   if [ -z "${can_ver_list}" ]   if [ -z "${can_ver_list}" ]
2885   then   then
2886   can_ver_list=" ${pver}-${pbuild}"   can_ver_list=" ${pver}-${pbuild}"
# Line 3015  mage_uninstall() Line 3053  mage_uninstall()
3053   unset -f postremove   unset -f postremove
3054  }  }
3055    
3056    # rerun_pkgfunctions [method] pkg1 pkg2 pkg3
3057    rerun_pkgfunctions()
3058    {
3059     local method
3060     local list
3061     local pcat
3062     local pname
3063     local pver
3064     local pbuild
3065     local magefile
3066     local i
3067    
3068     # very basic getops
3069     case $1 in
3070     --method) shift; method="$1" ;;
3071     esac
3072     shift
3073     local list="$@"
3074    
3075     # sanity check
3076     case ${method} in
3077     preinstall|postinstall) ;;
3078     preremove|postremove) ;;
3079     *) die "rerun_pkgfunctions(): Unknown method '${method}'." ;;
3080     esac
3081    
3082     if [[ -n ${MROOT} ]]
3083     then
3084     echo -ne ${COLRED}
3085     echo "!! running in MROOT=${MROOT}"
3086     echo -ne ${COLDEFAULT}
3087     echo
3088     fi
3089    
3090     for pkg in ${list}
3091     do
3092     pcat=$(dep2pcat ${pkg})
3093     pname=$(magename2pname ${pkg})
3094     pver=$(magename2pver ${pkg})
3095     pbuild=$(magename2pbuild ${pkg})
3096     magefile="${MROOT}${INSTALLDB}/${pcat}/${pname}-${pver}-${pbuild}/${pname}-${pver}-${pbuild}.mage"
3097    
3098     if [ -e ${magefile} ]
3099     then
3100     source ${magefile}
3101     if [ -n "$(typeset -f ${method})" ]
3102     then
3103     echo -e " ${COLBLUE}***${COLDEFAULT} running ${method} for ${pkg} ... "
3104     ${method}
3105     else
3106     echo "No ${method}() for pkg '${pkg}' defined. Doing nothing."
3107     fi
3108     unset -f preinstall postinstall preremove postremove
3109     else
3110     die "Magefile '${magefile}' does not exist."
3111     fi
3112     done
3113    }
3114    
3115  show_etc_update_mesg()  show_etc_update_mesg()
3116  {  {
3117   [ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0   [ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0
# Line 3119  pkgsearch() Line 3216  pkgsearch()
3216   "") continue;;   "") continue;;
3217   esac   esac
3218    
3219   deps="${deps} $(basename ${dep%-*})"   if [[ -z ${deps} ]]
3220     then
3221     deps="$(basename ${dep%-*})"
3222     else
3223     deps="${deps} $(basename ${dep%-*})"
3224     fi
3225   done << EOF   done << EOF
3226  ${depsfull}  ${depsfull}
3227  EOF  EOF
# Line 3130  EOF Line 3232  EOF
3232   "") continue;;   "") continue;;
3233   esac   esac
3234    
3235   sdeps="${sdeps} $(basename ${dep%-*})"   if [[ -z ${sdeps} ]]
3236     then
3237     sdeps="$(basename ${dep%-*})"
3238     else
3239     sdeps="${sdeps} $(basename ${dep%-*})"
3240     fi
3241   done << EOF   done << EOF
3242  ${sdepsfull}  ${sdepsfull}
3243  EOF  EOF
# Line 3144  EOF Line 3251  EOF
3251   then   then
3252   echo "      License:  ${license}"   echo "      License:  ${license}"
3253   fi   fi
3254   echo "      Depends: ${deps}"   echo "      Depends:  ${deps}"
3255   echo "      SDepends: ${sdeps}"   echo "      SDepends: ${sdeps}"
3256   echo   echo
3257    
# Line 3261  EOF Line 3368  EOF
3368  need_busybox_support()  need_busybox_support()
3369  {  {
3370   local cmd   local cmd
3371     local busybox
3372   cmd="$1"   cmd="$1"
3373    
3374   if [[ -x /bin/busybox ]]   for busybox in {,/usr}/bin/busybox
3375   then   do
3376   if [[ $(readlink $(which ${cmd})) = /bin/busybox ]]   if [[ -x ${busybox} ]]
3377   then   then
3378   # needs busybox support   if [[ $(readlink $(type -P ${cmd})) = ${busybox} ]]
3379   return 0   then
3380     # needs busybox support
3381     return 0
3382     fi
3383   fi   fi
3384   fi   done
3385    
3386   # no busybox   # no busybox
3387   return 1   return 1
# Line 3327  known_mage_feature() Line 3438  known_mage_feature()
3438  {  {
3439   local feature="$1"   local feature="$1"
3440   local retval   local retval
3441    
3442   case "${feature}" in   case "${feature}" in
3443   autosvc|!autosvc) retval=0 ;;   autosvc|!autosvc) retval=0 ;;
3444   buildlog|!buildlog) retval=0 ;;   buildlog|!buildlog) retval=0 ;;
# Line 3336  known_mage_feature() Line 3447  known_mage_feature()
3447   compressdoc|!compressdoc) retval=0 ;;   compressdoc|!compressdoc) retval=0 ;;
3448   debug|!debug) retval=0 ;;   debug|!debug) retval=0 ;;
3449   distcc|!distcc) retval=0 ;;   distcc|!distcc) retval=0 ;;
3450     icecc|!icecc) retval=0 ;;
3451   kernelsrcunpack|!kernelsrcunpack) retval=0 ;;   kernelsrcunpack|!kernelsrcunpack) retval=0 ;;
3452   libtool|!libtool) retval=0 ;;   libtool|!libtool) retval=0 ;;
3453   linuxsymlink|!linuxsymlink) retval=0 ;;   linuxsymlink|!linuxsymlink) retval=0 ;;
# Line 3411  msetfeature() Line 3523  msetfeature()
3523   MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" )   MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" )
3524   fi   fi
3525    
3526   export MAGE_FEATURE_CURRENT   export MAGE_FEATURES_CURRENT
3527   done   done
3528  }  }
3529    
# Line 3441  mqueryfeature() Line 3553  mqueryfeature()
3553    
3554  mprintfeatures()  mprintfeatures()
3555  {  {
3556   echo "Global features:  ${MAGE_FEATURES_GLOBAL[*]}"   echo -e "${COLRED}Global features:${COLDEFAULT} ${MAGE_FEATURES_GLOBAL[*]}"
3557   echo "Local features:   ${MAGE_FEATURES[*]}"   echo -e "${COLYELLOW}Local features:${COLDEFAULT} ${MAGE_FEATURES[*]}"
3558   echo "Current features: ${MAGE_FEATURES_CURRENT[*]}"   echo -e "${COLGREEN}Current features:${COLDEFAULT} ${MAGE_FEATURES_CURRENT[*]}"
3559  }  }

Legend:
Removed from v.1762  
changed lines
  Added in v.2752