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} ]] |
82 |
return "${retval}" |
return "${retval}" |
83 |
} |
} |
84 |
|
|
85 |
|
mcheckemptydir() |
86 |
|
{ |
87 |
|
local dir="$1" |
88 |
|
local retval=1 |
89 |
|
|
90 |
|
if [[ ! -d ${dir} ]] |
91 |
|
then |
92 |
|
echo "mcheckemptydir(): '${dir}' is not a directory!" |
93 |
|
retval=3 |
94 |
|
else |
95 |
|
shopt -s nullglob dotglob |
96 |
|
files=( ${dir}/* ) |
97 |
|
(( ${#files[*]} )) || retval=0 |
98 |
|
shopt -u nullglob dotglob |
99 |
|
fi |
100 |
|
|
101 |
|
return ${retval} |
102 |
|
} |
103 |
|
|
104 |
unpack_packages() |
unpack_packages() |
105 |
{ |
{ |
106 |
local list="$@" |
local list="$@" |
1420 |
real_uris="$(convertmirrors ${uri})" |
real_uris="$(convertmirrors ${uri})" |
1421 |
|
|
1422 |
# verbose or not |
# verbose or not |
1423 |
mqueryfeature "!verbose" && wget_opts="--quiet" |
mqueryfeature "!verbose" && wget_opts+=" --quiet" |
1424 |
|
|
1425 |
# filter wget options if busybox was found |
# filter wget options if busybox was found |
1426 |
wget_opts="$(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})" |
wget_opts+=" $(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})" |
1427 |
|
|
1428 |
# create outputdir |
# create outputdir |
1429 |
[[ ! -d ${outputdir} ]] && install -d "${outputdir}" |
[[ ! -d ${outputdir} ]] && install -d "${outputdir}" |
1598 |
else |
else |
1599 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1600 |
echo -n "checking md5sum... " |
echo -n "checking md5sum... " |
1601 |
( 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" |
1602 |
fi |
fi |
1603 |
|
|
1604 |
if [[ -d ${MAGEDIR} ]] |
if [[ -d ${MAGEDIR} ]] |
1664 |
} |
} |
1665 |
|
|
1666 |
|
|
1667 |
# cuts full pathnames or versionized names down to basename |
# unused? |
1668 |
choppkgname() |
# |
1669 |
{ |
# # cuts full pathnames or versionized names down to basename |
1670 |
#we want this only if full name was used |
# choppkgname() |
1671 |
if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ] |
# { |
1672 |
then |
# #we want this only if full name was used |
1673 |
#cuts ARCH and PBUILD |
# if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ] |
1674 |
#ARCH comes from ${MAGERC} |
# then |
1675 |
MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g") |
# #cuts ARCH and PBUILD |
1676 |
|
# #ARCH comes from ${MAGERC} |
1677 |
|
# MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}$(print_distrotag)-r*.::g") |
1678 |
|
# |
1679 |
|
# #cuts version number |
1680 |
|
# MAGENAME=$(basename ${MAGENAME%-*} .mage) |
1681 |
|
# fi |
1682 |
|
# } |
1683 |
|
|
|
#cuts version number |
|
|
MAGENAME=$(basename ${MAGENAME%-*} .mage) |
|
|
fi |
|
|
} |
|
1684 |
|
|
1685 |
# get_categorie $PNAME, returns CATEGORIE |
# get_categorie $PNAME, returns CATEGORIE |
1686 |
# $1=pname |
# $1=pname |
2781 |
then |
then |
2782 |
echo -ne "${COLBLUE} *** ${COLDEFAULT}" |
echo -ne "${COLBLUE} *** ${COLDEFAULT}" |
2783 |
echo -ne "checking md5sum (${count_current}/${count_total}): " |
echo -ne "checking md5sum (${count_current}/${count_total}): " |
2784 |
( cd ${PKGDIR}; md5sum -c ${md5file}) || die "md5 for ${pkgfile} failed" |
mchecksum --rundir "${PKGDIR}" --file "${md5file}" --method md5 || die "md5 for ${pkgfile} failed" |
2785 |
else |
else |
2786 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
2787 |
echo -e "!! no md5sum file found for ${pkgfile} :(" |
echo -e "!! no md5sum file found for ${pkgfile} :(" |
3021 |
local state |
local state |
3022 |
local descriptiom |
local descriptiom |
3023 |
local homepage |
local homepage |
3024 |
|
local license |
3025 |
local i |
local i |
3026 |
local all_installed |
local all_installed |
3027 |
local ipver |
local ipver |
3058 |
state="$(get_value_from_magefile STATE ${magefile})" |
state="$(get_value_from_magefile STATE ${magefile})" |
3059 |
description="$(get_value_from_magefile DESCRIPTION ${magefile})" |
description="$(get_value_from_magefile DESCRIPTION ${magefile})" |
3060 |
homepage="$(get_value_from_magefile HOMEPAGE ${magefile})" |
homepage="$(get_value_from_magefile HOMEPAGE ${magefile})" |
3061 |
|
license="$(get_value_from_magefile LICENSE ${magefile})" |
3062 |
|
|
3063 |
# all installed |
# all installed |
3064 |
for i in $(get_uninstall_candidates --pname ${pname} --pcat ${pcat}) |
for i in $(get_uninstall_candidates --pname ${pname} --pcat ${pcat}) |
3065 |
do |
do |
3066 |
ipver="$(magename2pver ${i})" |
ipver="$(magename2pver ${i})" |
3067 |
ipbuild="$(magename2pbuild ${i})" |
ipbuild="$(magename2pbuild ${i})" |
3068 |
|
|
3069 |
if [[ -z ${all_installed} ]] |
if [[ -z ${all_installed} ]] |
3070 |
then |
then |
3071 |
all_installed="${ipver}-${ipbuild}" |
all_installed="${ipver}-${ipbuild}" |
3074 |
fi |
fi |
3075 |
done |
done |
3076 |
[[ -z ${all_installed} ]] && all_installed="none" |
[[ -z ${all_installed} ]] && all_installed="none" |
3077 |
|
|
3078 |
case ${state} in |
case ${state} in |
3079 |
stable) state=${COLGREEN}"[s] ";; |
stable) state=${COLGREEN}"[s] ";; |
3080 |
testing) state=${COLYELLOW}"[t] ";; |
testing) state=${COLYELLOW}"[t] ";; |
3119 |
echo " Installed versions: ${all_installed}" |
echo " Installed versions: ${all_installed}" |
3120 |
echo " Description: ${description}" |
echo " Description: ${description}" |
3121 |
echo " Homepage: ${homepage}" |
echo " Homepage: ${homepage}" |
3122 |
|
if [[ ! -z ${license} ]] |
3123 |
|
then |
3124 |
|
echo " License: ${license}" |
3125 |
|
fi |
3126 |
echo " Depends: ${deps}" |
echo " Depends: ${deps}" |
3127 |
echo " SDepends: ${sdeps}" |
echo " SDepends: ${sdeps}" |
3128 |
echo |
echo |
3313 |
ccache|!ccache) retval=0 ;; |
ccache|!ccache) retval=0 ;; |
3314 |
check|!check) retval=0 ;; |
check|!check) retval=0 ;; |
3315 |
compressdoc|!compressdoc) retval=0 ;; |
compressdoc|!compressdoc) retval=0 ;; |
3316 |
|
debug|!debug) retval=0 ;; |
3317 |
distcc|!distcc) retval=0 ;; |
distcc|!distcc) retval=0 ;; |
3318 |
kernelsrcunpack|!kernelsrcunpack) retval=0 ;; |
kernelsrcunpack|!kernelsrcunpack) retval=0 ;; |
3319 |
libtool|!libtool) retval=0 ;; |
libtool|!libtool) retval=0 ;; |
3320 |
linuxsymlink|!linuxsymlink) retval=0 ;; |
linuxsymlink|!linuxsymlink) retval=0 ;; |
3321 |
pkgbuild|!pkgbuild) retval=0 ;; |
pkgbuild|!pkgbuild) retval=0 ;; |
3322 |
|
pkgdistrotag|!pkgdistrotag) retval=0 ;; |
3323 |
purge|!purge) retval=0 ;; |
purge|!purge) retval=0 ;; |
3324 |
qalint|!qalint) retval=0 ;; |
qalint|!qalint) retval=0 ;; |
3325 |
regentree|!regentree) retval=0 ;; |
regentree|!regentree) retval=0 ;; |
3326 |
stepbystep|!stepbystep) retval=0 ;; |
resume|!resume) retval=0 ;; |
3327 |
srcpkgbuild|!srcpkgbuild) retval=0 ;; |
srcpkgbuild|!srcpkgbuild) retval=0 ;; |
3328 |
srcpkgtarball|!srcpkgtarball) retval=0 ;; |
srcpkgtarball|!srcpkgtarball) retval=0 ;; |
3329 |
|
static|!static) retval=0 ;; |
3330 |
|
stepbystep|!stepbystep) retval=0 ;; |
3331 |
strip|!strip) retval=0 ;; |
strip|!strip) retval=0 ;; |
3332 |
|
verbose|!verbose) retval=0 ;; |
3333 |
*) retval=1 ;; |
*) retval=1 ;; |
3334 |
esac |
esac |
3335 |
|
|
3338 |
|
|
3339 |
load_mage_features() |
load_mage_features() |
3340 |
{ |
{ |
|
echo -en "${COLBLUE}---${COLGREEN} Loading mage-features... ${COLDEFAULT}" |
|
3341 |
for i in ${MAGE_FEATURES_GLOBAL[*]} ${MAGE_FEATURES[*]} |
for i in ${MAGE_FEATURES_GLOBAL[*]} ${MAGE_FEATURES[*]} |
3342 |
do |
do |
3343 |
FVERBOSE=off msetfeature ${i} |
FVERBOSE=off msetfeature ${i} |
3344 |
done |
done |
|
|
|
|
echo -e "${COLGREEN}done${COLDEFAULT}" |
|
3345 |
} |
} |
3346 |
|
|
3347 |
msetfeature() |
msetfeature() |
3358 |
|
|
3359 |
if ! known_mage_feature "${feature}" |
if ! known_mage_feature "${feature}" |
3360 |
then |
then |
3361 |
[[ ${FVERBOSE} = off ]] || echo "unkown feature ${feature}, ignoring it" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLRED}Unknown feature '${feature}', ignoring it${COLDEFAULT}" |
3362 |
return 3 |
return 3 |
3363 |
fi |
fi |
3364 |
|
|
3366 |
do |
do |
3367 |
if [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature} ]] |
if [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature} ]] |
3368 |
then |
then |
3369 |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' already enabled" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' already enabled${COLDEFAULT}" |
3370 |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
3371 |
found=1 |
found=1 |
3372 |
elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = !${feature} ]] |
elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = !${feature} ]] |
3373 |
then |
then |
3374 |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' currently disabled, enabling it!" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' currently disabled, enabling it!${COLDEFAULT}" |
3375 |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
3376 |
found=1 |
found=1 |
3377 |
elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature//!} ]] |
elif [[ ${MAGE_FEATURES_CURRENT[${i}]} = ${feature//!} ]] |
3378 |
then |
then |
3379 |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature//!}' currently enabled, disabling it!" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature//!}' currently enabled, disabling it!${COLDEFAULT}" |
3380 |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
MAGE_FEATURES_CURRENT[${i}]="${feature}" |
3381 |
found=1 |
found=1 |
3382 |
fi |
fi |
3386 |
# it was not declared. in this case enable it |
# it was not declared. in this case enable it |
3387 |
if [[ ${found} = 0 ]] |
if [[ ${found} = 0 ]] |
3388 |
then |
then |
3389 |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' was not declared, enabling it!" |
[[ ${FVERBOSE} = off ]] || echo -e "${COLBLUE}---${COLGREEN} Feature '${feature}' was not declared, enabling it!${COLDEFAULT}" |
3390 |
MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" ) |
MAGE_FEATURES_CURRENT=( ${MAGE_FEATURES_CURRENT[*]} "${feature}" ) |
3391 |
fi |
fi |
3392 |
|
|
3411 |
fi |
fi |
3412 |
done |
done |
3413 |
else |
else |
3414 |
|
[[ ${FVERBOSE} = off ]] || echo -e "${COLRED}Unknown feature '${feature}', ignoring it${COLDEFAULT}" |
3415 |
retval=3 |
retval=3 |
3416 |
fi |
fi |
3417 |
|
|