forked from trueos/pcbsd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkports-tests.sh
executable file
·77 lines (58 loc) · 1.48 KB
/
mkports-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
# Script to run test builds of all PC-BSD ports
if [ -z "$1" ] ; then
echo "Usage: ./mkport-tests.sh <portstree>"
exit 1
fi
if [ ! -d "${1}/Mk" ] ; then
echo "Invalid directory: $1"
exit 1
fi
portsdir="${1}"
if [ -z "$2" ] ; then
distdir="${1}/distfiles"
else
distdir="${2}"
fi
export PCBSD_MKTESTS=1
# Start by copying all the ports over
./mkports.sh ${1} ${2}
if [ $? -ne 0 ] ; then exit 1; fi
# Get this jail version
export UNAME_r="`freebsd-version`"
if [ ! -d "/tmp/.pcbsd-tests" ] ; then
mkdir /tmp/.pcbsd-tests
fi
# Now start building the various ports
while read portline
do
port=`echo $portline | awk '{print $2}'`
tverfile="/tmp/.pcbsd-tests/`echo $port | sed 's|/|_|g'`"
cd $portsdir/$port
if [ -e "$tverfile" ] ; then
# If this file exists, we did a previous build of this port
nVer=`make -V DISTVERSION`
oVer=`cat $tverfile`
echo "$port - $nVer - $oVer -"
if [ "$nVer" = "$oVer" ] ; then
echo "No changes to port: $port"
continue
fi
fi
echo "Building port: $port"
if [ $? -ne 0 ] ; then exit 1; fi
make clean
make BATCH=yes
if [ $? -ne 0 ] ; then exit 1; fi
make stage
if [ $? -ne 0 ] ; then exit 1; fi
make check-plist
if [ $? -ne 0 ] ; then exit 1; fi
make package
if [ $? -ne 0 ] ; then exit 1; fi
make clean
if [ $? -ne 0 ] ; then exit 1; fi
# Save the version number so we can skip on next run if no changes
make -V DISTVERSION > $tverfile
done < mkports-list
exit 0