1365 |
done |
done |
1366 |
|
|
1367 |
# clean up backup files (foo~) |
# clean up backup files (foo~) |
1368 |
find ${MAGEDIR} -name *~ -exec rm '{}' ';' |
find ${MAGEDIR} -name \*~ -exec rm '{}' ';' |
1369 |
|
|
1370 |
# check if a newer mage version is available |
# check if a newer mage version is available |
1371 |
is_newer_mage_version_available |
is_newer_mage_version_available |
1379 |
local mirr mymirr |
local mirr mymirr |
1380 |
local opt |
local opt |
1381 |
local tar_opts |
local tar_opts |
1382 |
|
local wget_opts |
1383 |
|
|
1384 |
# try to get the md5 marked as latest on the server |
# try to get the md5 marked as latest on the server |
1385 |
latest_md5="mage-latest.md5" |
latest_md5="mage-latest.md5" |
1387 |
# try to get the tarball marked as latest on the server |
# try to get the tarball marked as latest on the server |
1388 |
latest_tarball="mage-latest.tar.bz2" |
latest_tarball="mage-latest.tar.bz2" |
1389 |
|
|
1390 |
|
# filter wget command if busybox was found |
1391 |
|
wget_opts="$(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})" |
1392 |
|
|
1393 |
for mirr in ${MIRRORS} |
for mirr in ${MIRRORS} |
1394 |
do |
do |
1395 |
# path without distribution |
# path without distribution |
1399 |
echo "fetching latest md5 from ${mymirr} ..." |
echo "fetching latest md5 from ${mymirr} ..." |
1400 |
[[ ${VERBOSE} = off ]] && opt="--quiet" |
[[ ${VERBOSE} = off ]] && opt="--quiet" |
1401 |
wget \ |
wget \ |
1402 |
${WGET_FETCH_OPTIONS} \ |
${wget_opts} \ |
1403 |
--directory-prefix=${temp} \ |
--directory-prefix=${temp} \ |
1404 |
${opt} ${mymirr}/rsync/tarballs/${latest_md5} |
${opt} ${mymirr}/rsync/tarballs/${latest_md5} |
1405 |
|
|
1406 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1407 |
echo "fetching latest tarball from ${mymirr} ..." |
echo "fetching latest tarball from ${mymirr} ..." |
1408 |
wget \ |
wget \ |
1409 |
${WGET_FETCH_OPTIONS} \ |
${wget_opts} \ |
1410 |
--directory-prefix=${temp} \ |
--directory-prefix=${temp} \ |
1411 |
${opt} ${mymirr}/rsync/tarballs/${latest_tarball} |
${opt} ${mymirr}/rsync/tarballs/${latest_tarball} |
1412 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
1575 |
local magefile |
local magefile |
1576 |
|
|
1577 |
# do not list the content of a directory, only the name (-d) |
# do not list the content of a directory, only the name (-d) |
1578 |
for magefile in $(ls --format=single-column -v -d ${MAGEDIR}/${PCAT}/${PNAME}/*) |
for magefile in $(ls --format=single-column -v -d ${MAGEDIR}/${PCAT}/${PNAME}/* 2> /dev/null) |
1579 |
do |
do |
1580 |
[[ -z ${magefile} ]] && continue |
[[ -z ${magefile} ]] && continue |
1581 |
# we exclude subdirs (for stuff like a md5sum dir) |
# we exclude subdirs (for stuff like a md5sum dir) |
3089 |
then |
then |
3090 |
# needs busybox support |
# needs busybox support |
3091 |
return 0 |
return 0 |
|
else |
|
|
# no busybox |
|
|
return 1 |
|
3092 |
fi |
fi |
3093 |
fi |
fi |
3094 |
|
|
3095 |
|
# no busybox |
3096 |
|
return 1 |
3097 |
} |
} |
3098 |
|
|
3099 |
# busybox_filter_wget_options ${wget_opts} |
# busybox_filter_wget_options ${wget_opts} |