--- trunk/mage/usr/lib/mage/smage2.sh 2007/03/19 19:09:59 439 +++ trunk/mage/usr/lib/mage/smage2.sh 2007/04/23 16:41:44 477 @@ -4,7 +4,7 @@ # needs pkgbuild_dir (mage) # SMAGE2 -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.53 2007-03-19 19:09:59 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.57 2007-04-23 16:41:44 niro Exp $ #01.10.2004 # added ccache support @@ -244,6 +244,54 @@ fi fi done + elif [[ -n $(echo ${my_SRC_URI} | grep 'kde://') ]] + then + for mirror in ${KDE_MIRRORS} + do + my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|kde:/|${mirror}|g")" + + if [[ ${FETCHING} = true ]] + then + echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" + wget \ + --passive-ftp \ + --tries 3 \ + --continue \ + --progress bar \ + --directory-prefix="${my_SOURCEDIR}" \ + "${my_SRC_URI_MIRROR}" + if [[ $? = 0 ]] + then + break + else + continue + fi + fi + done + elif [[ -n $(echo ${my_SRC_URI} | grep 'gnome://') ]] + then + for mirror in ${GNOME_MIRRORS} + do + my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|gnome:/|${mirror}|g")" + + if [[ ${FETCHING} = true ]] + then + echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" + wget \ + --passive-ftp \ + --tries 3 \ + --continue \ + --progress bar \ + --directory-prefix="${my_SOURCEDIR}" \ + "${my_SRC_URI_MIRROR}" + if [[ $? = 0 ]] + then + break + else + continue + fi + fi + done else if [[ ${FETCHING} = true ]] then @@ -399,10 +447,27 @@ { local PATCHOPTS local PATCHFILE + local i PATCHOPTS=$1 PATCHFILE=$2 + if [[ -z $2 ]] + then + PATCHFILE=$1 + + ## patch level auto-detection, get patch level + for ((i=0; i < 10; i++)) + do + patch --dry-run -Np${i} -i ${SOURCEDIR}/${PNAME}/${PATCHFILE} > /dev/null + if [[ $? = 0 ]] + then + PATCHOPTS="-Np${i}" + break + fi + done + fi + echo -e "${COLBLUE}*** ${COLGREEN}Applying patch '${PATCHFILE}'${COLDEFAULT}" patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE} } @@ -461,7 +526,7 @@ { if [ -x /usr/bin/distcc ] then - echo "Using DistCC for compilation ..." + echo -e "${COLBLUE}---${COLGREEN} Using DistCC for compilation ...${COLDEFAULT}" export PATH=/usr/$(mlibdir)/distcc/bin:${PATH} || die "distcc: could not export new $PATH" export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed" @@ -476,7 +541,7 @@ { if [ -x /usr/bin/ccache ] then - echo "Using CCache for compilation ..." + echo -e "${COLBLUE}---${COLGREEN} Using CCache for compilation ...${COLDEFAULT}" export PATH=/usr/$(mlibdir)/ccache/bin:${PATH} || die "ccache: could not export new $PATH" fi } @@ -591,7 +656,7 @@ > ${dest} # header - echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.53 2007-03-19 19:09:59 niro Exp $' >> ${dest} + echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.57 2007-04-23 16:41:44 niro Exp $' >> ${dest} echo >> ${dest} # pgkname and state @@ -699,15 +764,15 @@ # now unset all uneeded vars to be safe # unset PKGNAME <-- don't do that; smage needs this var # unset to be safe (quotes needed !) - for i in ${SPECIAL_FUNCTIONS} - do - unset "${i}" - done +# for i in ${SPECIAL_FUNCTIONS} +# do +# unset "${i}" +# done unset SPECIAL_FUNCTIONS - for i in ${SPECIAL_VARS} - do - unset "${i}" - done +# for i in ${SPECIAL_VARS} +# do +# unset "${i}" +# done unset SPECIAL_VARS unset STATE unset DESCRIPTION @@ -1044,7 +1109,7 @@ then if [[ -d ${SOURCEDIR}/${PNAME} ]] then - echo -e "${COLGREEN}Deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}" + echo -e "${COLBLUE}===${COLGREEN} deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}" rm -rf ${SOURCEDIR}/${PNAME} fi fi