1359 |
|
|
1360 |
# check known uri schemes |
# check known uri schemes |
1361 |
case ${uri} in |
case ${uri} in |
1362 |
http://*|https://*|ftp://*|ftps://*) mirrors="" ;; |
http://*|https://*|ftp://*|ftps://*|file://*) mirrors="" ;; |
1363 |
mirror://*) mirrors="${MIRRORS}"; scheme="mirror://"; addon="/sources" ;; |
mirror://*) mirrors="${MIRRORS}"; scheme="mirror://"; addon="/sources" ;; |
1364 |
package://*) mirrors="${MIRRORS}"; scheme="package://"; addon="/${PACKAGES_SERVER_PATH}" ;; |
package://*) mirrors="${MIRRORS}"; scheme="package://"; addon="/${PACKAGES_SERVER_PATH}" ;; |
1365 |
gnu://*) mirrors="${GNU_MIRRORS}"; scheme="gnu://" ;; |
gnu://*) mirrors="${GNU_MIRRORS}"; scheme="gnu://" ;; |
1426 |
# get the name of the output file |
# get the name of the output file |
1427 |
outputfile="${mirror##*/}" |
outputfile="${mirror##*/}" |
1428 |
|
|
1429 |
wget ${wget_opts} --output-document="${outputdir}/${outputfile}" "${mirror}" |
case ${mirror} in |
1430 |
retval="$?" |
file://*) |
1431 |
|
cp -v "${mirror//file:\/\/}" "${outputdir}/${outputfile}" |
1432 |
|
retval="$?" |
1433 |
|
;; |
1434 |
|
*) |
1435 |
|
wget ${wget_opts} --output-document="${outputdir}/${outputfile}" "${mirror}" |
1436 |
|
retval="$?" |
1437 |
|
;; |
1438 |
|
esac |
1439 |
|
|
1440 |
if [[ ${retval} = 0 ]] |
if [[ ${retval} = 0 ]] |
1441 |
then |
then |
1442 |
break |
break |
1722 |
echo "${categorie}" |
echo "${categorie}" |
1723 |
} |
} |
1724 |
|
|
|
# check_stable_package /path/to/foo.mage |
|
|
# returns 0=stable 1=unstable |
|
|
check_stable_package() |
|
|
{ |
|
|
# first check if this magefile is not blacklisted |
|
|
blacklisted "$1" || return 1 |
|
|
|
|
|
local STATE |
|
|
STATE="$(get_value_from_magefile STATE "$1")" |
|
|
|
|
|
# state testing |
|
|
if [[ ${USE_TESTING} = true ]] || [[ ${MAGE_DISTRIBUTION} = testing ]] |
|
|
then |
|
|
case ${STATE} in |
|
|
testing|stable) return 0 ;; |
|
|
*) return 1 ;; |
|
|
esac |
|
|
fi |
|
|
|
|
|
# state unstable |
|
|
if [[ ${USE_UNSTABLE} = true ]] || [[ ${MAGE_DISTRIBUTION} = unstable ]] |
|
|
then |
|
|
case ${STATE} in |
|
|
unstable|testing|stable) return 0 ;; |
|
|
*) return 1 ;; |
|
|
esac |
|
|
fi |
|
|
|
|
|
# no use_state given = stable |
|
|
case ${STATE} in |
|
|
stable) return 0 ;; |
|
|
*) return 1 ;; |
|
|
esac |
|
|
} |
|
|
|
|
|
|
|
1725 |
# get_highest_magefile ${PCAT} ${PNAME} |
# get_highest_magefile ${PCAT} ${PNAME} |
1726 |
# fake at moment returns only stable pkgs (must set to be one) |
# returns $HIGHEST_MAGEFILE |
|
# return $HIGHEST_MAGEFILE |
|
1727 |
get_highest_magefile() |
get_highest_magefile() |
1728 |
{ |
{ |
1729 |
local HIGHEST_MAGEFILE |
local pcat="$1" |
1730 |
local PCAT="$1" |
local pname="$2" |
|
local PNAME="$2" |
|
|
local magefile |
|
1731 |
|
|
1732 |
# do not list the content of a directory, only the name (-d) |
${MLIBDIR}/highest_magefile ${MAGEDIR}/${pcat}/${pname} |
|
for magefile in $(ls --format=single-column -v -d ${MAGEDIR}/${PCAT}/${PNAME}/* 2> /dev/null) |
|
|
do |
|
|
[[ -z ${magefile} ]] && continue |
|
|
# we exclude subdirs (for stuff like a md5sum dir) |
|
|
[[ -d ${magefile} ]] && continue |
|
|
if check_stable_package ${magefile} |
|
|
then |
|
|
HIGHEST_MAGEFILE=${magefile} |
|
|
#for debug only |
|
|
mqueryfeature "debug" && echo "HIGHEST_MAGEFILE=${HIGHEST_MAGEFILE}" >&2 |
|
|
fi |
|
|
done |
|
|
|
|
|
echo "${HIGHEST_MAGEFILE}" |
|
1733 |
return 0 |
return 0 |
1734 |
} |
} |
1735 |
|
|
|
|
|
1736 |
################################################### |
################################################### |
1737 |
# function is_config_protected # |
# function is_config_protected # |
1738 |
# is_config_protected /path/to/file # |
# is_config_protected /path/to/file # |