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" |
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 $* |
71 |
*) die "mchecksum(): unknown method '${method}'" ;; |
*) die "mchecksum(): unknown method '${method}'" ;; |
72 |
esac |
esac |
73 |
|
|
74 |
if [[ -d ${rundir} ]] |
if [[ -f ${file} ]] |
75 |
then |
then |
76 |
pushd ${rundir} &> /dev/null |
if [[ -d ${rundir} ]] |
77 |
# be verbose here |
then |
78 |
${cmd} -c ${file} #&> /dev/null |
pushd ${rundir} &> /dev/null |
79 |
retval="$?" |
|
80 |
popd &> /dev/null |
# all file must be non-zero |
81 |
|
retval=0 |
82 |
|
while read sum dest |
83 |
|
do |
84 |
|
if [ ! -s ${dest} ] |
85 |
|
then |
86 |
|
echo "${dest}: file is empty ;(" |
87 |
|
retval=127 |
88 |
|
fi |
89 |
|
done < ${file} |
90 |
|
if [[ ${retval} != 127 ]] |
91 |
|
then |
92 |
|
# be verbose here |
93 |
|
${cmd} -c ${file} #&> /dev/null |
94 |
|
retval="$?" |
95 |
|
fi |
96 |
|
|
97 |
|
popd &> /dev/null |
98 |
|
else |
99 |
|
retval=1 |
100 |
|
fi |
101 |
else |
else |
102 |
|
echo "missing checksum file '${file}' ;(" |
103 |
retval=1 |
retval=1 |
104 |
fi |
fi |
105 |
|
|
125 |
return ${retval} |
return ${retval} |
126 |
} |
} |
127 |
|
|
128 |
|
unpack_package() |
129 |
|
{ |
130 |
|
local magefile="$1" |
131 |
|
local pkgname |
132 |
|
local pkgfile |
133 |
|
local pkgtype |
134 |
|
local tar_opts |
135 |
|
|
136 |
|
pkgname="$(get_value_from_magefile PKGNAME ${magefile})" |
137 |
|
pkgfile="${pkgname}.${PKGSUFFIX}" |
138 |
|
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
139 |
|
|
140 |
|
xtitle "[ Unpacking ${pkg} ]" |
141 |
|
|
142 |
|
# abort on virtual pkg |
143 |
|
if [[ ${pkgtype} = virtual ]] |
144 |
|
then |
145 |
|
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
146 |
|
echo " !unpack virtual ${pkgname} ... " |
147 |
|
continue |
148 |
|
fi |
149 |
|
|
150 |
|
# abort on sources pkg |
151 |
|
if [[ ${pkgtype} = sources ]] |
152 |
|
then |
153 |
|
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
154 |
|
echo " !unpack sources ${pkgname} ... " |
155 |
|
continue |
156 |
|
fi |
157 |
|
|
158 |
|
# busybox? |
159 |
|
if need_busybox_support tar |
160 |
|
then |
161 |
|
tar_opts="xjf" |
162 |
|
else |
163 |
|
tar_opts="xjmf" |
164 |
|
fi |
165 |
|
|
166 |
|
echo -e " ${COLBLUE}***${COLDEFAULT} unpacking ${pkgfile} ... " |
167 |
|
tar ${tar_opts} ${PKGDIR}/${pkgfile} -C ${BUILDDIR} || die "Unpacking package ${pkgfile}" |
168 |
|
} |
169 |
|
|
170 |
unpack_packages() |
unpack_packages() |
171 |
{ |
{ |
172 |
local list="$@" |
local list="$@" |
173 |
local magefile |
local magefile |
|
local pkg |
|
|
local pkgtype |
|
174 |
local count_current |
local count_current |
175 |
local count_total |
local count_total |
176 |
local tar_opts |
local tar_opts |
183 |
|
|
184 |
for magefile in ${list} |
for magefile in ${list} |
185 |
do |
do |
186 |
pkg="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}" |
unpack_package "${magefile}" |
|
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
|
|
|
|
187 |
(( 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}" |
|
188 |
done |
done |
189 |
|
|
190 |
# add a crlf for a better view |
# add a crlf for a better view |
767 |
[ ! -f ${magefile} ] && die "remove_database_entry() ${magefile} not exist." |
[ ! -f ${magefile} ] && die "remove_database_entry() ${magefile} not exist." |
768 |
|
|
769 |
# remove virtuals only if no other exist |
# remove virtuals only if no other exist |
770 |
if [[ $(count_installed_pkgs --pcat ${pcat} --pname ${pname}) -le 1 ]] |
if [[ $(count_installed_pkgs --pcat=${pcat} --pname=${pname}) -le 1 ]] |
771 |
then |
then |
772 |
# first unregister virtuals |
# first unregister virtuals |
773 |
provide="$(get_value_from_magefile PROVIDE ${magefile})" |
provide="$(get_value_from_magefile PROVIDE ${magefile})" |
796 |
local i |
local i |
797 |
|
|
798 |
# very basic getops |
# very basic getops |
799 |
for i in $* |
for i in $@ |
800 |
do |
do |
801 |
case $1 in |
case ${i} in |
802 |
--pcat|-c) shift; pcat="$1" ;; |
--pcat*) pcat="${i#*=}" ;; |
803 |
--pname|-n) shift; pname="$1" ;; |
--pname*) pname="${i#*=}" ;; |
804 |
esac |
esac |
|
shift |
|
805 |
done |
done |
806 |
|
|
807 |
# sanity checks; abort if not given |
# sanity checks; abort if not given |
1389 |
|
|
1390 |
# check known uri schemes |
# check known uri schemes |
1391 |
case ${uri} in |
case ${uri} in |
1392 |
http://*|https://*|ftp://*|ftps://*) mirrors="" ;; |
http://*|https://*|ftp://*|ftps://*|file://*) mirrors="" ;; |
1393 |
mirror://*) mirrors="${MIRRORS}"; scheme="mirror://"; addon="/sources" ;; |
mirror://*) mirrors="${MIRRORS}"; scheme="mirror://"; addon="/sources" ;; |
1394 |
package://*) mirrors="${MIRRORS}"; scheme="package://"; addon="/${PACKAGES_SERVER_PATH}" ;; |
package://*) mirrors="${MIRRORS}"; scheme="package://"; addon="/${PACKAGES_SERVER_PATH}" ;; |
1395 |
gnu://*) mirrors="${GNU_MIRRORS}"; scheme="gnu://" ;; |
gnu://*) mirrors="${GNU_MIRRORS}"; scheme="gnu://" ;; |
1408 |
output+="${mirror}${addon}/${uri/${scheme}/}" |
output+="${mirror}${addon}/${uri/${scheme}/}" |
1409 |
done |
done |
1410 |
else |
else |
1411 |
output="${uri}" |
output="${uri}" |
1412 |
fi |
fi |
1413 |
|
|
1414 |
echo "${output}" |
echo "${output}" |
1456 |
# get the name of the output file |
# get the name of the output file |
1457 |
outputfile="${mirror##*/}" |
outputfile="${mirror##*/}" |
1458 |
|
|
1459 |
wget ${wget_opts} --output-document="${outputdir}/${outputfile}" "${mirror}" |
case ${mirror} in |
1460 |
retval="$?" |
file://*) |
1461 |
|
cp -v "${mirror//file:\/\/}" "${outputdir}/${outputfile}" |
1462 |
|
retval="$?" |
1463 |
|
;; |
1464 |
|
*) |
1465 |
|
wget ${wget_opts} --output-document="${outputdir}/${outputfile}" "${mirror}" |
1466 |
|
retval="$?" |
1467 |
|
;; |
1468 |
|
esac |
1469 |
|
|
1470 |
if [[ ${retval} = 0 ]] |
if [[ ${retval} = 0 ]] |
1471 |
then |
then |
1472 |
break |
break |
1484 |
{ |
{ |
1485 |
local i |
local i |
1486 |
local list="$@" |
local list="$@" |
1487 |
local pkg |
local pkgname |
1488 |
|
local pkgfile |
1489 |
|
local pcat |
1490 |
|
local pname |
1491 |
local mirr |
local mirr |
1492 |
local magefile |
local magefile |
1493 |
local md5file |
local md5file |
1495 |
local count_current |
local count_current |
1496 |
local count_total |
local count_total |
1497 |
local wget_opts |
local wget_opts |
1498 |
|
local fetching |
1499 |
|
|
1500 |
[ -z "${MIRRORS}" ] && die "You have no mirrors defined. Please edit your ${MAGERC}." |
[ -z "${MIRRORS}" ] && die "You have no mirrors defined. Please edit your ${MAGERC}." |
1501 |
|
|
1510 |
|
|
1511 |
for magefile in ${list} |
for magefile in ${list} |
1512 |
do |
do |
1513 |
pkg="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}" |
pkgname="$(get_value_from_magefile PKGNAME ${magefile})" |
1514 |
|
pkgfile="${pkgname}.${PKGSUFFIX}" |
1515 |
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
1516 |
|
|
1517 |
|
pcat=$(magename2pcat ${magefile}) |
1518 |
|
pname=$(magename2pname ${magefile}) |
1519 |
|
md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5" |
1520 |
|
|
1521 |
(( count_current++ )) |
(( count_current++ )) |
1522 |
xtitle "[ (${count_current}/${count_total}) Fetching ${pkg} ]" |
xtitle "[ (${count_current}/${count_total}) Fetching ${pkgfile} ]" |
1523 |
|
|
1524 |
# abort on virtual pkg |
# abort on virtual pkg |
1525 |
if [[ ${pkgtype} = virtual ]] |
if [[ ${pkgtype} = virtual ]] |
1526 |
then |
then |
1527 |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
1528 |
echo " !fetch virtual (${count_current}/${count_total}): ${pkg/.${PKGSUFFIX}/} ... " |
echo " !fetch virtual (${count_current}/${count_total}): ${pkgname} ... " |
1529 |
continue |
continue |
1530 |
fi |
fi |
1531 |
|
|
1533 |
if [[ ${pkgtype} = sources ]] |
if [[ ${pkgtype} = sources ]] |
1534 |
then |
then |
1535 |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
1536 |
echo " !fetch sources (${count_current}/${count_total}): ${pkg/.${PKGSUFFIX}/} ... " |
echo " !fetch sources (${count_current}/${count_total}): ${pkgname} ... " |
1537 |
continue |
continue |
1538 |
fi |
fi |
1539 |
|
|
1540 |
# abort if already exist |
# check if FETCHING is required |
1541 |
if [ -f ${PKGDIR}/${pkg} ] |
if [ ! -f "${md5file}" ] |
1542 |
|
then |
1543 |
|
fetching=true |
1544 |
|
else |
1545 |
|
if mchecksum --rundir "${PKGDIR}" --file "${md5file}" --method md5 &> /dev/null |
1546 |
|
then |
1547 |
|
# md5's ok, no fetching required |
1548 |
|
fetching=false |
1549 |
|
else |
1550 |
|
fetching=true |
1551 |
|
fi |
1552 |
|
fi |
1553 |
|
|
1554 |
|
if [[ ${fetching} = false ]] |
1555 |
then |
then |
1556 |
echo -ne " ${COLBLUE}***${COLDEFAULT}" |
echo -ne " ${COLBLUE}***${COLDEFAULT}" |
1557 |
echo " fetch complete (${count_current}/${count_total}): ${pkg} ... " |
echo " fetch complete (${count_current}/${count_total}): ${pkgfile} ... " |
1558 |
continue |
continue |
1559 |
|
else |
1560 |
|
echo -ne " ${COLBLUE}***${COLDEFAULT}" |
1561 |
|
echo -e " fetching (${count_current}/${count_total}): ${pkgfile} ... " |
1562 |
|
mdownload --uri "package://${pkgfile}" --dir "${PKGDIR}" || die "Could not download ${pkgfile}" |
1563 |
fi |
fi |
1564 |
|
|
1565 |
echo -ne " ${COLBLUE}***${COLDEFAULT}" |
# sanity check, not really needed but to be sure |
1566 |
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} ] |
|
1567 |
then |
then |
1568 |
die "Package '${pkg}' after download not found in '${PKGDIR}'" |
die "Package '${pkgfile}' after download not found in '${PKGDIR}'" |
1569 |
fi |
fi |
1570 |
done |
done |
1571 |
|
|
1670 |
then |
then |
1671 |
if ! mcheckemptydir ${MAGEDIR} |
if ! mcheckemptydir ${MAGEDIR} |
1672 |
then |
then |
1673 |
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 |
1674 |
fi |
fi |
1675 |
else |
else |
1676 |
rm -rf ${MAGEDIR} |
rm -rf ${MAGEDIR} |
1828 |
then |
then |
1829 |
HIGHEST_MAGEFILE=${magefile} |
HIGHEST_MAGEFILE=${magefile} |
1830 |
#for debug only |
#for debug only |
1831 |
mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}" |
mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}" >&2 |
1832 |
fi |
fi |
1833 |
done |
done |
1834 |
|
|
2270 |
then |
then |
2271 |
for i in $* |
for i in $* |
2272 |
do |
do |
2273 |
echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc" |
[[ ${SILENT} = 1 ]] || echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc" |
2274 |
source ${SMAGESCRIPTSDIR}/include/${i}.sminc |
source ${SMAGESCRIPTSDIR}/include/${i}.sminc |
2275 |
done |
done |
2276 |
echo |
[[ ${SILENT} = 1 ]] || echo |
2277 |
fi |
fi |
2278 |
} |
} |
2279 |
|
|
2577 |
local SDEPEND |
local SDEPEND |
2578 |
local PROVIDE |
local PROVIDE |
2579 |
local PKGTYPE |
local PKGTYPE |
|
local MAGE_TARGETS |
|
2580 |
local SPLIT_PACKAGE_BASE |
local SPLIT_PACKAGE_BASE |
2581 |
local preinstall |
local preinstall |
2582 |
local postinstall |
local postinstall |
2698 |
echo B:${pbuild} |
echo B:${pbuild} |
2699 |
fi |
fi |
2700 |
|
|
2701 |
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} ]] |
|
2702 |
then |
then |
2703 |
# basic svn compat |
# basic svn compat |
2704 |
if [[ -d ${SMAGESCRIPTSDIR}/.svn ]] |
if [[ -d ${SMAGESCRIPTSDIR}/.svn ]] |
2740 |
if [[ ${PKGTYPE} != virtual ]] && \ |
if [[ ${PKGTYPE} != virtual ]] && \ |
2741 |
[[ ${PKGTYPE} != sources ]] |
[[ ${PKGTYPE} != sources ]] |
2742 |
then |
then |
2743 |
|
unpack_package "${magefile}" |
2744 |
echo -e " ${COLBLUE}***${COLDEFAULT} merging files into system ... " |
echo -e " ${COLBLUE}***${COLDEFAULT} merging files into system ... " |
2745 |
build_doinstall ${PKGNAME} |
build_doinstall ${PKGNAME} |
2746 |
fi |
fi |
2829 |
pname=$(magename2pname ${magefile}) |
pname=$(magename2pname ${magefile}) |
2830 |
pkgname="$(get_value_from_magefile PKGNAME ${magefile})" |
pkgname="$(get_value_from_magefile PKGNAME ${magefile})" |
2831 |
md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5" |
md5file="${MAGEDIR}/${pcat}/${pname}/md5/${pkgname}.md5" |
2832 |
pkgfile="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}" |
pkgfile="${pkgname}.${PKGSUFFIX}" |
2833 |
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
2834 |
|
|
2835 |
(( count_current++ )) |
(( count_current++ )) |
2839 |
if [[ ${pkgtype} = virtual ]] |
if [[ ${pkgtype} = virtual ]] |
2840 |
then |
then |
2841 |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
2842 |
echo " !md5sum virtual (${count_current}/${count_total}): ${pkgfile/.${PKGSUFFIX}/} ... " |
echo " !md5sum virtual (${count_current}/${count_total}): ${pkgname} ... " |
2843 |
continue |
continue |
2844 |
fi |
fi |
2845 |
|
|
2847 |
if [[ ${pkgtype} = sources ]] |
if [[ ${pkgtype} = sources ]] |
2848 |
then |
then |
2849 |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
2850 |
echo " !md5sum sources (${count_current}/${count_total}): ${pkgfile/.${PKGSUFFIX}/} ... " |
echo " !md5sum sources (${count_current}/${count_total}): ${pkgname} ... " |
2851 |
continue |
continue |
2852 |
fi |
fi |
2853 |
|
|
2895 |
pbuild=$(magename2pbuild ${pkg}) |
pbuild=$(magename2pbuild ${pkg}) |
2896 |
can_pcat="${pcat}" |
can_pcat="${pcat}" |
2897 |
can_pname="${pname}" |
can_pname="${pname}" |
2898 |
|
|
2899 |
if [ -z "${can_ver_list}" ] |
if [ -z "${can_ver_list}" ] |
2900 |
then |
then |
2901 |
can_ver_list=" ${pver}-${pbuild}" |
can_ver_list=" ${pver}-${pbuild}" |
3068 |
unset -f postremove |
unset -f postremove |
3069 |
} |
} |
3070 |
|
|
3071 |
|
# rerun_pkgfunctions [method] pkg1 pkg2 pkg3 |
3072 |
|
rerun_pkgfunctions() |
3073 |
|
{ |
3074 |
|
local method |
3075 |
|
local list |
3076 |
|
local pcat |
3077 |
|
local pname |
3078 |
|
local pver |
3079 |
|
local pbuild |
3080 |
|
local magefile |
3081 |
|
local i |
3082 |
|
|
3083 |
|
# very basic getops |
3084 |
|
case $1 in |
3085 |
|
--method) shift; method="$1" ;; |
3086 |
|
esac |
3087 |
|
shift |
3088 |
|
local list="$@" |
3089 |
|
|
3090 |
|
# sanity check |
3091 |
|
case ${method} in |
3092 |
|
preinstall|postinstall) ;; |
3093 |
|
preremove|postremove) ;; |
3094 |
|
*) die "rerun_pkgfunctions(): Unknown method '${method}'." ;; |
3095 |
|
esac |
3096 |
|
|
3097 |
|
if [[ -n ${MROOT} ]] |
3098 |
|
then |
3099 |
|
echo -ne ${COLRED} |
3100 |
|
echo "!! running in MROOT=${MROOT}" |
3101 |
|
echo -ne ${COLDEFAULT} |
3102 |
|
echo |
3103 |
|
fi |
3104 |
|
|
3105 |
|
for pkg in ${list} |
3106 |
|
do |
3107 |
|
pcat=$(dep2pcat ${pkg}) |
3108 |
|
pname=$(magename2pname ${pkg}) |
3109 |
|
pver=$(magename2pver ${pkg}) |
3110 |
|
pbuild=$(magename2pbuild ${pkg}) |
3111 |
|
magefile="${MROOT}${INSTALLDB}/${pcat}/${pname}-${pver}-${pbuild}/${pname}-${pver}-${pbuild}.mage" |
3112 |
|
|
3113 |
|
if [ -e ${magefile} ] |
3114 |
|
then |
3115 |
|
source ${magefile} |
3116 |
|
if [ -n "$(typeset -f ${method})" ] |
3117 |
|
then |
3118 |
|
echo -e " ${COLBLUE}***${COLDEFAULT} running ${method} for ${pkg} ... " |
3119 |
|
${method} |
3120 |
|
else |
3121 |
|
echo "No ${method}() for pkg '${pkg}' defined. Doing nothing." |
3122 |
|
fi |
3123 |
|
unset -f preinstall postinstall preremove postremove |
3124 |
|
else |
3125 |
|
die "Magefile '${magefile}' does not exist." |
3126 |
|
fi |
3127 |
|
done |
3128 |
|
} |
3129 |
|
|
3130 |
show_etc_update_mesg() |
show_etc_update_mesg() |
3131 |
{ |
{ |
3132 |
[ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0 |
[ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0 |
3390 |
do |
do |
3391 |
if [[ -x ${busybox} ]] |
if [[ -x ${busybox} ]] |
3392 |
then |
then |
3393 |
if [[ $(readlink $(which ${cmd})) = ${busybox} ]] |
if [[ $(readlink $(type -P ${cmd})) = ${busybox} ]] |
3394 |
then |
then |
3395 |
# needs busybox support |
# needs busybox support |
3396 |
return 0 |
return 0 |
3453 |
{ |
{ |
3454 |
local feature="$1" |
local feature="$1" |
3455 |
local retval |
local retval |
3456 |
|
|
3457 |
case "${feature}" in |
case "${feature}" in |
3458 |
autosvc|!autosvc) retval=0 ;; |
autosvc|!autosvc) retval=0 ;; |
3459 |
buildlog|!buildlog) retval=0 ;; |
buildlog|!buildlog) retval=0 ;; |
3462 |
compressdoc|!compressdoc) retval=0 ;; |
compressdoc|!compressdoc) retval=0 ;; |
3463 |
debug|!debug) retval=0 ;; |
debug|!debug) retval=0 ;; |
3464 |
distcc|!distcc) retval=0 ;; |
distcc|!distcc) retval=0 ;; |
3465 |
|
icecc|!icecc) retval=0 ;; |
3466 |
kernelsrcunpack|!kernelsrcunpack) retval=0 ;; |
kernelsrcunpack|!kernelsrcunpack) retval=0 ;; |
3467 |
libtool|!libtool) retval=0 ;; |
libtool|!libtool) retval=0 ;; |
3468 |
linuxsymlink|!linuxsymlink) retval=0 ;; |
linuxsymlink|!linuxsymlink) retval=0 ;; |
3538 |
MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" ) |
MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" ) |
3539 |
fi |
fi |
3540 |
|
|
3541 |
export MAGE_FEATURE_CURRENT |
export MAGE_FEATURES_CURRENT |
3542 |
done |
done |
3543 |
} |
} |
3544 |
|
|