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$ |
|
|
|
|
COLRED="\033[1;6m\033[31m" |
|
|
COLGREEN="\033[1;6m\033[32m" |
|
|
COLYELLOW="\033[1;6m\033[33m" |
|
|
COLBLUE="\033[1;6m\033[34m" |
|
|
COLMAGENTA="\033[1;6m\033[35m" |
|
|
COLWHITE="\033[1;6m\033[37m" |
|
|
COLGRAY="\033[0;6m\033[37m" |
|
|
COLBOLD="\033[1m" |
|
|
COLDEFAULT="\033[0m" |
|
|
|
|
|
if [[ ${NOCOLORS} = true ]] |
|
|
then |
|
|
COLRED="" |
|
|
COLGREEN="" |
|
|
COLYELLOW="" |
|
|
COLBLUE="" |
|
|
COLMAGENTA="" |
|
|
COLWHITE="" |
|
|
COLGRAY="" |
|
|
COLBOLD="" |
|
|
COLDEFAULT="" |
|
|
fi |
|
4 |
|
|
5 |
mage_setup() |
mage_setup() |
6 |
{ |
{ |
23 |
local method |
local method |
24 |
local cmd |
local cmd |
25 |
local retval |
local retval |
26 |
|
local sum |
27 |
|
local dest |
28 |
|
|
29 |
# very basic getops |
# very basic getops |
30 |
for i in $* |
for i in $* |
45 |
case ${method} in |
case ${method} in |
46 |
md5) cmd="md5sum" ;; |
md5) cmd="md5sum" ;; |
47 |
sha256) cmd="sha256sum" ;; |
sha256) cmd="sha256sum" ;; |
48 |
*) die "mchecksum(): unkown method '${method}'" ;; |
*) die "mchecksum(): unknown method '${method}'" ;; |
49 |
esac |
esac |
50 |
|
|
51 |
if [[ -d ${rundir} ]] |
if [[ -d ${rundir} ]] |
52 |
then |
then |
53 |
pushd ${rundir} &> /dev/null |
pushd ${rundir} &> /dev/null |
54 |
${cmd} -c ${file} &> /dev/null |
|
55 |
retval="$?" |
# all file must be non-zero |
56 |
|
retval=0 |
57 |
|
while read sum dest |
58 |
|
do |
59 |
|
if [ ! -s ${dest} ] |
60 |
|
then |
61 |
|
echo "${dest}: file is empty ;(" |
62 |
|
retval=127 |
63 |
|
fi |
64 |
|
done < ${file} |
65 |
|
if [[ ${retval} != 127 ]] |
66 |
|
then |
67 |
|
# be verbose here |
68 |
|
${cmd} -c ${file} #&> /dev/null |
69 |
|
retval="$?" |
70 |
|
fi |
71 |
|
|
72 |
popd &> /dev/null |
popd &> /dev/null |
73 |
else |
else |
74 |
retval=1 |
retval=1 |
77 |
return "${retval}" |
return "${retval}" |
78 |
} |
} |
79 |
|
|
80 |
|
mcheckemptydir() |
81 |
|
{ |
82 |
|
local dir="$1" |
83 |
|
local retval=1 |
84 |
|
|
85 |
|
if [[ ! -d ${dir} ]] |
86 |
|
then |
87 |
|
echo "mcheckemptydir(): '${dir}' is not a directory!" |
88 |
|
retval=3 |
89 |
|
else |
90 |
|
shopt -s nullglob dotglob |
91 |
|
files=( ${dir}/* ) |
92 |
|
(( ${#files[*]} )) || retval=0 |
93 |
|
shopt -u nullglob dotglob |
94 |
|
fi |
95 |
|
|
96 |
|
return ${retval} |
97 |
|
} |
98 |
|
|
99 |
|
unpack_package() |
100 |
|
{ |
101 |
|
local magefile="$1" |
102 |
|
local pkgname |
103 |
|
local pkgfile |
104 |
|
local pkgtype |
105 |
|
local tar_opts |
106 |
|
|
107 |
|
pkgname="$(get_value_from_magefile PKGNAME ${magefile})" |
108 |
|
pkgfile="${pkgname}.${PKGSUFFIX}" |
109 |
|
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
110 |
|
|
111 |
|
xtitle "[ Unpacking ${pkg} ]" |
112 |
|
|
113 |
|
# abort on virtual pkg |
114 |
|
if [[ ${pkgtype} = virtual ]] |
115 |
|
then |
116 |
|
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
117 |
|
echo " !unpack virtual ${pkgname} ... " |
118 |
|
continue |
119 |
|
fi |
120 |
|
|
121 |
|
# abort on sources pkg |
122 |
|
if [[ ${pkgtype} = sources ]] |
123 |
|
then |
124 |
|
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
125 |
|
echo " !unpack sources ${pkgname} ... " |
126 |
|
continue |
127 |
|
fi |
128 |
|
|
129 |
|
# busybox? |
130 |
|
if need_busybox_support tar |
131 |
|
then |
132 |
|
tar_opts="xjf" |
133 |
|
else |
134 |
|
tar_opts="xjmf" |
135 |
|
fi |
136 |
|
|
137 |
|
echo -e " ${COLBLUE}***${COLDEFAULT} unpacking ${pkgfile} ... " |
138 |
|
tar ${tar_opts} ${PKGDIR}/${pkgfile} -C ${BUILDDIR} || die "Unpacking package ${pkgfile}" |
139 |
|
} |
140 |
|
|
141 |
unpack_packages() |
unpack_packages() |
142 |
{ |
{ |
143 |
local list="$@" |
local list="$@" |
144 |
local magefile |
local magefile |
|
local pkg |
|
|
local pkgtype |
|
145 |
local count_current |
local count_current |
146 |
local count_total |
local count_total |
147 |
local tar_opts |
local tar_opts |
154 |
|
|
155 |
for magefile in ${list} |
for magefile in ${list} |
156 |
do |
do |
157 |
pkg="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}" |
unpack_package "${magefile}" |
|
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
|
|
|
|
158 |
(( 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}" |
|
159 |
done |
done |
160 |
|
|
161 |
# add a crlf for a better view |
# add a crlf for a better view |
162 |
if [ ${count_total} -gt 1 ]; then echo; fi |
if [ ${count_total} -gt 1 ]; then echo; fi |
163 |
} |
} |
164 |
|
|
|
|
|
165 |
# fix_mtime path/to/$mtime/reffile $pathto/file |
# fix_mtime path/to/$mtime/reffile $pathto/file |
166 |
# creates a given reference file and fixes given file |
# creates a given reference file and fixes given file |
167 |
# returns new mtime |
# returns new mtime |
174 |
mtime=$(stat -c %Y "${reference}") |
mtime=$(stat -c %Y "${reference}") |
175 |
touch \ |
touch \ |
176 |
--no-create \ |
--no-create \ |
177 |
|
--no-dereference \ |
178 |
--time=mtime \ |
--time=mtime \ |
179 |
--reference "${reference}" \ |
--reference="${reference}" \ |
180 |
"${pathto}" |
"${pathto}" |
181 |
|
|
182 |
echo "${mtime}" |
echo "${mtime}" |
418 |
|
|
419 |
ln -snf "${link}" "${MROOT}${pathto}" |
ln -snf "${link}" "${MROOT}${pathto}" |
420 |
|
|
421 |
# # fix mtime and db |
# fix mtime and db |
422 |
# fix_descriptor ${pkgname}/.symlinks \ |
fix_descriptor ${pkgname}/.symlinks \ |
423 |
# "${pathto}" \ |
"${pathto}" \ |
424 |
# "${posix}" \ |
"${posix}" \ |
425 |
# "${link}" \ |
"${link}" \ |
426 |
# "$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \ |
"$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \ |
427 |
# "${MROOT}${pathto}")" |
"${MROOT}${pathto}")" |
428 |
|
|
429 |
done < ${BUILDDIR}/${pkgname}/.symlinks |
done < ${BUILDDIR}/${pkgname}/.symlinks |
430 |
|
|
737 |
[ ! -f ${magefile} ] && die "remove_database_entry() ${magefile} not exist." |
[ ! -f ${magefile} ] && die "remove_database_entry() ${magefile} not exist." |
738 |
|
|
739 |
# remove virtuals only if no other exist |
# remove virtuals only if no other exist |
740 |
if [[ $(count_installed_pkgs --pcat ${pcat} --pname ${pname}) -le 1 ]] |
if [[ $(count_installed_pkgs --pcat=${pcat} --pname=${pname}) -le 1 ]] |
741 |
then |
then |
742 |
# first unregister virtuals |
# first unregister virtuals |
743 |
provide="$(get_value_from_magefile PROVIDE ${magefile})" |
provide="$(get_value_from_magefile PROVIDE ${magefile})" |
766 |
local i |
local i |
767 |
|
|
768 |
# very basic getops |
# very basic getops |
769 |
for i in $* |
for i in $@ |
770 |
do |
do |
771 |
case $1 in |
case ${i} in |
772 |
--pcat|-c) shift; pcat="$1" ;; |
--pcat*) pcat="${i#*=}" ;; |
773 |
--pname|-n) shift; pname="$1" ;; |
--pname*) pname="${i#*=}" ;; |
774 |
esac |
esac |
|
shift |
|
775 |
done |
done |
776 |
|
|
777 |
# sanity checks; abort if not given |
# sanity checks; abort if not given |
810 |
|
|
811 |
mtime="$(stat -c %Y ${MROOT}${INSTALLDB}/${pfull}/.mtime)" |
mtime="$(stat -c %Y ${MROOT}${INSTALLDB}/${pfull}/.mtime)" |
812 |
|
|
813 |
# if $pathto is a symlink than compare linked binary |
# no extra handlink for symlinks anymore as fix_mtime |
814 |
if [ -L "${MROOT}${pathto}" ] |
# uses --no-dereference, compare directly |
815 |
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 |
|
816 |
|
|
817 |
[[ ${mtime} = ${x} ]] && return 0 |
[[ ${mtime} = ${x} ]] && return 0 |
818 |
|
|
1378 |
output+="${mirror}${addon}/${uri/${scheme}/}" |
output+="${mirror}${addon}/${uri/${scheme}/}" |
1379 |
done |
done |
1380 |
else |
else |
1381 |
output="${uri}" |
output="${uri}" |
1382 |
fi |
fi |
1383 |
|
|
1384 |
echo "${output}" |
echo "${output}" |
1413 |
real_uris="$(convertmirrors ${uri})" |
real_uris="$(convertmirrors ${uri})" |
1414 |
|
|
1415 |
# verbose or not |
# verbose or not |
1416 |
mqueryfeature "!verbose" && wget_opts="--quiet" |
mqueryfeature "!verbose" && wget_opts+=" --quiet" |
1417 |
|
|
1418 |
# filter wget options if busybox was found |
# filter wget options if busybox was found |
1419 |
wget_opts="$(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})" |
wget_opts+=" $(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})" |
1420 |
|
|
1421 |
# create outputdir |
# create outputdir |
1422 |
[[ ! -d ${outputdir} ]] && install -d "${outputdir}" |
[[ ! -d ${outputdir} ]] && install -d "${outputdir}" |
1445 |
{ |
{ |
1446 |
local i |
local i |
1447 |
local list="$@" |
local list="$@" |
1448 |
local pkg |
local pkgname |
1449 |
|
local pkgfile |
1450 |
|
local pcat |
1451 |
|
local pname |
1452 |
local mirr |
local mirr |
1453 |
local magefile |
local magefile |
1454 |
local md5file |
local md5file |
1456 |
local count_current |
local count_current |
1457 |
local count_total |
local count_total |
1458 |
local wget_opts |
local wget_opts |
1459 |
|
local fetching |
1460 |
|
|
1461 |
[ -z "${MIRRORS}" ] && die "You have no mirrors defined. Please edit your ${MAGERC}." |
[ -z "${MIRRORS}" ] && die "You have no mirrors defined. Please edit your ${MAGERC}." |
1462 |
|
|
1471 |
|
|
1472 |
for magefile in ${list} |
for magefile in ${list} |
1473 |
do |
do |
1474 |
pkg="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}" |
pkgname="$(get_value_from_magefile PKGNAME ${magefile})" |
1475 |
|
pkgfile="${pkgname}.${PKGSUFFIX}" |
1476 |
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
1477 |
|
|
1478 |
|
pcat=$(magename2pcat ${magefile}) |
1479 |
|
pname=$(magename2pname ${magefile}) |
1480 |
|
md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5" |
1481 |
|
|
1482 |
(( count_current++ )) |
(( count_current++ )) |
1483 |
xtitle "[ (${count_current}/${count_total}) Fetching ${pkg} ]" |
xtitle "[ (${count_current}/${count_total}) Fetching ${pkgfile} ]" |
1484 |
|
|
1485 |
# abort on virtual pkg |
# abort on virtual pkg |
1486 |
if [[ ${pkgtype} = virtual ]] |
if [[ ${pkgtype} = virtual ]] |
1487 |
then |
then |
1488 |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
1489 |
echo " !fetch virtual (${count_current}/${count_total}): ${pkg/.${PKGSUFFIX}/} ... " |
echo " !fetch virtual (${count_current}/${count_total}): ${pkgname} ... " |
1490 |
continue |
continue |
1491 |
fi |
fi |
1492 |
|
|
1494 |
if [[ ${pkgtype} = sources ]] |
if [[ ${pkgtype} = sources ]] |
1495 |
then |
then |
1496 |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
1497 |
echo " !fetch sources (${count_current}/${count_total}): ${pkg/.${PKGSUFFIX}/} ... " |
echo " !fetch sources (${count_current}/${count_total}): ${pkgname} ... " |
1498 |
continue |
continue |
1499 |
fi |
fi |
1500 |
|
|
1501 |
# abort if already exist |
# check if FETCHING is required |
1502 |
if [ -f ${PKGDIR}/${pkg} ] |
if [ ! -f "${md5file}" ] |
1503 |
|
then |
1504 |
|
fetching=true |
1505 |
|
else |
1506 |
|
if mchecksum --rundir "${PKGDIR}" --file "${md5file}" --method md5 &> /dev/null |
1507 |
|
then |
1508 |
|
# md5's ok, no fetching required |
1509 |
|
fetching=false |
1510 |
|
else |
1511 |
|
fetching=true |
1512 |
|
fi |
1513 |
|
fi |
1514 |
|
|
1515 |
|
if [[ ${fetching} = false ]] |
1516 |
then |
then |
1517 |
echo -ne " ${COLBLUE}***${COLDEFAULT}" |
echo -ne " ${COLBLUE}***${COLDEFAULT}" |
1518 |
echo " fetch complete (${count_current}/${count_total}): ${pkg} ... " |
echo " fetch complete (${count_current}/${count_total}): ${pkgfile} ... " |
1519 |
continue |
continue |
1520 |
|
else |
1521 |
|
echo -ne " ${COLBLUE}***${COLDEFAULT}" |
1522 |
|
echo -e " fetching (${count_current}/${count_total}): ${pkgfile} ... " |
1523 |
|
mdownload --uri "package://${pkgfile}" --dir "${PKGDIR}" || die "Could not download ${pkgfile}" |
1524 |
fi |
fi |
1525 |
|
|
1526 |
echo -ne " ${COLBLUE}***${COLDEFAULT}" |
# sanity check, not really needed but to be sure |
1527 |
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} ] |
|
1528 |
then |
then |
1529 |
die "Package '${pkg}' after download not found in '${PKGDIR}'" |
die "Package '${pkgfile}' after download not found in '${PKGDIR}'" |
1530 |
fi |
fi |
1531 |
done |
done |
1532 |
|
|
1581 |
|
|
1582 |
for mirr in ${MIRRORS} |
for mirr in ${MIRRORS} |
1583 |
do |
do |
1584 |
# path without distribution |
# path without distribution |
1585 |
mymirr="${mirr%/*}" |
# (only for stable|testing|unstable and not DISTROTAG) |
1586 |
|
case ${mirr##*/} in |
1587 |
|
stable|testing|unstable) mymirr="${mirr%/*}";; |
1588 |
|
*) mymirr="${mirr}";; |
1589 |
|
esac |
1590 |
|
|
1591 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1592 |
echo "fetching latest md5 from ${mymirr} ..." |
echo "fetching latest md5 from ${mymirr} ..." |
1619 |
else |
else |
1620 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1621 |
echo -n "checking md5sum... " |
echo -n "checking md5sum... " |
1622 |
( 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" |
1623 |
fi |
fi |
1624 |
|
|
1625 |
if [[ -d ${MAGEDIR} ]] |
if [[ -d ${MAGEDIR} ]] |
1626 |
then |
then |
1627 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1628 |
echo "cleaning old mage-tree ${MAGEDIR}..." |
echo "cleaning old mage-tree ${MAGEDIR}..." |
1629 |
rm -rf ${MAGEDIR} |
# honor mountpoints and empty dirs |
1630 |
|
if mountpoint -q ${MAGEDIR} |
1631 |
|
then |
1632 |
|
if ! mcheckemptydir ${MAGEDIR} |
1633 |
|
then |
1634 |
|
find ${MAGEDIR} -mindepth 1 -maxdepth 1 | xargs --no-run-if-empty rm -r |
1635 |
|
fi |
1636 |
|
else |
1637 |
|
rm -rf ${MAGEDIR} |
1638 |
|
fi |
1639 |
fi |
fi |
1640 |
|
|
1641 |
if need_busybox_support tar |
if need_busybox_support tar |
1674 |
fi |
fi |
1675 |
} |
} |
1676 |
|
|
1677 |
xtitle() |
# unused? |
1678 |
{ |
# |
1679 |
if [[ ${TERM} = xterm ]] |
# # cuts full pathnames or versionized names down to basename |
1680 |
then |
# choppkgname() |
1681 |
echo -ne "\033]0;Mage: $1\007" |
# { |
1682 |
fi |
# #we want this only if full name was used |
1683 |
return 0 |
# if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ] |
1684 |
} |
# then |
1685 |
|
# #cuts ARCH and PBUILD |
1686 |
|
# #ARCH comes from ${MAGERC} |
1687 |
xtitleclean() |
# MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}$(print_distrotag)-r*.::g") |
1688 |
{ |
# |
1689 |
if [[ ${TERM} = xterm ]] |
# #cuts version number |
1690 |
then |
# MAGENAME=$(basename ${MAGENAME%-*} .mage) |
1691 |
echo -ne "\033]0;\007" |
# fi |
1692 |
fi |
# } |
|
return 0 |
|
|
} |
|
|
|
|
1693 |
|
|
|
# cuts full pathnames or versionized names down to basename |
|
|
choppkgname() |
|
|
{ |
|
|
#we want this only if full name was used |
|
|
if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ] |
|
|
then |
|
|
#cuts ARCH and PBUILD |
|
|
#ARCH comes from ${MAGERC} |
|
|
MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g") |
|
|
|
|
|
#cuts version number |
|
|
MAGENAME=$(basename ${MAGENAME%-*} .mage) |
|
|
fi |
|
|
} |
|
1694 |
|
|
1695 |
# get_categorie $PNAME, returns CATEGORIE |
# get_categorie $PNAME, returns CATEGORIE |
1696 |
# $1=pname |
# $1=pname |
1769 |
then |
then |
1770 |
HIGHEST_MAGEFILE=${magefile} |
HIGHEST_MAGEFILE=${magefile} |
1771 |
#for debug only |
#for debug only |
1772 |
mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}" |
mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}" >&2 |
1773 |
fi |
fi |
1774 |
done |
done |
1775 |
|
|
1876 |
local filename="${file##*/}" |
local filename="${file##*/}" |
1877 |
local count |
local count |
1878 |
local output |
local output |
1879 |
|
local oldprotected |
1880 |
local i |
local i |
1881 |
|
local x |
1882 |
|
|
1883 |
declare -i count=0 |
# hack; do not honor a global set IFS like '§' |
1884 |
|
local IFS |
1885 |
|
|
1886 |
|
count=0 |
1887 |
|
|
1888 |
# check if there are already protected files |
# check if there are already protected files |
1889 |
for oldpretected in $(find ${dirname} -iname "._cfg????_${filename}" | |
for oldprotected in $(find ${dirname} -iname "._cfg????_${filename}" | |
1890 |
sed -e "s:\(^.*/\)\(._cfg*_\)\(/.*$\):\1\2\3\%\2\%\3:" | |
sed -e "s:\(^.*/\)\(._cfg*_\)\(/.*$\):\1\2\3\%\2\%\3:" | |
1891 |
sort -t'%' -k3 -k2 | cut -f1 -d'%') |
sort -t'%' -k3 -k2 | cut -f1 -d'%') |
1892 |
do |
do |
1893 |
count=$(echo ${oldpretected} | cut -d_ -f2 | sed -e "s:cfg::") |
count="$(echo ${oldprotected} | sed 's:.*\/._cfg\(.*\)_.*:\1:')" |
1894 |
done |
done |
1895 |
(( count ++ )) |
|
1896 |
|
# convert 0001 -> 1; 0120 -> 120 etc |
1897 |
|
# use bash internal base functions to this task |
1898 |
|
x="$((10#${count}))" |
1899 |
|
for (( i=0; i<x; i++ )) |
1900 |
|
do |
1901 |
|
if [[ ${count:${i}:1} != 0 ]] |
1902 |
|
then |
1903 |
|
count="${count:${i}}" |
1904 |
|
break |
1905 |
|
fi |
1906 |
|
done |
1907 |
|
|
1908 |
|
count="$(( ${count}+1 ))" |
1909 |
|
|
1910 |
# fill output up with zeros |
# fill output up with zeros |
1911 |
for (( i=${#count}; i < 4; i++ )); do output="${output}0"; done |
for (( i=${#count}; i < 4; i++ )); do output="${output}0"; done |
2211 |
then |
then |
2212 |
for i in $* |
for i in $* |
2213 |
do |
do |
2214 |
echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc" |
[[ ${SILENT} = 1 ]] || echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc" |
2215 |
source ${SMAGESCRIPTSDIR}/include/${i}.sminc |
source ${SMAGESCRIPTSDIR}/include/${i}.sminc |
2216 |
done |
done |
2217 |
echo |
[[ ${SILENT} = 1 ]] || echo |
2218 |
fi |
fi |
2219 |
} |
} |
2220 |
|
|
2241 |
fi |
fi |
2242 |
} |
} |
2243 |
|
|
|
|
|
2244 |
# returns pname from pkgname |
# returns pname from pkgname |
2245 |
# pkgname2pname $PKGNAME |
# pkgname2pname $PKGNAME |
2246 |
pkgname2pname() |
pkgname2pname() |
2517 |
local SDEPEND |
local SDEPEND |
2518 |
local PROVIDE |
local PROVIDE |
2519 |
local PKGTYPE |
local PKGTYPE |
|
local MAGE_TARGETS |
|
2520 |
local SPLIT_PACKAGE_BASE |
local SPLIT_PACKAGE_BASE |
2521 |
local preinstall |
local preinstall |
2522 |
local postinstall |
local postinstall |
2638 |
echo B:${pbuild} |
echo B:${pbuild} |
2639 |
fi |
fi |
2640 |
|
|
2641 |
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} ]] |
|
2642 |
then |
then |
2643 |
# basic svn compat |
# basic svn compat |
2644 |
if [[ -d ${SMAGESCRIPTSDIR}/.svn ]] |
if [[ -d ${SMAGESCRIPTSDIR}/.svn ]] |
2680 |
if [[ ${PKGTYPE} != virtual ]] && \ |
if [[ ${PKGTYPE} != virtual ]] && \ |
2681 |
[[ ${PKGTYPE} != sources ]] |
[[ ${PKGTYPE} != sources ]] |
2682 |
then |
then |
2683 |
|
unpack_package "${magefile}" |
2684 |
echo -e " ${COLBLUE}***${COLDEFAULT} merging files into system ... " |
echo -e " ${COLBLUE}***${COLDEFAULT} merging files into system ... " |
2685 |
build_doinstall ${PKGNAME} |
build_doinstall ${PKGNAME} |
2686 |
fi |
fi |
2725 |
then |
then |
2726 |
echo -ne "${COLBLUE} *** ${COLDEFAULT}" |
echo -ne "${COLBLUE} *** ${COLDEFAULT}" |
2727 |
echo -n "rebuilding environment ... " |
echo -n "rebuilding environment ... " |
2728 |
${MLIBDIR}/env-rebuild.sh > /dev/null && \ |
${MLIBDIR}/env-rebuild > /dev/null && \ |
2729 |
echo "done." || echo "failure." |
echo "done." || echo "failure." |
2730 |
unset MAGE_ENV_REBUILD |
unset MAGE_ENV_REBUILD |
2731 |
fi |
fi |
2769 |
pname=$(magename2pname ${magefile}) |
pname=$(magename2pname ${magefile}) |
2770 |
pkgname="$(get_value_from_magefile PKGNAME ${magefile})" |
pkgname="$(get_value_from_magefile PKGNAME ${magefile})" |
2771 |
md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5" |
md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5" |
2772 |
pkgfile="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}" |
pkgfile="${pkgname}.${PKGSUFFIX}" |
2773 |
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
2774 |
|
|
2775 |
(( count_current++ )) |
(( count_current++ )) |
2779 |
if [[ ${pkgtype} = virtual ]] |
if [[ ${pkgtype} = virtual ]] |
2780 |
then |
then |
2781 |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
2782 |
echo " !md5sum virtual (${count_current}/${count_total}): ${pkgfile/.${PKGSUFFIX}/} ... " |
echo " !md5sum virtual (${count_current}/${count_total}): ${pkgname} ... " |
2783 |
continue |
continue |
2784 |
fi |
fi |
2785 |
|
|
2787 |
if [[ ${pkgtype} = sources ]] |
if [[ ${pkgtype} = sources ]] |
2788 |
then |
then |
2789 |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
2790 |
echo " !md5sum sources (${count_current}/${count_total}): ${pkgfile/.${PKGSUFFIX}/} ... " |
echo " !md5sum sources (${count_current}/${count_total}): ${pkgname} ... " |
2791 |
continue |
continue |
2792 |
fi |
fi |
2793 |
|
|
2795 |
then |
then |
2796 |
echo -ne "${COLBLUE} *** ${COLDEFAULT}" |
echo -ne "${COLBLUE} *** ${COLDEFAULT}" |
2797 |
echo -ne "checking md5sum (${count_current}/${count_total}): " |
echo -ne "checking md5sum (${count_current}/${count_total}): " |
2798 |
( cd ${PKGDIR}; md5sum -c ${md5file}) || die "md5 for ${pkgfile} failed" |
mchecksum --rundir "${PKGDIR}" --file "${md5file}" --method md5 || die "md5 for ${pkgfile} failed" |
2799 |
else |
else |
2800 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
2801 |
echo -e "!! no md5sum file found for ${pkgfile} :(" |
echo -e "!! no md5sum file found for ${pkgfile} :(" |
2835 |
pbuild=$(magename2pbuild ${pkg}) |
pbuild=$(magename2pbuild ${pkg}) |
2836 |
can_pcat="${pcat}" |
can_pcat="${pcat}" |
2837 |
can_pname="${pname}" |
can_pname="${pname}" |
2838 |
|
|
2839 |
if [ -z "${can_ver_list}" ] |
if [ -z "${can_ver_list}" ] |
2840 |
then |
then |
2841 |
can_ver_list=" ${pver}-${pbuild}" |
can_ver_list=" ${pver}-${pbuild}" |
2990 |
then |
then |
2991 |
echo -ne "${COLBLUE} *** ${COLDEFAULT}" |
echo -ne "${COLBLUE} *** ${COLDEFAULT}" |
2992 |
echo -n "rebuilding environment ... " |
echo -n "rebuilding environment ... " |
2993 |
${MLIBDIR}/env-rebuild.sh > /dev/null && \ |
${MLIBDIR}/env-rebuild > /dev/null && \ |
2994 |
echo "done." || echo "failure." |
echo "done." || echo "failure." |
2995 |
unset MAGE_ENV_REBUILD |
unset MAGE_ENV_REBUILD |
2996 |
fi |
fi |
3008 |
unset -f postremove |
unset -f postremove |
3009 |
} |
} |
3010 |
|
|
3011 |
|
# rerun_pkgfunctions [method] pkg1 pkg2 pkg3 |
3012 |
|
rerun_pkgfunctions() |
3013 |
|
{ |
3014 |
|
local method |
3015 |
|
local list |
3016 |
|
local pcat |
3017 |
|
local pname |
3018 |
|
local pver |
3019 |
|
local pbuild |
3020 |
|
local magefile |
3021 |
|
local i |
3022 |
|
|
3023 |
|
# very basic getops |
3024 |
|
case $1 in |
3025 |
|
--method) shift; method="$1" ;; |
3026 |
|
esac |
3027 |
|
shift |
3028 |
|
local list="$@" |
3029 |
|
|
3030 |
|
# sanity check |
3031 |
|
case ${method} in |
3032 |
|
preinstall|postinstall) ;; |
3033 |
|
preremove|postremove) ;; |
3034 |
|
*) die "rerun_pkgfunctions(): Unknown method '${method}'." ;; |
3035 |
|
esac |
3036 |
|
|
3037 |
|
if [[ -n ${MROOT} ]] |
3038 |
|
then |
3039 |
|
echo -ne ${COLRED} |
3040 |
|
echo "!! running in MROOT=${MROOT}" |
3041 |
|
echo -ne ${COLDEFAULT} |
3042 |
|
echo |
3043 |
|
fi |
3044 |
|
|
3045 |
|
for pkg in ${list} |
3046 |
|
do |
3047 |
|
pcat=$(dep2pcat ${pkg}) |
3048 |
|
pname=$(magename2pname ${pkg}) |
3049 |
|
pver=$(magename2pver ${pkg}) |
3050 |
|
pbuild=$(magename2pbuild ${pkg}) |
3051 |
|
magefile="${MROOT}${INSTALLDB}/${pcat}/${pname}-${pver}-${pbuild}/${pname}-${pver}-${pbuild}.mage" |
3052 |
|
|
3053 |
|
if [ -e ${magefile} ] |
3054 |
|
then |
3055 |
|
source ${magefile} |
3056 |
|
if [ -n "$(typeset -f ${method})" ] |
3057 |
|
then |
3058 |
|
echo -e " ${COLBLUE}***${COLDEFAULT} running ${method} for ${pkg} ... " |
3059 |
|
${method} |
3060 |
|
else |
3061 |
|
echo "No ${method}() for pkg '${pkg}' defined. Doing nothing." |
3062 |
|
fi |
3063 |
|
unset -f preinstall postinstall preremove postremove |
3064 |
|
else |
3065 |
|
die "Magefile '${magefile}' does not exist." |
3066 |
|
fi |
3067 |
|
done |
3068 |
|
} |
3069 |
|
|
3070 |
show_etc_update_mesg() |
show_etc_update_mesg() |
3071 |
{ |
{ |
3072 |
[ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0 |
[ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0 |
3094 |
local state |
local state |
3095 |
local descriptiom |
local descriptiom |
3096 |
local homepage |
local homepage |
3097 |
|
local license |
3098 |
local i |
local i |
3099 |
local all_installed |
local all_installed |
3100 |
local ipver |
local ipver |
3131 |
state="$(get_value_from_magefile STATE ${magefile})" |
state="$(get_value_from_magefile STATE ${magefile})" |
3132 |
description="$(get_value_from_magefile DESCRIPTION ${magefile})" |
description="$(get_value_from_magefile DESCRIPTION ${magefile})" |
3133 |
homepage="$(get_value_from_magefile HOMEPAGE ${magefile})" |
homepage="$(get_value_from_magefile HOMEPAGE ${magefile})" |
3134 |
|
license="$(get_value_from_magefile LICENSE ${magefile})" |
3135 |
|
|
3136 |
# all installed |
# all installed |
3137 |
for i in $(get_uninstall_candidates --pname ${pname} --pcat ${pcat}) |
for i in $(get_uninstall_candidates --pname ${pname} --pcat ${pcat}) |
3138 |
do |
do |
3139 |
ipver="$(magename2pver ${i})" |
ipver="$(magename2pver ${i})" |
3140 |
ipbuild="$(magename2pbuild ${i})" |
ipbuild="$(magename2pbuild ${i})" |
3141 |
|
|
3142 |
if [[ -z ${all_installed} ]] |
if [[ -z ${all_installed} ]] |
3143 |
then |
then |
3144 |
all_installed="${ipver}-${ipbuild}" |
all_installed="${ipver}-${ipbuild}" |
3147 |
fi |
fi |
3148 |
done |
done |
3149 |
[[ -z ${all_installed} ]] && all_installed="none" |
[[ -z ${all_installed} ]] && all_installed="none" |
3150 |
|
|
3151 |
case ${state} in |
case ${state} in |
3152 |
stable) state=${COLGREEN}"[s] ";; |
stable) state=${COLGREEN}"[s] ";; |
3153 |
testing) state=${COLYELLOW}"[t] ";; |
testing) state=${COLYELLOW}"[t] ";; |
3171 |
"") continue;; |
"") continue;; |
3172 |
esac |
esac |
3173 |
|
|
3174 |
deps="${deps} $(basename ${dep%-*})" |
if [[ -z ${deps} ]] |
3175 |
|
then |
3176 |
|
deps="$(basename ${dep%-*})" |
3177 |
|
else |
3178 |
|
deps="${deps} $(basename ${dep%-*})" |
3179 |
|
fi |
3180 |
done << EOF |
done << EOF |
3181 |
${depsfull} |
${depsfull} |
3182 |
EOF |
EOF |
3187 |
"") continue;; |
"") continue;; |
3188 |
esac |
esac |
3189 |
|
|
3190 |
sdeps="${sdeps} $(basename ${dep%-*})" |
if [[ -z ${sdeps} ]] |
3191 |
|
then |
3192 |
|
sdeps="$(basename ${dep%-*})" |
3193 |
|
else |
3194 |
|
sdeps="${sdeps} $(basename ${dep%-*})" |
3195 |
|
fi |
3196 |
done << EOF |
done << EOF |
3197 |
${sdepsfull} |
${sdepsfull} |
3198 |
EOF |
EOF |
3202 |
echo " Installed versions: ${all_installed}" |
echo " Installed versions: ${all_installed}" |
3203 |
echo " Description: ${description}" |
echo " Description: ${description}" |
3204 |
echo " Homepage: ${homepage}" |
echo " Homepage: ${homepage}" |
3205 |
echo " Depends: ${deps}" |
if [[ ! -z ${license} ]] |
3206 |
|
then |
3207 |
|
echo " License: ${license}" |
3208 |
|
fi |
3209 |
|
echo " Depends: ${deps}" |
3210 |
echo " SDepends: ${sdeps}" |
echo " SDepends: ${sdeps}" |
3211 |
echo |
echo |
3212 |
|
|
3323 |
need_busybox_support() |
need_busybox_support() |
3324 |
{ |
{ |
3325 |
local cmd |
local cmd |
3326 |
|
local busybox |
3327 |
cmd="$1" |
cmd="$1" |
3328 |
|
|
3329 |
if [[ -x /bin/busybox ]] |
for busybox in {,/usr}/bin/busybox |
3330 |
then |
do |
3331 |
if [[ $(readlink $(which ${cmd})) = /bin/busybox ]] |
if [[ -x ${busybox} ]] |
3332 |
then |
then |
3333 |
# needs busybox support |
if [[ $(readlink $(type -P ${cmd})) = ${busybox} ]] |
3334 |
return 0 |
then |
3335 |
|
# needs busybox support |
3336 |
|
return 0 |
3337 |
|
fi |
3338 |
fi |
fi |
3339 |
fi |
done |
3340 |
|
|
3341 |
# no busybox |
# no busybox |
3342 |
return 1 |
return 1 |
3393 |
{ |
{ |
3394 |
local feature="$1" |
local feature="$1" |
3395 |
local retval |
local retval |
3396 |
|
|
3397 |
case "${feature}" in |
case "${feature}" in |
3398 |
autosvc|!autosvc) retval=0 ;; |
autosvc|!autosvc) retval=0 ;; |
3399 |
buildlog|!buildlog) retval=0 ;; |
buildlog|!buildlog) retval=0 ;; |
3400 |
ccache|!ccache) retval=0 ;; |
ccache|!ccache) retval=0 ;; |
3401 |
check|!check) retval=0 ;; |
check|!check) retval=0 ;; |
3402 |
compressdoc|!compressdoc) retval=0 ;; |
compressdoc|!compressdoc) retval=0 ;; |
3403 |
|
debug|!debug) retval=0 ;; |
3404 |
distcc|!distcc) retval=0 ;; |
distcc|!distcc) retval=0 ;; |
3405 |
|
icecc|!icecc) retval=0 ;; |
3406 |
kernelsrcunpack|!kernelsrcunpack) retval=0 ;; |
kernelsrcunpack|!kernelsrcunpack) retval=0 ;; |
3407 |
libtool|!libtool) retval=0 ;; |
libtool|!libtool) retval=0 ;; |
3408 |
linuxsymlink|!linuxsymlink) retval=0 ;; |
linuxsymlink|!linuxsymlink) retval=0 ;; |
3409 |
|
multilib|!multilib) reval=0 ;; |
3410 |
pkgbuild|!pkgbuild) retval=0 ;; |
pkgbuild|!pkgbuild) retval=0 ;; |
3411 |
|
pkgdistrotag|!pkgdistrotag) retval=0 ;; |
3412 |
|
pkgmetadata|!pkgmetadata) retval=0 ;; |
3413 |
purge|!purge) retval=0 ;; |
purge|!purge) retval=0 ;; |
3414 |
qalint|!qalint) retval=0 ;; |
qalint|!qalint) retval=0 ;; |
3415 |
regentree|!regentree) retval=0 ;; |
regentree|!regentree) retval=0 ;; |
3416 |
stepbystep|!stepbystep) retval=0 ;; |
resume|!resume) retval=0 ;; |
3417 |
srcpkgbuild|!srcpkgbuild) retval=0 ;; |
srcpkgbuild|!srcpkgbuild) retval=0 ;; |
3418 |
srcpkgtarball|!srcpkgtarball) retval=0 ;; |
srcpkgtarball|!srcpkgtarball) retval=0 ;; |
3419 |
|
static|!static) retval=0 ;; |
3420 |
|
stepbystep|!stepbystep) retval=0 ;; |
3421 |
strip|!strip) retval=0 ;; |
strip|!strip) retval=0 ;; |
3422 |
|
verbose|!verbose) retval=0 ;; |
3423 |
*) retval=1 ;; |
*) retval=1 ;; |
3424 |
esac |
esac |
3425 |
|
|
3428 |
|
|
3429 |
load_mage_features() |
load_mage_features() |
3430 |
{ |
{ |
|
echo "loading mage-features... " |
|
3431 |
for i in ${MAGE_FEATURES_GLOBAL[*]} ${MAGE_FEATURES[*]} |
for i in ${MAGE_FEATURES_GLOBAL[*]} ${MAGE_FEATURES[*]} |
3432 |
do |
do |
3433 |
FVERBOSE=off msetfeature ${i} |
FVERBOSE=off msetfeature ${i} |
3434 |
done |
done |
|
|
|
|
echo "done" |
|
3435 |
} |
} |
3436 |
|
|
3437 |
msetfeature() |
msetfeature() |
3448 |
|
|
3449 |
if ! known_mage_feature "${feature}" |
if ! known_mage_feature "${feature}" |
3450 |
then |
then |
3451 |
[[ ${FVERBOSE} = off ]] || echo "unkown feature ${feature}, ignoring it" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLRED}Unknown feature '${feature}', ignoring it${COLDEFAULT}" |
3452 |
return 3 |
return 3 |
3453 |
fi |
fi |
3454 |
|
|
3456 |
do |
do |
3457 |
if [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature} ]] |
if [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature} ]] |
3458 |
then |
then |
3459 |
[[ ${FVERBOSE} = off ]] || echo "feature '${feature}' already enabled" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' already enabled${COLDEFAULT}" |
3460 |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
3461 |
found=1 |
found=1 |
3462 |
elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = !${feature} ]] |
elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = !${feature} ]] |
3463 |
then |
then |
3464 |
[[ ${FVERBOSE} = off ]] || echo "feature '${feature}' currently disabled, enabling it!" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' currently disabled, enabling it!${COLDEFAULT}" |
3465 |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
3466 |
found=1 |
found=1 |
3467 |
elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature//!} ]] |
elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature//!} ]] |
3468 |
then |
then |
3469 |
[[ ${FVERBOSE} = off ]] || echo "feature '${feature//!}' currently enabled, disabling it!" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature//!}' currently enabled, disabling it!${COLDEFAULT}" |
3470 |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
3471 |
found=1 |
found=1 |
3472 |
fi |
fi |
3476 |
# it was not declared. in this case enable it |
# it was not declared. in this case enable it |
3477 |
if [[ ${found} = 0 ]] |
if [[ ${found} = 0 ]] |
3478 |
then |
then |
3479 |
[[ ${FVERBOSE} = off ]] || echo "feature '${feature}' was not declared, enabling it!" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' was not declared, enabling it!${COLDEFAULT}" |
3480 |
MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" ) |
MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" ) |
3481 |
fi |
fi |
3482 |
|
|
3483 |
export MAGE_FEATURE_CURRENT |
export MAGE_FEATURES_CURRENT |
3484 |
done |
done |
3485 |
} |
} |
3486 |
|
|
3501 |
fi |
fi |
3502 |
done |
done |
3503 |
else |
else |
3504 |
|
[[ ${FVERBOSE} = off ]] || echo -e "${COLRED}Unknown feature '${feature}', ignoring it${COLDEFAULT}" |
3505 |
retval=3 |
retval=3 |
3506 |
fi |
fi |
3507 |
|
|
3510 |
|
|
3511 |
mprintfeatures() |
mprintfeatures() |
3512 |
{ |
{ |
3513 |
echo "Global features: ${MAGE_FEATURES_GLOBAL[*]}" |
echo -e "${COLRED}Global features:${COLDEFAULT} ${MAGE_FEATURES_GLOBAL[*]}" |
3514 |
echo "Local features: ${MAGE_FEATURES[*]}" |
echo -e "${COLYELLOW}Local features:${COLDEFAULT} ${MAGE_FEATURES[*]}" |
3515 |
echo "Current features: ${MAGE_FEATURES_CURRENT[*]}" |
echo -e "${COLGREEN}Current features:${COLDEFAULT} ${MAGE_FEATURES_CURRENT[*]}" |
3516 |
} |
} |