66 |
case ${method} in |
case ${method} in |
67 |
md5) cmd="md5sum" ;; |
md5) cmd="md5sum" ;; |
68 |
sha256) cmd="sha256sum" ;; |
sha256) cmd="sha256sum" ;; |
69 |
*) die "mchecksum(): unkown method '${method}'" ;; |
*) die "mchecksum(): unknown method '${method}'" ;; |
70 |
esac |
esac |
71 |
|
|
72 |
if [[ -d ${rundir} ]] |
if [[ -d ${rundir} ]] |
73 |
then |
then |
74 |
pushd ${rundir} &> /dev/null |
pushd ${rundir} &> /dev/null |
75 |
${cmd} -c ${file} &> /dev/null |
# be verbose here |
76 |
|
${cmd} -c ${file} #&> /dev/null |
77 |
retval="$?" |
retval="$?" |
78 |
popd &> /dev/null |
popd &> /dev/null |
79 |
else |
else |
83 |
return "${retval}" |
return "${retval}" |
84 |
} |
} |
85 |
|
|
86 |
|
mcheckemptydir() |
87 |
|
{ |
88 |
|
local dir="$1" |
89 |
|
local retval=1 |
90 |
|
|
91 |
|
if [[ ! -d ${dir} ]] |
92 |
|
then |
93 |
|
echo "mcheckemptydir(): '${dir}' is not a directory!" |
94 |
|
retval=3 |
95 |
|
else |
96 |
|
shopt -s nullglob dotglob |
97 |
|
files=( ${dir}/* ) |
98 |
|
(( ${#files[*]} )) || retval=0 |
99 |
|
shopt -u nullglob dotglob |
100 |
|
fi |
101 |
|
|
102 |
|
return ${retval} |
103 |
|
} |
104 |
|
|
105 |
unpack_packages() |
unpack_packages() |
106 |
{ |
{ |
107 |
local list="$@" |
local list="$@" |
1421 |
real_uris="$(convertmirrors ${uri})" |
real_uris="$(convertmirrors ${uri})" |
1422 |
|
|
1423 |
# verbose or not |
# verbose or not |
1424 |
mqueryfeature "!verbose" && wget_opts="--quiet" |
mqueryfeature "!verbose" && wget_opts+=" --quiet" |
1425 |
|
|
1426 |
# filter wget options if busybox was found |
# filter wget options if busybox was found |
1427 |
wget_opts="$(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})" |
wget_opts+=" $(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})" |
1428 |
|
|
1429 |
# create outputdir |
# create outputdir |
1430 |
[[ ! -d ${outputdir} ]] && install -d "${outputdir}" |
[[ ! -d ${outputdir} ]] && install -d "${outputdir}" |
1565 |
|
|
1566 |
for mirr in ${MIRRORS} |
for mirr in ${MIRRORS} |
1567 |
do |
do |
1568 |
# path without distribution |
# path without distribution |
1569 |
mymirr="${mirr%/*}" |
# (only for stable|testing|unstable and not DISTROTAG) |
1570 |
|
case ${mirr##*/} in |
1571 |
|
stable|testing|unstable) mymirr="${mirr%/*}";; |
1572 |
|
*) mymirr="${mirr}";; |
1573 |
|
esac |
1574 |
|
|
1575 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1576 |
echo "fetching latest md5 from ${mymirr} ..." |
echo "fetching latest md5 from ${mymirr} ..." |
1603 |
else |
else |
1604 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1605 |
echo -n "checking md5sum... " |
echo -n "checking md5sum... " |
1606 |
( 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" |
1607 |
fi |
fi |
1608 |
|
|
1609 |
if [[ -d ${MAGEDIR} ]] |
if [[ -d ${MAGEDIR} ]] |
1610 |
then |
then |
1611 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1612 |
echo "cleaning old mage-tree ${MAGEDIR}..." |
echo "cleaning old mage-tree ${MAGEDIR}..." |
1613 |
rm -rf ${MAGEDIR} |
# honor mountpoints and empty dirs |
1614 |
|
if mountpoint -q ${MAGEDIR} |
1615 |
|
then |
1616 |
|
if ! mcheckemptydir ${MAGEDIR} |
1617 |
|
then |
1618 |
|
find ${MAGEDIR} -mindepth 1 -maxdepth 1 | xarg --no-run-if-empty rm -r |
1619 |
|
fi |
1620 |
|
else |
1621 |
|
rm -rf ${MAGEDIR} |
1622 |
|
fi |
1623 |
fi |
fi |
1624 |
|
|
1625 |
if need_busybox_support tar |
if need_busybox_support tar |
1678 |
} |
} |
1679 |
|
|
1680 |
|
|
1681 |
# cuts full pathnames or versionized names down to basename |
# unused? |
1682 |
choppkgname() |
# |
1683 |
{ |
# # cuts full pathnames or versionized names down to basename |
1684 |
#we want this only if full name was used |
# choppkgname() |
1685 |
if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ] |
# { |
1686 |
then |
# #we want this only if full name was used |
1687 |
#cuts ARCH and PBUILD |
# if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ] |
1688 |
#ARCH comes from ${MAGERC} |
# then |
1689 |
MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g") |
# #cuts ARCH and PBUILD |
1690 |
|
# #ARCH comes from ${MAGERC} |
1691 |
|
# MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}$(print_distrotag)-r*.::g") |
1692 |
|
# |
1693 |
|
# #cuts version number |
1694 |
|
# MAGENAME=$(basename ${MAGENAME%-*} .mage) |
1695 |
|
# fi |
1696 |
|
# } |
1697 |
|
|
|
#cuts version number |
|
|
MAGENAME=$(basename ${MAGENAME%-*} .mage) |
|
|
fi |
|
|
} |
|
1698 |
|
|
1699 |
# get_categorie $PNAME, returns CATEGORIE |
# get_categorie $PNAME, returns CATEGORIE |
1700 |
# $1=pname |
# $1=pname |
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} :(" |
3035 |
local state |
local state |
3036 |
local descriptiom |
local descriptiom |
3037 |
local homepage |
local homepage |
3038 |
|
local license |
3039 |
local i |
local i |
3040 |
local all_installed |
local all_installed |
3041 |
local ipver |
local ipver |
3072 |
state="$(get_value_from_magefile STATE ${magefile})" |
state="$(get_value_from_magefile STATE ${magefile})" |
3073 |
description="$(get_value_from_magefile DESCRIPTION ${magefile})" |
description="$(get_value_from_magefile DESCRIPTION ${magefile})" |
3074 |
homepage="$(get_value_from_magefile HOMEPAGE ${magefile})" |
homepage="$(get_value_from_magefile HOMEPAGE ${magefile})" |
3075 |
|
license="$(get_value_from_magefile LICENSE ${magefile})" |
3076 |
|
|
3077 |
# all installed |
# all installed |
3078 |
for i in $(get_uninstall_candidates --pname ${pname} --pcat ${pcat}) |
for i in $(get_uninstall_candidates --pname ${pname} --pcat ${pcat}) |
3079 |
do |
do |
3080 |
ipver="$(magename2pver ${i})" |
ipver="$(magename2pver ${i})" |
3081 |
ipbuild="$(magename2pbuild ${i})" |
ipbuild="$(magename2pbuild ${i})" |
3082 |
|
|
3083 |
if [[ -z ${all_installed} ]] |
if [[ -z ${all_installed} ]] |
3084 |
then |
then |
3085 |
all_installed="${ipver}-${ipbuild}" |
all_installed="${ipver}-${ipbuild}" |
3088 |
fi |
fi |
3089 |
done |
done |
3090 |
[[ -z ${all_installed} ]] && all_installed="none" |
[[ -z ${all_installed} ]] && all_installed="none" |
3091 |
|
|
3092 |
case ${state} in |
case ${state} in |
3093 |
stable) state=${COLGREEN}"[s] ";; |
stable) state=${COLGREEN}"[s] ";; |
3094 |
testing) state=${COLYELLOW}"[t] ";; |
testing) state=${COLYELLOW}"[t] ";; |
3133 |
echo " Installed versions: ${all_installed}" |
echo " Installed versions: ${all_installed}" |
3134 |
echo " Description: ${description}" |
echo " Description: ${description}" |
3135 |
echo " Homepage: ${homepage}" |
echo " Homepage: ${homepage}" |
3136 |
|
if [[ ! -z ${license} ]] |
3137 |
|
then |
3138 |
|
echo " License: ${license}" |
3139 |
|
fi |
3140 |
echo " Depends: ${deps}" |
echo " Depends: ${deps}" |
3141 |
echo " SDepends: ${sdeps}" |
echo " SDepends: ${sdeps}" |
3142 |
echo |
echo |
3327 |
ccache|!ccache) retval=0 ;; |
ccache|!ccache) retval=0 ;; |
3328 |
check|!check) retval=0 ;; |
check|!check) retval=0 ;; |
3329 |
compressdoc|!compressdoc) retval=0 ;; |
compressdoc|!compressdoc) retval=0 ;; |
3330 |
|
debug|!debug) retval=0 ;; |
3331 |
distcc|!distcc) retval=0 ;; |
distcc|!distcc) retval=0 ;; |
3332 |
kernelsrcunpack|!kernelsrcunpack) retval=0 ;; |
kernelsrcunpack|!kernelsrcunpack) retval=0 ;; |
3333 |
libtool|!libtool) retval=0 ;; |
libtool|!libtool) retval=0 ;; |
3334 |
linuxsymlink|!linuxsymlink) retval=0 ;; |
linuxsymlink|!linuxsymlink) retval=0 ;; |
3335 |
pkgbuild|!pkgbuild) retval=0 ;; |
pkgbuild|!pkgbuild) retval=0 ;; |
3336 |
|
pkgdistrotag|!pkgdistrotag) retval=0 ;; |
3337 |
purge|!purge) retval=0 ;; |
purge|!purge) retval=0 ;; |
3338 |
qalint|!qalint) retval=0 ;; |
qalint|!qalint) retval=0 ;; |
3339 |
regentree|!regentree) retval=0 ;; |
regentree|!regentree) retval=0 ;; |
3340 |
resume|!resume) retval=0 ;; |
resume|!resume) retval=0 ;; |
|
stepbystep|!stepbystep) retval=0 ;; |
|
3341 |
srcpkgbuild|!srcpkgbuild) retval=0 ;; |
srcpkgbuild|!srcpkgbuild) retval=0 ;; |
3342 |
srcpkgtarball|!srcpkgtarball) retval=0 ;; |
srcpkgtarball|!srcpkgtarball) retval=0 ;; |
3343 |
|
static|!static) retval=0 ;; |
3344 |
|
stepbystep|!stepbystep) retval=0 ;; |
3345 |
strip|!strip) retval=0 ;; |
strip|!strip) retval=0 ;; |
3346 |
|
verbose|!verbose) retval=0 ;; |
3347 |
*) retval=1 ;; |
*) retval=1 ;; |
3348 |
esac |
esac |
3349 |
|
|
3372 |
|
|
3373 |
if ! known_mage_feature "${feature}" |
if ! known_mage_feature "${feature}" |
3374 |
then |
then |
3375 |
[[ ${FVERBOSE} = off ]] || echo "unkown feature ${feature}, ignoring it" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLRED}Unknown feature '${feature}', ignoring it${COLDEFAULT}" |
3376 |
return 3 |
return 3 |
3377 |
fi |
fi |
3378 |
|
|
3425 |
fi |
fi |
3426 |
done |
done |
3427 |
else |
else |
3428 |
|
[[ ${FVERBOSE} = off ]] || echo -e "${COLRED}Unknown feature '${feature}', ignoring it${COLDEFAULT}" |
3429 |
retval=3 |
retval=3 |
3430 |
fi |
fi |
3431 |
|
|