[46274] contrib/mpab

febeling at macports.org febeling at macports.org
Sun Feb 1 15:20:03 PST 2009


Revision: 46274
          http://trac.macports.org/changeset/46274
Author:   febeling at macports.org
Date:     2009-02-01 15:20:03 -0800 (Sun, 01 Feb 2009)
Log Message:
-----------
mpab: accept an svn working directory as a substitute for a mp tarball, alternatively.

Modified Paths:
--------------
    contrib/mpab/mpab
    contrib/mpab/mpab-functions

Modified: contrib/mpab/mpab
===================================================================
--- contrib/mpab/mpab	2009-02-01 23:18:26 UTC (rev 46273)
+++ contrib/mpab/mpab	2009-02-01 23:20:03 UTC (rev 46274)
@@ -38,6 +38,7 @@
 
 # Name of the file containing all of MacPorts
 MPTARBALL="macports_dist.tar.bz2"
+MP_SVN_WORKDIR="mpexport"
 
 if [[ -n ${MPABDEBUG} ]]; then
    HDIUTILDEBUG="-verbose"
@@ -74,7 +75,7 @@
    fi
 fi
 
-checkDependencies ${baseDir} ${MPTARBALL}
+checkDependencies ${baseDir} ${MPTARBALL} ${MP_SVN_WORKDIR}
 returnValue=$?
 if [[ ${returnValue} != 0 ]]; then
    exit ${returnValue}
@@ -98,7 +99,11 @@
          rm -rf ${chrootPath}/opt/mports
          rm -f ${chrootPath}/opt/local/bin/port
       fi
-      buildMacPorts ${baseDir} ${chrootPath} ${MPTARBALL}
+      if [[ -d ${MP_SVN_WORKDIR} ]]; then
+         buildMacPorts ${baseDir} ${chrootPath} ${MP_SVN_WORKDIR}
+      else
+         buildMacPorts ${baseDir} ${chrootPath} ${MPTARBALL}
+      fi
       exitMessage=""
       if [[ $? == 0 && ${command} == "buildports" ]]; then
          if [[ -e ${portlistFile} ]]; then
@@ -111,3 +116,8 @@
    fi
 fi
 
+# Local Variables:
+# mode: shell-script
+# indent-tabs-mode: nil
+# sh-basic-offset: 3
+# End:

Modified: contrib/mpab/mpab-functions
===================================================================
--- contrib/mpab/mpab-functions	2009-02-01 23:18:26 UTC (rev 46273)
+++ contrib/mpab/mpab-functions	2009-02-01 23:20:03 UTC (rev 46274)
@@ -35,14 +35,15 @@
 {
    baseDir=$1
    mpTarball=$2
+   mpSvnWorkdir=$3
 
    if [[ `id -u` != 0 ]]; then
       echo "This must be run as root, please do so"
       return 1
    fi
-   if [[ ! -f ${baseDir}/${mpTarball} ]]; then
+   if [[ ! -f ${baseDir}/${mpTarball} && ! -d ${baseDir}/${mpSvnWorkdir} ]]; then
       cat << EOF
-Need to have a MacPorts source tarball as ${baseDir}/${mpTarball}
+Need to have a MacPorts source tarball ${baseDir}/${mpTarball} or svn working directhory ${baseDir}/${mpSvnWorkDir}
 See the ReadMe.txt file.
 EOF
    return 2
@@ -184,24 +185,30 @@
 # Build MacPorts in the chroot
 # $1 - base directory
 # $2 - chroot path
-# $3 - MacPorts source tarball
+# $3 - MacPorts source tarball or svn export dir
 function buildMacPorts()
 {
    baseDir=$1
    chrootPath=$2
-   mpTarball=$3
+   mpExport=$3
 
    echo "Building/installing MP in chroot, if necessary"
 
    if [[ ! -d ${chrootPath}/opt/mports ]]; then
-      if [[ ! -f ${baseDir}/${mpTarball} ]]; then
-         echo "No ${mpTarball} found"
+      if [[ -f ${baseDir}/${mpExport} ]]; then
+	 mkdir -p ${chrootPath}/opt/mports
+	 cd ${chrootPath}/opt/mports
+	 bunzip2 -c ${baseDir}/${mpExport} | tar xf -
+	 cd - > /dev/null
+      elif [[ -d ${baseDir}/${mpExport} ]]; then
+	 mkdir -p ${chrootPath}/opt/mports
+         cd ${baseDir}/${mpExport} && \
+            rsync -r --del --exclude '*~' --exclude '.svn' . ${chrootPath}/opt/mports
+         cd - > /dev/null
+      else
+         echo "No ${mpExport} found"
          return 1
       fi
-      mkdir -p ${chrootPath}/opt/mports
-      cd ${chrootPath}/opt/mports
-      bunzip2 -c ${baseDir}/${mpTarball} | tar xf -
-      cd - > /dev/null
    fi
 
    if [[ ! -f ${chrootPath}/opt/local/bin/port ]]; then
@@ -334,3 +341,8 @@
    return 0
 }
 
+# Local Variables:
+# mode: shell-script
+# indent-tabs-mode: nil
+# sh-basic-offset: 3
+# End:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090201/ffa971b2/attachment.html>


More information about the macports-changes mailing list