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 $* |
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-size OK" |
85 |
|
else |
86 |
|
echo "${dest}: file is empty ;(" |
87 |
|
retval=127 |
88 |
|
fi |
89 |
|
done < ${file} |
90 |
|
if [[ ${retval} != 127 ]] |
91 |
|
then |
92 |
|
# insert an empty line for cosmetic |
93 |
|
echo |
94 |
|
|
95 |
|
# be verbose here |
96 |
|
${cmd} -c ${file} #&> /dev/null |
97 |
|
retval="$?" |
98 |
|
fi |
99 |
|
|
100 |
popd &> /dev/null |
popd &> /dev/null |
101 |
else |
else |
102 |
retval=1 |
retval=1 |
124 |
return ${retval} |
return ${retval} |
125 |
} |
} |
126 |
|
|
127 |
|
unpack_package() |
128 |
|
{ |
129 |
|
local magefile="$1" |
130 |
|
local pkg |
131 |
|
local pkgtype |
132 |
|
local tar_opts |
133 |
|
|
134 |
|
pkg="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}" |
135 |
|
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
136 |
|
|
137 |
|
xtitle "[ Unpacking ${pkg} ]" |
138 |
|
|
139 |
|
# abort on virtual pkg |
140 |
|
if [[ ${pkgtype} = virtual ]] |
141 |
|
then |
142 |
|
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
143 |
|
echo " !unpack virtual ${pkg/.${PKGSUFFIX}/} ... " |
144 |
|
continue |
145 |
|
fi |
146 |
|
|
147 |
|
# abort on sources pkg |
148 |
|
if [[ ${pkgtype} = sources ]] |
149 |
|
then |
150 |
|
echo -ne " ${COLBLUE}---${COLDEFAULT}" |
151 |
|
echo " !unpack sources ${pkg/.${PKGSUFFIX}/} ... " |
152 |
|
continue |
153 |
|
fi |
154 |
|
|
155 |
|
# busybox? |
156 |
|
if need_busybox_support tar |
157 |
|
then |
158 |
|
tar_opts="xjf" |
159 |
|
else |
160 |
|
tar_opts="xjmf" |
161 |
|
fi |
162 |
|
|
163 |
|
echo -e " ${COLBLUE}***${COLDEFAULT} unpacking ${pkg} ... " |
164 |
|
tar ${tar_opts} ${PKGDIR}/${pkg} -C ${BUILDDIR} || die "Unpacking package ${pkg}" |
165 |
|
} |
166 |
|
|
167 |
unpack_packages() |
unpack_packages() |
168 |
{ |
{ |
169 |
local list="$@" |
local list="$@" |
170 |
local magefile |
local magefile |
|
local pkg |
|
|
local pkgtype |
|
171 |
local count_current |
local count_current |
172 |
local count_total |
local count_total |
173 |
local tar_opts |
local tar_opts |
180 |
|
|
181 |
for magefile in ${list} |
for magefile in ${list} |
182 |
do |
do |
183 |
pkg="$(get_value_from_magefile PKGNAME ${magefile}).${PKGSUFFIX}" |
unpack_package "${magefile}" |
|
pkgtype="$(get_value_from_magefile PKGTYPE ${magefile})" |
|
|
|
|
184 |
(( 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}" |
|
185 |
done |
done |
186 |
|
|
187 |
# add a crlf for a better view |
# add a crlf for a better view |
1635 |
then |
then |
1636 |
if ! mcheckemptydir ${MAGEDIR} |
if ! mcheckemptydir ${MAGEDIR} |
1637 |
then |
then |
1638 |
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 |
1639 |
fi |
fi |
1640 |
else |
else |
1641 |
rm -rf ${MAGEDIR} |
rm -rf ${MAGEDIR} |
1793 |
then |
then |
1794 |
HIGHEST_MAGEFILE=${magefile} |
HIGHEST_MAGEFILE=${magefile} |
1795 |
#for debug only |
#for debug only |
1796 |
mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}" |
mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}" >&2 |
1797 |
fi |
fi |
1798 |
done |
done |
1799 |
|
|
2719 |
if [[ ${PKGTYPE} != virtual ]] && \ |
if [[ ${PKGTYPE} != virtual ]] && \ |
2720 |
[[ ${PKGTYPE} != sources ]] |
[[ ${PKGTYPE} != sources ]] |
2721 |
then |
then |
2722 |
|
unpack_package "${magefile}" |
2723 |
echo -e " ${COLBLUE}***${COLDEFAULT} merging files into system ... " |
echo -e " ${COLBLUE}***${COLDEFAULT} merging files into system ... " |
2724 |
build_doinstall ${PKGNAME} |
build_doinstall ${PKGNAME} |
2725 |
fi |
fi |
3310 |
do |
do |
3311 |
if [[ -x ${busybox} ]] |
if [[ -x ${busybox} ]] |
3312 |
then |
then |
3313 |
if [[ $(readlink $(which ${cmd})) = ${busybox} ]] |
if [[ $(readlink $(type -P ${cmd})) = ${busybox} ]] |
3314 |
then |
then |
3315 |
# needs busybox support |
# needs busybox support |
3316 |
return 0 |
return 0 |
3373 |
{ |
{ |
3374 |
local feature="$1" |
local feature="$1" |
3375 |
local retval |
local retval |
3376 |
|
|
3377 |
case "${feature}" in |
case "${feature}" in |
3378 |
autosvc|!autosvc) retval=0 ;; |
autosvc|!autosvc) retval=0 ;; |
3379 |
buildlog|!buildlog) retval=0 ;; |
buildlog|!buildlog) retval=0 ;; |
3382 |
compressdoc|!compressdoc) retval=0 ;; |
compressdoc|!compressdoc) retval=0 ;; |
3383 |
debug|!debug) retval=0 ;; |
debug|!debug) retval=0 ;; |
3384 |
distcc|!distcc) retval=0 ;; |
distcc|!distcc) retval=0 ;; |
3385 |
|
icecc|!icecc) retval=0 ;; |
3386 |
kernelsrcunpack|!kernelsrcunpack) retval=0 ;; |
kernelsrcunpack|!kernelsrcunpack) retval=0 ;; |
3387 |
libtool|!libtool) retval=0 ;; |
libtool|!libtool) retval=0 ;; |
3388 |
linuxsymlink|!linuxsymlink) retval=0 ;; |
linuxsymlink|!linuxsymlink) retval=0 ;; |