--- trunk/mage/usr/lib/mage/sourceinstall.sh 2005/06/01 15:56:31 83 +++ trunk/mage/usr/lib/mage/sourceinstall.sh 2005/08/21 23:52:50 202 @@ -1,29 +1,33 @@ #!/bin/bash -#installs from source with given mage-file -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/sourceinstall.sh,v 1.7 2005-06-01 15:56:31 niro Exp $ +# installs from source with given mage-file +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/sourceinstall.sh,v 1.8 2005-08-21 23:52:50 niro Exp $ [ -z "$1" ] && echo "no mage-file given ..." && exit 1 -MAGENAME=$1 +MAGENAME="$1" +MAGE_TARGETS="$2" # -target !! SMSUFFIX=smage2 source /etc/mage.rc -#cuts full pathnames or versioniezed names down to basename +# cuts full pathnames or versionized names down to basename choppkgname(){ - #we want this only if full name was used - if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ] - then - #cuts ARCH and PBUILD - #ARCH comes from /etc/mage.rc - #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g") - #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-r*.::g") - MAGENAME=$(basename ${MAGENAME%-*} .mage) - - #cuts version number - MAGENAME=$(basename ${MAGENAME%-*} .mage) - fi + # we want this only if full name was used + if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ] + then + # cuts ARCH and PBUILD + #ARCH comes from /etc/mage.rc + #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g") + #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-r*.::g") + MAGENAME=$(basename ${MAGENAME%-*} .mage) + + # cuts version number + MAGENAME=$(basename ${MAGENAME%-*} .mage) + + # cuts MAGE_TARGETS + MAGENAME=$(echo ${MAGENAME} | sed -e "s:${MAGE_TARGETS}::g") + fi } choppkgname @@ -31,8 +35,8 @@ #VERSION=$(echo ${VERSION#-*}|sed -e "s:-${ARCH}.*::g") #BUILD=$(basename $1 .mage|sed -e "s:${MAGENAME}::g" -e "s:-${VERSION}::g" -e "s:-${ARCH}-::g") -VERSION=$(basename $1 .mage|sed -e "s:${MAGENAME}::g"|cut -d- -f2) -BUILD=$(basename $1 .mage|sed -e "s:${MAGENAME}::g"|cut -d- -f3) +VERSION=$(basename $1 .mage|sed -e "s:${MAGENAME}${MAGE_TARGETS}::g"|cut -d- -f2) +BUILD=$(basename $1 .mage|sed -e "s:${MAGENAME}${MAGE_TARGETS}::g"|cut -d- -f3) echo M:${MAGENAME} echo V:${VERSION} @@ -52,28 +56,28 @@ exit 1 fi -#starts package build +# starts package build smage2 ${SMAGEFILE} || exit 1 - # sometimes we only want to build a package with its dependencies - # but don't want to install it ... so it's decided here - # with a global variable NOINSTALL=true¦TRUE¦yes¦y - case ${NOINSTALL} in - TRUE|true|yes|y) - echo - echo "NOINSTALL=true; Package will not be installed ..." - echo - sleep 1 - ;; - *) - #installs package - mage install ${MAGENAME} || exit 1 - ;; - esac - - #clean-up builddir - if [ -d ${BUILDDIR} ] - then - rm -rf ${BUILDDIR}/* - fi +# sometimes we only want to build a package with its dependencies +# but don't want to install it ... so it's decided here +# with a global variable NOINSTALL=true¦TRUE¦yes¦y +case ${NOINSTALL} in + TRUE|true|yes|y) + echo + echo "NOINSTALL=true; Package will not be installed ..." + echo + sleep 1 + ;; + *) + # installs package + mage install ${MAGENAME} || exit 1 + ;; +esac + +# clean-up builddir +if [ -d ${BUILDDIR} ] +then + rm -rf ${BUILDDIR}/* +fi