source: contrib/mpab/gather_archives.sh @ 86175

Last change on this file since 86175 was 86175, checked in by jmr@…, 6 years ago

mpab: log reasons for archives not being distributable

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/sh
2
3CHROOTSUBDIR=mpchroot
4dataDir=$(pwd)
5if [[ -n "$MPAB_DATA" ]]; then
6   dataDir=$MPAB_DATA
7fi
8chrootPath="${dataDir}/${CHROOTSUBDIR}"
9OSMajor=`uname -r | sed 's/\..*//'`
10# xcodebuild breaks in chroots on 10.6
11if [[ $1 = "-n" || $OSMajor -ge 10 ]]; then
12    chrootPath=""
13    if [[ $1 = "-n" ]]; then
14        shift
15    fi
16fi
17
18if [[ -z "$PORTLISTFILE" ]]; then
19    PORTLISTFILE=portlist
20fi
21
22if [[ -z "$PREFIX" ]]; then
23    PREFIX="/opt/local"
24fi
25
26# path where archives should be staged before being uploaded to the master
27if [[ -z "$ULPATH" ]]; then
28    ULPATH="archive_staging"
29fi
30
31mkdir -p $ULPATH
32if [[ `head -n1 $PORTLISTFILE` == "all" ]]; then
33    ports=`${PREFIX}/bin/port -q echo all | tr '\n' ' '`
34else
35    ports=`cat $PORTLISTFILE`
36fi
37
38# if mpab was killed due to a timeout, logs will still be in the tmp dir
39if ! ls logs-* > /dev/null 2>&1 ; then
40    now=`date '+%Y%m%d-%H%M%S'`
41    baseDir=$(dirname $0)
42    mkdir ${baseDir}/logs-${now}
43    mv ${chrootPath}/var/tmp/portresults/fail ${baseDir}/logs-${now}
44    mv ${chrootPath}/var/tmp/portresults/success ${baseDir}/logs-${now}
45    chmod -R a+rX ${baseDir}/logs-${now}
46fi
47
48for portname in $ports; do
49    if ls logs-*/success/${portname}.log > /dev/null 2>&1 ; then
50        if ./mpexport/base/portmgr/jobs/port_binary_distributable.tcl -v ${portname}; then
51            portversion=$(${PREFIX}/bin/port info --index --version --line ${portname})
52            portrevision=$(${PREFIX}/bin/port info --index --revision --line ${portname})
53            for archive in ${PREFIX}/var/macports/software/${portname}/${portname}-${portversion}_${portrevision}[+.]*; do
54                aname=$(basename $archive)
55                echo preparing archive for upload: $aname
56                mkdir -p ${ULPATH}/${portname}
57                cp $archive ${ULPATH}/${portname}/
58            done
59        fi
60    fi
61done
Note: See TracBrowser for help on using the repository browser.