1179 |
echo -e " fetching (${count_current}/${count_total}): ${pkg} ... " |
echo -e " fetching (${count_current}/${count_total}): ${pkg} ... " |
1180 |
[[ ${VERBOSE} = off ]] && opt="--quiet" |
[[ ${VERBOSE} = off ]] && opt="--quiet" |
1181 |
wget \ |
wget \ |
1182 |
--passive-ftp \ |
${WGET_FETCH_OPTIONS} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
1183 |
--directory-prefix=${PKGDIR} \ |
--directory-prefix=${PKGDIR} \ |
1184 |
${opt} ${mirr}/${PACKAGES_SERVER_PATH}/${pkg} |
${opt} ${mirr}/${PACKAGES_SERVER_PATH}/${pkg} |
1185 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
1222 |
# clean up backup files (foo~) |
# clean up backup files (foo~) |
1223 |
find ${MAGEDIR} -name *~ -exec rm '{}' ';' |
find ${MAGEDIR} -name *~ -exec rm '{}' ';' |
1224 |
|
|
1225 |
# check if an newer mage version is available |
# check if a newer mage version is available |
1226 |
is_newer_mage_version_available |
is_newer_mage_version_available |
1227 |
} |
} |
1228 |
|
|
1229 |
syncmage_tarball() |
syncmage_tarball() |
1230 |
{ |
{ |
1231 |
local latest_tarball |
local latest_tarball |
1232 |
|
local latest_md5 |
1233 |
local temp="$(mktemp -d)" |
local temp="$(mktemp -d)" |
1234 |
local mirr mymirr |
local mirr mymirr |
1235 |
|
|
1236 |
|
# try to get the md5 marked as latest on the server |
1237 |
|
latest_md5="mage-latest.md5" |
1238 |
|
|
1239 |
# try to get the tarball marked as latest on the server |
# try to get the tarball marked as latest on the server |
1240 |
latest_tarball="mage-latest.tar.bz2" |
latest_tarball="mage-latest.tar.bz2" |
1241 |
|
|
1245 |
mymirr="${mirr%/*}" |
mymirr="${mirr%/*}" |
1246 |
|
|
1247 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1248 |
echo "fetching latest tarball from ${mymirr} ..." |
echo "fetching latest md5 from ${mymirr} ..." |
1249 |
|
wget \ |
1250 |
|
${WGET_FETCH_OPTIONS} \ |
1251 |
|
--directory-prefix=${temp} \ |
1252 |
|
${mymirr}/rsync/tarballs/${latest_md5} |
1253 |
|
|
1254 |
|
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1255 |
|
echo "fetching latest tarball from ${mymirr} ..." |
1256 |
wget \ |
wget \ |
1257 |
--passive-ftp \ |
${WGET_FETCH_OPTIONS} \ |
|
--tries 3 \ |
|
|
--continue \ |
|
|
--progress bar \ |
|
1258 |
--directory-prefix=${temp} \ |
--directory-prefix=${temp} \ |
1259 |
${mymirr}/rsync/tarballs/${latest_tarball} |
${mymirr}/rsync/tarballs/${latest_tarball} |
1260 |
if [[ $? = 0 ]] |
if [[ $? = 0 ]] |
1267 |
|
|
1268 |
if [[ -f ${temp}/${latest_tarball} ]] |
if [[ -f ${temp}/${latest_tarball} ]] |
1269 |
then |
then |
1270 |
|
# check md5 |
1271 |
|
if [[ ! -f ${temp}/${latest_md5} ]] |
1272 |
|
then |
1273 |
|
die "md5 is missing ... aborting" |
1274 |
|
else |
1275 |
|
( cd ${temp}; md5sum --check ${lastest_md5} ) || die "md5 for ${lastest_tarball} failed" |
1276 |
|
fi |
1277 |
|
|
1278 |
if [[ -d ${MAGEDIR} ]] |
if [[ -d ${MAGEDIR} ]] |
1279 |
then |
then |
1280 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1290 |
if [[ -d ${temp} ]] |
if [[ -d ${temp} ]] |
1291 |
then |
then |
1292 |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
echo -ne "${COLBLUE} --- ${COLDEFAULT}" |
1293 |
echo "clenaing temp-files ..." |
echo "cleaning temp-files ..." |
1294 |
rm -rf ${temp} |
rm -rf ${temp} |
1295 |
fi |
fi |
1296 |
|
|
1297 |
|
# check if a newer mage version is available |
1298 |
|
is_newer_mage_version_available |
1299 |
else |
else |
1300 |
die "Could not fetch the latest tarball ... aborting" |
die "Could not fetch the latest tarball ... aborting" |
1301 |
fi |
fi |
2175 |
local SDEPEND |
local SDEPEND |
2176 |
local PROVIDE |
local PROVIDE |
2177 |
local PKGTYPE |
local PKGTYPE |
2178 |
|
local MAGE_TARGETS |
2179 |
|
local SPLIT_PACKAGE_BASE |
2180 |
local preinstall |
local preinstall |
2181 |
local postinstall |
local postinstall |
2182 |
local preremove |
local preremove |
2297 |
echo B:${pbuild} |
echo B:${pbuild} |
2298 |
fi |
fi |
2299 |
|
|
2300 |
if [[ -z ${MAGE_TARGETS} ]] |
if [[ -n ${MAGE_TARGETS} ]] |
2301 |
then |
then |
2302 |
# basic svn compat |
# basic svn compat |
2303 |
if [[ -d ${SMAGESCRIPTSDIR}/trunk ]] |
if [[ -d ${SMAGESCRIPTSDIR}/trunk ]] |
2304 |
then |
then |
2305 |
for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2 |
for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2 |
2306 |
do |
do |
2307 |
smage2file="${i}" |
smage2file="${i}" |
2308 |
done |
done |
2309 |
else |
else |
2310 |
smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2 |
smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2 |
2311 |
fi |
fi |
2312 |
|
|
2313 |
|
elif [[ -n ${SPLIT_PACKAGE_BASE} ]] |
2314 |
|
then |
2315 |
|
# basic svn compat |
2316 |
|
if [[ -d ${SMAGESCRIPTSDIR}/trunk ]] |
2317 |
|
then |
2318 |
|
for i in ${SMAGESCRIPTSDIR}/trunk/*/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2 |
2319 |
|
do |
2320 |
|
smage2file="${i}" |
2321 |
|
done |
2322 |
|
else |
2323 |
|
smage2file=${SMAGESCRIPTSDIR}/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2 |
2324 |
|
fi |
2325 |
|
|
2326 |
else |
else |
2327 |
# basic svn compat |
# basic svn compat |
2328 |
if [[ -d ${SMAGESCRIPTSDIR}/trunk ]] |
if [[ -d ${SMAGESCRIPTSDIR}/trunk ]] |
2329 |
then |
then |
2330 |
for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2 |
for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2 |
2331 |
do |
do |
2332 |
smage2file="${i}" |
smage2file="${i}" |
2333 |
done |
done |
2334 |
else |
else |
2335 |
smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2 |
smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2 |
2336 |
fi |
fi |
2337 |
fi |
fi |
2338 |
|
|
2339 |
if [ -f "${smage2file}" ] |
if [ -f "${smage2file}" ] |
2340 |
then |
then |
2341 |
echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... " |
echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... " |