New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 82197


Ignore:
Timestamp:
08/10/11 05:12:09 (4 years ago)
Author:
jmr@…
Message:

mpab: remember previously failed ports, and don't try building if portfile hasn't changed since failure

Location:
contrib/mpab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • contrib/mpab/chroot-scripts/buildports

    r81645 r82197  
    6464PORTRESULTSDIR="/var/tmp/portresults" 
    6565PROGRESSLOG="/var/tmp/progress.log" 
     66FAILCACHE="/var/tmp/failcache" 
    6667rm -rf ${PORTRESULTSDIR} 
    6768/bin/mkdir -p ${PORTRESULTSDIR}/success ${PORTRESULTSDIR}/fail 
     
    102103   else 
    103104      skipPort="" 
    104       portDeps=`${PREFIX}/bin/port info --index --depends --line ${portName} | /usr/bin/tr ',' ' '` 
    105       for oneDep in ${portDeps}; do 
    106          depType=`echo ${oneDep} | /usr/bin/awk -F : '{print $1}'` 
    107          if [[ $depType == "port" ]]; then 
    108             depName=`echo ${oneDep} | /usr/bin/awk -F : '{print $2}'` 
    109             if [[ -f ${PORTRESULTSDIR}/fail/${depName}.log ]]; then 
    110                 skipPort=$depName 
    111                 break 
     105      portFile=`${PREFIX}/bin/port file ${portName}` 
     106      if [[ ! "$portFile" -nt "${FAILCACHE}/${portName}" ]]; then 
     107         echo "skipping, portfile not modified since last failure" | tee -a ${PROGRESSLOG} | tee ${PORTRESULTSDIR}/fail/${portName}.log 
     108         skipPort=1 
     109      else 
     110         portDeps=`${PREFIX}/bin/port info --index --depends --line ${portName} | /usr/bin/tr ',' ' '` 
     111         nonPortDeps="" 
     112         for oneDep in ${portDeps}; do 
     113            depType=`echo ${oneDep} | /usr/bin/awk -F : '{print $1}'` 
     114            if [[ $depType == "port" ]]; then 
     115               depName=`echo ${oneDep} | /usr/bin/awk -F : '{print $2}'` 
     116               if [[ -f ${PORTRESULTSDIR}/fail/${depName}.log ]]; then 
     117                  skipPort=1 
     118                  echo "skipping, $depName previously failed and is needed" | tee -a ${PROGRESSLOG} 
     119                  echo "${portName} not built due to failed dependency $depName" > ${PORTRESULTSDIR}/fail/${portName}.log 
     120                  break 
     121               fi 
     122            else 
     123               nonPortDeps=1 
    112124            fi 
    113          fi 
    114       done 
    115       if [[ -z $skipPort ]]; then 
     125         done 
     126      fi 
     127      if [[ -z "$skipPort" ]]; then 
    116128         ${PREFIX}/bin/port -dv install $portName | tee ${PORTRESULTSDIR}/${portName}.log 2>&1 
    117129         if [[ ${PIPESTATUS[0]} == 0 ]]; then 
    118130            /bin/mv ${PORTRESULTSDIR}/${portName}.log ${PORTRESULTSDIR}/success 
    119131            echo "success" | tee -a ${PROGRESSLOG} 
     132            rm -f ${FAILCACHE}/${portName} 
    120133         else 
    121134            /bin/mv ${PORTRESULTSDIR}/${portName}.log ${PORTRESULTSDIR}/fail 
    122135            echo "failure" | tee -a ${PROGRESSLOG} 
    123136            ${PREFIX}/bin/port clean --work $portName 
     137            # check that it definitely failed in its own right before caching 
     138            if [[ -z "$nonPortDeps" ]]; then 
     139               touch -r ${portFile} ${FAILCACHE}/${portName} 
     140            fi 
    124141         fi 
    125142         uninstallPorts 
     
    128145            exit 2 
    129146         fi 
    130       else 
    131          echo "skipping, ${skipPort} previously failed and is needed" | tee -a ${PROGRESSLOG} 
    132          echo "${portName} not built due to failed dependency ${skipPort}" > ${PORTRESULTSDIR}/fail/${portName}.log 
    133147      fi 
    134148   fi 
  • contrib/mpab/mpab-functions

    r81549 r82197  
    276276      ln -s ${baseDir}/progress.log ${chrootPath}/var/tmp/progress.log 
    277277   fi 
     278   mkdir -p ${baseDir}/failcache 
     279   rsync -a ${baseDir}/failcache ${chrootPath}/var/tmp 
    278280 
    279281   chrootExec buildports 
     282 
     283   rsync -a ${chrootPath}/var/tmp/failcache ${baseDir} 
    280284 
    281285   return 0 
Note: See TracChangeset for help on using the changeset viewer.