--- trunk/pkgtools/add2cvs.sh 2008/04/13 20:43:16 718 +++ trunk/pkgtools/add2cvs.sh 2008/04/24 10:27:27 721 @@ -13,6 +13,8 @@ CURARCH=i686 #CURARCH=x86_64 +BUILDROOT=/mnt/BUILDROOT + SMAGEDIR=$(dirname ${SMAGEFILE}) MD5DIR=${SMAGEDIR}/md5 MD5NAME=$(basename $1 .smage2).md5 @@ -43,11 +45,11 @@ } CURPCATEGORIE=$(get_value_from_file PCATEGORIE ${SMAGEFILE}) -INSTALLDB_BUILDROOT=$(get_value_from_file INSTALLDB /mnt/BUILDROOT/etc/mage.rc) +INSTALLDB_BUILDROOT=$(get_value_from_file INSTALLDB ${BUILDROOT}/etc/mage.rc) -if [[ -d /mnt/BUILDROOT/${INSTALLDB_BUILDROOT}/${CURPCATEGORIE}/${CURPNAME}-${CURPVER}-${CURPBUILD} ]] +if [[ -d ${BUILDROOT}/${INSTALLDB_BUILDROOT}/${CURPCATEGORIE}/${CURPNAME}-${CURPVER}-${CURPBUILD} ]] then - echo "Package '${CURPCATEGORIE}/${CURPNAME}-${CURPVER}-${CURPBUILD}' already installed in /mnt/BUILDROOT. Aborting!" + echo "Package '${CURPCATEGORIE}/${CURPNAME}-${CURPVER}-${CURPBUILD}' already installed in ${BUILDROOT}. Aborting!" exit 1 fi @@ -70,57 +72,57 @@ fi sudo -s << EOF -:> /mnt/BUILDROOT/.installrc +:> ${BUILDROOT}/.installrc -echo "CURPNAME=${CURPNAME}" >> /mnt/BUILDROOT/.installrc -echo "CURPVER=${CURPVER}" >> /mnt/BUILDROOT/.installrc -echo "CURPBUILD=${CURPBUILD}" >> /mnt/BUILDROOT/.installrc -echo "CURARCH=${CURARCH}" >> /mnt/BUILDROOT/.installrc -echo "SMAGENAME=${SMAGENAME}" >> /mnt/BUILDROOT/.installrc -echo "MD5NAME=${MD5NAME}" >> /mnt/BUILDROOT/.installrc -echo "PKGNAME=${PKGNAME}" >> /mnt/BUILDROOT/.installrc -echo "SPKGNAME=${SPKGNAME}" >> /mnt/BUILDROOT/.installrc -echo '/usr/bin/whoami' >> /mnt/BUILDROOT/.installrc -echo 'source /etc/profile' >> /mnt/BUILDROOT/.installrc -#echo 'echo PATH=\${PATH};read' >> /mnt/BUILDROOT/.installrc -echo 'cd /var/cache/mage/smage' >> /mnt/BUILDROOT/.installrc -echo 'cvs update include' >> /mnt/BUILDROOT/.installrc -echo 'cvs update -dPA ${CURPNAME}' >> /mnt/BUILDROOT/.installrc -echo 'USE_SRCTARBALL=${USE_SRCTARBALL}' >> /mnt/BUILDROOT/.installrc -echo 'if [[ \${USE_SRCTARBALL} != true ]];then ' >> /mnt/BUILDROOT/.installrc - echo '/sbin/smage2 /var/cache/mage/smage/${CURPNAME}/${SMAGENAME} || exit 1' >> /mnt/BUILDROOT/.installrc -echo 'else' >> /mnt/BUILDROOT/.installrc - echo 'echo "Fetching SRC_TARBALL"' >> /mnt/BUILDROOT/.installrc - echo 'pushd /var/tmp/magebuild > /dev/null' >> /mnt/BUILDROOT/.installrc - echo "SRCTARBALL=${CURPNAME}-${CURPVER}-${CURPBUILD}.mpks" >> /mnt/BUILDROOT/.installrc - echo "SRCTARBALL_URI=${SRCTARBALL_URI}" >> /mnt/BUILDROOT/.installrc - echo '/usr/bin/wget -c \${SRCTARBALL_URI}/\${SRCTARBALL}' >> /mnt/BUILDROOT/.installrc - echo '/sbin/smage2 -st \${SRCTARBALL}' >> /mnt/BUILDROOT/.installrc - echo '[[ -f \${SRCTARBALL} ]] && rm \${SRCTARBALL}' >> /mnt/BUILDROOT/.installrc - echo 'popd > /dev/null' >> /mnt/BUILDROOT/.installrc -echo 'fi' >> /mnt/BUILDROOT/.installrc -echo '/sbin/mage install ${CURPNAME} || exit 1' >> /mnt/BUILDROOT/.installrc -echo 'mv /var/cache/mage/packages/${PKGNAME} /BUILDED' >> /mnt/BUILDROOT/.installrc -echo 'mv /var/cache/mage/packages/sources/${SRCPKGNAME} /BUILDED/sources' >> /mnt/BUILDROOT/.installrc -echo 'rm -rf /var/cache/mage/sources/${CURPNAME}' >> /mnt/BUILDROOT/.installrc +echo "CURPNAME=${CURPNAME}" >> ${BUILDROOT}/.installrc +echo "CURPVER=${CURPVER}" >> ${BUILDROOT}/.installrc +echo "CURPBUILD=${CURPBUILD}" >> ${BUILDROOT}/.installrc +echo "CURARCH=${CURARCH}" >> ${BUILDROOT}/.installrc +echo "SMAGENAME=${SMAGENAME}" >> ${BUILDROOT}/.installrc +echo "MD5NAME=${MD5NAME}" >> ${BUILDROOT}/.installrc +echo "PKGNAME=${PKGNAME}" >> ${BUILDROOT}/.installrc +echo "SPKGNAME=${SPKGNAME}" >> ${BUILDROOT}/.installrc +echo '/usr/bin/whoami' >> ${BUILDROOT}/.installrc +echo 'source /etc/profile' >> ${BUILDROOT}/.installrc +#echo 'echo PATH=\${PATH};read' >> ${BUILDROOT}/.installrc +echo 'cd /var/cache/mage/smage' >> ${BUILDROOT}/.installrc +echo 'cvs update include' >> ${BUILDROOT}/.installrc +echo 'cvs update -dPA ${CURPNAME}' >> ${BUILDROOT}/.installrc +echo 'USE_SRCTARBALL=${USE_SRCTARBALL}' >> ${BUILDROOT}/.installrc +echo 'if [[ \${USE_SRCTARBALL} != true ]];then ' >> ${BUILDROOT}/.installrc + echo '/sbin/smage2 /var/cache/mage/smage/${CURPNAME}/${SMAGENAME} || exit 1' >> ${BUILDROOT}/.installrc +echo 'else' >> ${BUILDROOT}/.installrc + echo 'echo "Fetching SRC_TARBALL"' >> ${BUILDROOT}/.installrc + echo 'pushd /var/tmp/magebuild > /dev/null' >> ${BUILDROOT}/.installrc + echo "SRCTARBALL=${CURPNAME}-${CURPVER}-${CURPBUILD}.mpks" >> ${BUILDROOT}/.installrc + echo "SRCTARBALL_URI=${SRCTARBALL_URI}" >> ${BUILDROOT}/.installrc + echo '/usr/bin/wget -c \${SRCTARBALL_URI}/\${SRCTARBALL}' >> ${BUILDROOT}/.installrc + echo '/sbin/smage2 -st \${SRCTARBALL}' >> ${BUILDROOT}/.installrc + echo '[[ -f \${SRCTARBALL} ]] && rm \${SRCTARBALL}' >> ${BUILDROOT}/.installrc + echo 'popd > /dev/null' >> ${BUILDROOT}/.installrc +echo 'fi' >> ${BUILDROOT}/.installrc +echo '/sbin/mage install ${CURPNAME} || exit 1' >> ${BUILDROOT}/.installrc +echo 'mv /var/cache/mage/packages/${PKGNAME} /BUILDED' >> ${BUILDROOT}/.installrc +echo 'mv /var/cache/mage/packages/sources/${SRCPKGNAME} /BUILDED/sources' >> ${BUILDROOT}/.installrc +echo 'rm -rf /var/cache/mage/sources/${CURPNAME}' >> ${BUILDROOT}/.installrc EOF -sudo -H /sbin/chroot /mnt/BUILDROOT /bin/bash /.installrc -sudo rm /mnt/BUILDROOT/.installrc +sudo -H /sbin/chroot ${BUILDROOT} /bin/bash /.installrc +sudo rm ${BUILDROOT}/.installrc -if [[ -f /mnt/BUILDROOT/BUILDED/${PKGNAME} ]] +if [[ -f ${BUILDROOT}/BUILDED/${PKGNAME} ]] then - scp /mnt/BUILDROOT/BUILDED/${PKGNAME} ${SSHLOGIN}/${CURARCH}/ + scp ${BUILDROOT}/BUILDED/${PKGNAME} ${SSHLOGIN}/${CURARCH}/ else - echo "Error: /mnt/BUILDROOT/BUILDED/${PKGNAME} missing!" + echo "Error: ${BUILDROOT}/BUILDED/${PKGNAME} missing!" exit 1 fi -if [[ -f /mnt/BUILDROOT/BUILDED/sources/${SRCPKGNAME} ]] +if [[ -f ${BUILDROOT}/BUILDED/sources/${SRCPKGNAME} ]] then - scp /mnt/BUILDROOT/BUILDED/sources/${SRCPKGNAME} ${SSHLOGIN}/src/ + scp ${BUILDROOT}/BUILDED/sources/${SRCPKGNAME} ${SSHLOGIN}/src/ else - echo "Error: /mnt/BUILDROOT/BUILDED/${SRCPKGNAME} missing!" + echo "Error: ${BUILDROOT}/BUILDED/${SRCPKGNAME} missing!" exit 1 fi