Magellan Linux

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

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

revision 1648 by niro, Fri Jan 13 20:51:18 2012 UTC revision 2271 by niro, Fri Oct 25 07:28:23 2013 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   ${cmd} -c ${file} &> /dev/null  
78   retval="$?"   # all file must be non-zero
79     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 82  mchecksum() Line 100  mchecksum()
100   return "${retval}"   return "${retval}"
101  }  }
102    
103    mcheckemptydir()
104    {
105     local dir="$1"
106     local retval=1
107    
108     if [[ ! -d ${dir} ]]
109     then
110     echo "mcheckemptydir(): '${dir}' is not a directory!"
111     retval=3
112     else
113     shopt -s nullglob dotglob
114     files=( ${dir}/* )
115     (( ${#files[*]} )) || retval=0
116     shopt -u nullglob dotglob
117     fi
118    
119     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 100  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 151  fix_mtime() Line 198  fix_mtime()
198   mtime=$(stat -c %Y "${reference}")   mtime=$(stat -c %Y "${reference}")
199   touch \   touch \
200   --no-create \   --no-create \
201     --no-dereference \
202   --time=mtime \   --time=mtime \
203   --reference "${reference}" \   --reference="${reference}" \
204   "${pathto}"   "${pathto}"
205    
206   echo "${mtime}"   echo "${mtime}"
# Line 394  install_symlinks() Line 442  install_symlinks()
442    
443   ln -snf "${link}" "${MROOT}${pathto}"   ln -snf "${link}" "${MROOT}${pathto}"
444    
445  # # fix mtime and db   # fix mtime and db
446  # fix_descriptor ${pkgname}/.symlinks \   fix_descriptor ${pkgname}/.symlinks \
447  # "${pathto}" \   "${pathto}" \
448  # "${posix}" \   "${posix}" \
449  # "${link}" \   "${link}" \
450  # "$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \   "$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \
451  # "${MROOT}${pathto}")"   "${MROOT}${pathto}")"
452    
453   done < ${BUILDDIR}/${pkgname}/.symlinks   done < ${BUILDDIR}/${pkgname}/.symlinks
454    
# Line 787  compare_mtime() Line 835  compare_mtime()
835    
836   mtime="$(stat -c %Y ${MROOT}${INSTALLDB}/${pfull}/.mtime)"   mtime="$(stat -c %Y ${MROOT}${INSTALLDB}/${pfull}/.mtime)"
837    
838   # if $pathto is a symlink than compare linked binary   # no extra handlink for symlinks anymore as fix_mtime
839   if [ -L "${MROOT}${pathto}" ]   # uses --no-dereference, compare directly
840   then   x=$(stat -c %Y "${MROOT}${pathto}")
  # readlink -f resolves full path of linked file  
  x="$(readlink -f "${MROOT}${pathto}")"  
   
  # abort if target does not exists  
  # we keep safe here, theoretically the link can removed  
  [ ! -e "${x}" ] && return 1  
   
  x=$(stat -c %Y "${x}")  
  else  
  x=$(stat -c %Y "${MROOT}${pathto}")  
  fi  
841    
842   [[ ${mtime} = ${x} ]] && return 0   [[ ${mtime} = ${x} ]] && return 0
843    
# Line 1366  convertmirrors() Line 1403  convertmirrors()
1403   output+="${mirror}${addon}/${uri/${scheme}/}"   output+="${mirror}${addon}/${uri/${scheme}/}"
1404   done   done
1405   else   else
1406   output="${uri}"   output="${uri}"
1407   fi   fi
1408    
1409   echo "${output}"   echo "${output}"
# Line 1433  fetch_packages() Line 1470  fetch_packages()
1470  {  {
1471   local i   local i
1472   local list="$@"   local list="$@"
1473   local pkg   local pkgname
1474     local pkgfile
1475   local mirr   local mirr
1476   local magefile   local magefile
1477   local md5file   local md5file
# Line 1455  fetch_packages() Line 1493  fetch_packages()
1493    
1494   for magefile in ${list}   for magefile in ${list}
1495   do   do
1496   pkg="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}"   pkgname="$(get_value_from_magefile PKGNAME ${magefile})"
1497     pkgfile="${pkgname}.${PKGSUFFIX}"
1498   pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"   pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"
1499    
1500   (( count_current++ ))   (( count_current++ ))
1501   xtitle "[ (${count_current}/${count_total}) Fetching ${pkg} ]"   xtitle "[ (${count_current}/${count_total}) Fetching ${pkgfile} ]"
1502    
1503   # abort on virtual pkg   # abort on virtual pkg
1504   if [[ ${pkgtype} = virtual ]]   if [[ ${pkgtype} = virtual ]]
1505   then   then
1506   echo -ne " ${COLBLUE}---${COLDEFAULT}"   echo -ne " ${COLBLUE}---${COLDEFAULT}"
1507   echo " !fetch virtual (${count_current}/${count_total}): ${pkg/.${PKGSUFFIX}/} ... "   echo " !fetch virtual (${count_current}/${count_total}): ${pkgname} ... "
1508   continue   continue
1509   fi   fi
1510    
# Line 1473  fetch_packages() Line 1512  fetch_packages()
1512   if [[ ${pkgtype} = sources ]]   if [[ ${pkgtype} = sources ]]
1513   then   then
1514   echo -ne " ${COLBLUE}---${COLDEFAULT}"   echo -ne " ${COLBLUE}---${COLDEFAULT}"
1515   echo " !fetch sources (${count_current}/${count_total}): ${pkg/.${PKGSUFFIX}/} ... "   echo " !fetch sources (${count_current}/${count_total}): ${pkgname} ... "
1516   continue   continue
1517   fi   fi
1518    
1519   # abort if already exist   # abort if already exist
1520   if [ -f ${PKGDIR}/${pkg} ]   if [ -f ${PKGDIR}/${pkgfile} ]
1521   then   then
1522   echo -ne " ${COLBLUE}***${COLDEFAULT}"   echo -ne " ${COLBLUE}***${COLDEFAULT}"
1523   echo " fetch complete (${count_current}/${count_total}): ${pkg} ... "   echo " fetch complete (${count_current}/${count_total}): ${pkgfile} ... "
1524   continue   continue
1525   fi   fi
1526    
1527   echo -ne " ${COLBLUE}***${COLDEFAULT}"   echo -ne " ${COLBLUE}***${COLDEFAULT}"
1528   echo -e " fetching (${count_current}/${count_total}): ${pkg} ... "   echo -e " fetching (${count_current}/${count_total}): ${pkgfile} ... "
1529   mdownload --uri "package://${pkg}" --dir "${PKGDIR}" || die "Could not download ${pkg}"   mdownload --uri "package://${pkgfile}" --dir "${PKGDIR}" || die "Could not download ${pkgfile}"
1530   if [ ! -f ${PKGDIR}/${pkg} ]   if [ ! -f ${PKGDIR}/${pkgfile} ]
1531   then   then
1532   die "Package '${pkg}' after download not found in '${PKGDIR}'"   die "Package '${pkgfile}' after download not found in '${PKGDIR}'"
1533   fi   fi
1534   done   done
1535    
# Line 1545  syncmage_tarball() Line 1584  syncmage_tarball()
1584    
1585   for mirr in ${MIRRORS}   for mirr in ${MIRRORS}
1586   do   do
1587   # path without distribution   # path without distribution
1588   mymirr="${mirr%/*}"   # (only for stable|testing|unstable and not DISTROTAG)
1589     case ${mirr##*/} in
1590     stable|testing|unstable) mymirr="${mirr%/*}";;
1591     *) mymirr="${mirr}";;
1592     esac
1593    
1594   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1595   echo "fetching latest md5 from ${mymirr} ..."   echo "fetching latest md5 from ${mymirr} ..."
# Line 1579  syncmage_tarball() Line 1622  syncmage_tarball()
1622   else   else
1623   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1624   echo -n "checking md5sum... "   echo -n "checking md5sum... "
1625   ( cd ${temp}; md5sum -c ${latest_md5} ) || die "md5 for ${latest_tarball} failed"   mchecksum --rundir "${temp}" --file "${latest_md5}" --method md5 || die "md5 for ${latest_tarball} failed"
1626   fi   fi
1627    
1628   if [[ -d ${MAGEDIR} ]]   if [[ -d ${MAGEDIR} ]]
1629   then   then
1630   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1631   echo "cleaning old mage-tree ${MAGEDIR}..."   echo "cleaning old mage-tree ${MAGEDIR}..."
1632   rm -rf ${MAGEDIR}   # honor mountpoints and empty dirs
1633     if mountpoint -q ${MAGEDIR}
1634     then
1635     if ! mcheckemptydir ${MAGEDIR}
1636     then
1637     find ${MAGEDIR} -mindepth 1 -maxdepth 1 | xargs --no-run-if-empty rm -r
1638     fi
1639     else
1640     rm -rf ${MAGEDIR}
1641     fi
1642   fi   fi
1643    
1644   if need_busybox_support tar   if need_busybox_support tar
# Line 1645  xtitleclean() Line 1697  xtitleclean()
1697  }  }
1698    
1699    
1700  # cuts full pathnames or versionized names down to basename  # unused?
1701  choppkgname()  #
1702  {  # # cuts full pathnames or versionized names down to basename
1703   #we want this only if full name was used  # choppkgname()
1704   if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ]  # {
1705   then  # #we want this only if full name was used
1706   #cuts ARCH and PBUILD  # if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ]
1707   #ARCH comes from ${MAGERC}  # then
1708   MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g")  # #cuts ARCH and PBUILD
1709    # #ARCH comes from ${MAGERC}
1710    # MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}$(print_distrotag)-r*.::g")
1711    #
1712    # #cuts version number
1713    # MAGENAME=$(basename ${MAGENAME%-*} .mage)
1714    # fi
1715    # }
1716    
  #cuts version number  
  MAGENAME=$(basename ${MAGENAME%-*} .mage)  
  fi  
 }  
1717    
1718  # get_categorie $PNAME, returns CATEGORIE  # get_categorie $PNAME, returns CATEGORIE
1719  # $1=pname  # $1=pname
# Line 1737  get_highest_magefile() Line 1792  get_highest_magefile()
1792   then   then
1793   HIGHEST_MAGEFILE=${magefile}   HIGHEST_MAGEFILE=${magefile}
1794   #for debug only   #for debug only
1795   mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}"   mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}" >&2
1796   fi   fi
1797   done   done
1798    
# Line 1844  count_protected_files() Line 1899  count_protected_files()
1899   local filename="${file##*/}"   local filename="${file##*/}"
1900   local count   local count
1901   local output   local output
1902     local oldprotected
1903   local i   local i
1904     local x
1905    
1906     # hack; do not honor a global set IFS like '§'
1907     local IFS
1908    
1909   declare -i count=0   count=0
1910    
1911   # check if there are already protected files   # check if there are already protected files
1912   for oldpretected in $(find ${dirname} -iname "._cfg????_${filename}" |   for oldprotected in $(find ${dirname} -iname "._cfg????_${filename}" |
1913   sed -e "s:\(^.*/\)\(._cfg*_\)\(/.*$\):\1\2\3\%\2\%\3:" |   sed -e "s:\(^.*/\)\(._cfg*_\)\(/.*$\):\1\2\3\%\2\%\3:" |
1914   sort -t'%' -k3 -k2 | cut -f1 -d'%')   sort -t'%' -k3 -k2 | cut -f1 -d'%')
1915   do   do
1916   count=$(echo ${oldpretected} | cut -d_ -f2 | sed -e "s:cfg::")   count="$(echo ${oldprotected} | sed 's:.*\/._cfg\(.*\)_.*:\1:')"
1917     done
1918    
1919     # convert 0001 -> 1; 0120 -> 120 etc
1920     # use bash internal base functions to this task
1921     x="$((10#${count}))"
1922     for (( i=0; i<x; i++ ))
1923     do
1924     if [[ ${count:${i}:1} != 0 ]]
1925     then
1926     count="${count:${i}}"
1927     break
1928     fi
1929   done   done
1930   (( count ++ ))  
1931     count="$(( ${count}+1 ))"
1932    
1933   # fill output up with zeros   # fill output up with zeros
1934   for (( i=${#count}; i < 4; i++ )); do output="${output}0"; done   for (( i=${#count}; i < 4; i++ )); do output="${output}0"; done
# Line 2645  mage_install() Line 2718  mage_install()
2718   if [[ ${PKGTYPE} != virtual ]] && \   if [[ ${PKGTYPE} != virtual ]] && \
2719   [[ ${PKGTYPE} != sources ]]   [[ ${PKGTYPE} != sources ]]
2720   then   then
2721     unpack_package "${magefile}"
2722   echo -e " ${COLBLUE}***${COLDEFAULT} merging files into system ... "   echo -e " ${COLBLUE}***${COLDEFAULT} merging files into system ... "
2723   build_doinstall ${PKGNAME}   build_doinstall ${PKGNAME}
2724   fi   fi
# Line 2733  md5sum_packages() Line 2807  md5sum_packages()
2807   pname=$(magename2pname ${magefile})   pname=$(magename2pname ${magefile})
2808   pkgname="$(get_value_from_magefile PKGNAME ${magefile})"   pkgname="$(get_value_from_magefile PKGNAME ${magefile})"
2809   md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5"   md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5"
2810   pkgfile="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}"   pkgfile="${pkgname}.${PKGSUFFIX}"
2811   pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"   pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})"
2812    
2813   (( count_current++ ))   (( count_current++ ))
# Line 2743  md5sum_packages() Line 2817  md5sum_packages()
2817   if [[ ${pkgtype} = virtual ]]   if [[ ${pkgtype} = virtual ]]
2818   then   then
2819   echo -ne " ${COLBLUE}---${COLDEFAULT}"   echo -ne " ${COLBLUE}---${COLDEFAULT}"
2820   echo " !md5sum virtual (${count_current}/${count_total}): ${pkgfile/.${PKGSUFFIX}/} ... "   echo " !md5sum virtual (${count_current}/${count_total}): ${pkgname} ... "
2821   continue   continue
2822   fi   fi
2823    
# Line 2751  md5sum_packages() Line 2825  md5sum_packages()
2825   if [[ ${pkgtype} = sources ]]   if [[ ${pkgtype} = sources ]]
2826   then   then
2827   echo -ne " ${COLBLUE}---${COLDEFAULT}"   echo -ne " ${COLBLUE}---${COLDEFAULT}"
2828   echo " !md5sum sources (${count_current}/${count_total}): ${pkgfile/.${PKGSUFFIX}/} ... "   echo " !md5sum sources (${count_current}/${count_total}): ${pkgname} ... "
2829   continue   continue
2830   fi   fi
2831    
# Line 2759  md5sum_packages() Line 2833  md5sum_packages()
2833   then   then
2834   echo -ne "${COLBLUE} *** ${COLDEFAULT}"   echo -ne "${COLBLUE} *** ${COLDEFAULT}"
2835   echo -ne "checking md5sum (${count_current}/${count_total}): "   echo -ne "checking md5sum (${count_current}/${count_total}): "
2836   ( cd ${PKGDIR}; md5sum -c ${md5file}) || die "md5 for ${pkgfile} failed"   mchecksum --rundir "${PKGDIR}" --file "${md5file}" --method md5 || die "md5 for ${pkgfile} failed"
2837   else   else
2838   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
2839   echo -e "!! no md5sum file found for ${pkgfile} :("   echo -e "!! no md5sum file found for ${pkgfile} :("
# Line 2799  uninstall_packages() Line 2873  uninstall_packages()
2873   pbuild=$(magename2pbuild ${pkg})   pbuild=$(magename2pbuild ${pkg})
2874   can_pcat="${pcat}"   can_pcat="${pcat}"
2875   can_pname="${pname}"   can_pname="${pname}"
2876    
2877   if [ -z "${can_ver_list}" ]   if [ -z "${can_ver_list}" ]
2878   then   then
2879   can_ver_list=" ${pver}-${pbuild}"   can_ver_list=" ${pver}-${pbuild}"
# Line 3076  pkgsearch() Line 3150  pkgsearch()
3150   "") continue;;   "") continue;;
3151   esac   esac
3152    
3153   deps="${deps} $(basename ${dep%-*})"   if [[ -z ${deps} ]]
3154     then
3155     deps="$(basename ${dep%-*})"
3156     else
3157     deps="${deps} $(basename ${dep%-*})"
3158     fi
3159   done << EOF   done << EOF
3160  ${depsfull}  ${depsfull}
3161  EOF  EOF
# Line 3087  EOF Line 3166  EOF
3166   "") continue;;   "") continue;;
3167   esac   esac
3168    
3169   sdeps="${sdeps} $(basename ${dep%-*})"   if [[ -z ${sdeps} ]]
3170     then
3171     sdeps="$(basename ${dep%-*})"
3172     else
3173     sdeps="${sdeps} $(basename ${dep%-*})"
3174     fi
3175   done << EOF   done << EOF
3176  ${sdepsfull}  ${sdepsfull}
3177  EOF  EOF
# Line 3101  EOF Line 3185  EOF
3185   then   then
3186   echo "      License:  ${license}"   echo "      License:  ${license}"
3187   fi   fi
3188   echo "      Depends: ${deps}"   echo "      Depends:  ${deps}"
3189   echo "      SDepends: ${sdeps}"   echo "      SDepends: ${sdeps}"
3190   echo   echo
3191    
# Line 3218  EOF Line 3302  EOF
3302  need_busybox_support()  need_busybox_support()
3303  {  {
3304   local cmd   local cmd
3305     local busybox
3306   cmd="$1"   cmd="$1"
3307    
3308   if [[ -x /bin/busybox ]]   for busybox in {,/usr}/bin/busybox
3309   then   do
3310   if [[ $(readlink $(which ${cmd})) = /bin/busybox ]]   if [[ -x ${busybox} ]]
3311   then   then
3312   # needs busybox support   if [[ $(readlink $(type -P ${cmd})) = ${busybox} ]]
3313   return 0   then
3314     # needs busybox support
3315     return 0
3316     fi
3317   fi   fi
3318   fi   done
3319    
3320   # no busybox   # no busybox
3321   return 1   return 1
# Line 3284  known_mage_feature() Line 3372  known_mage_feature()
3372  {  {
3373   local feature="$1"   local feature="$1"
3374   local retval   local retval
3375    
3376   case "${feature}" in   case "${feature}" in
3377   autosvc|!autosvc) retval=0 ;;   autosvc|!autosvc) retval=0 ;;
3378   buildlog|!buildlog) retval=0 ;;   buildlog|!buildlog) retval=0 ;;
# Line 3293  known_mage_feature() Line 3381  known_mage_feature()
3381   compressdoc|!compressdoc) retval=0 ;;   compressdoc|!compressdoc) retval=0 ;;
3382   debug|!debug) retval=0 ;;   debug|!debug) retval=0 ;;
3383   distcc|!distcc) retval=0 ;;   distcc|!distcc) retval=0 ;;
3384     icecc|!icecc) retval=0 ;;
3385   kernelsrcunpack|!kernelsrcunpack) retval=0 ;;   kernelsrcunpack|!kernelsrcunpack) retval=0 ;;
3386   libtool|!libtool) retval=0 ;;   libtool|!libtool) retval=0 ;;
3387   linuxsymlink|!linuxsymlink) retval=0 ;;   linuxsymlink|!linuxsymlink) retval=0 ;;
3388   pkgbuild|!pkgbuild) retval=0 ;;   pkgbuild|!pkgbuild) retval=0 ;;
3389     pkgdistrotag|!pkgdistrotag) retval=0 ;;
3390   purge|!purge) retval=0 ;;   purge|!purge) retval=0 ;;
3391   qalint|!qalint) retval=0 ;;   qalint|!qalint) retval=0 ;;
3392   regentree|!regentree) retval=0 ;;   regentree|!regentree) retval=0 ;;
# Line 3397  mqueryfeature() Line 3487  mqueryfeature()
3487    
3488  mprintfeatures()  mprintfeatures()
3489  {  {
3490   echo "Global features:  ${MAGE_FEATURES_GLOBAL[*]}"   echo -e "${COLRED}Global features:${COLDEFAULT} ${MAGE_FEATURES_GLOBAL[*]}"
3491   echo "Local features:   ${MAGE_FEATURES[*]}"   echo -e "${COLYELLOW}Local features:${COLDEFAULT} ${MAGE_FEATURES[*]}"
3492   echo "Current features: ${MAGE_FEATURES_CURRENT[*]}"   echo -e "${COLGREEN}Current features:${COLDEFAULT} ${MAGE_FEATURES_CURRENT[*]}"
3493  }  }

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