aboutsummaryrefslogtreecommitdiffstats
path: root/Tools/portbuild/scripts/dopackages2
blob: bac4d7b0c6157ef5fdd48dcdc60dbdea553bc60e (plain) (blame)
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
#!/bin/sh

# configurable variables
pb=/var/portbuild

. ${pb}/portbuild.conf

lock=${pb}/lock
status=${pb}/status
date=$(date '+%Y%m%d%H')
shortdate=$(date '+%Y%m%d')

if [ -e ${lock} ]; then
# echo "Skipped package build since lock file exists" | sendmail $mailto
  exit 1
fi

touch ${lock}
rm -f ${status}
mkdir -p ${pb}/archive/buildlogs

if [ -f ${pb}/scripts/dopackages.new ]; then
  mv -f ${pb}/scripts/dopackages.new ${pb}/scripts/dopackages
fi
ln -sf ${pb}/archive/buildlogs/log.4.${date} ${pb}/4/build.log
ln -sf log.4.${date} ${pb}/archive/buildlogs/log.4.${shortdate}
${pb}/scripts/dopackages $@ 4 ${date} 2>&1 \
    | tee ${pb}/archive/buildlogs/log.4.${date} \
    | sendmail $mailto
if [ -f ${status} ]; then
    rm -f ${lock}
    exit "$(cat ${status})"
fi

if [ -f ${pb}/scripts/dopackages.new ]; then
  mv -f ${pb}/scripts/dopackages.new ${pb}/scripts/dopackages
fi
ln -sf ${pb}/archive/buildlogs/log.5.${date} ${pb}/5/build.log
ln -sf log.5.${date} ${pb}/archive/buildlogs/log.5.${shortdate}
${pb}/scripts/dopackages -nocvsup $@ 5 ${date} 2>&1 \
    | tee ${pb}/archive/buildlogs/log.5.${date} \
    | sendmail $mailto
if [ -f ${status} ]; then
    rm -f ${lock}
    exit "$(cat ${status})"
fi

if [ -f ${pb}/scripts/dopackages.new ]; then
  mv -f ${pb}/scripts/dopackages.new ${pb}/scripts/dopackages
fi
ln -sf ${pb}/archive/buildlogs/log.3.${date} ${pb}/3/build.log
ln -sf log.3.${date} ${pb}/archive/buildlogs/log.3.${shortdate}
${pb}/scripts/dopackages -nocvsup $@ 3 ${date} 2>&1 \
    | tee ${pb}/archive/buildlogs/log.3.${date} \
    | sendmail $mailto
if [ -f ${status} ]; then
    rm -f ${lock}
    exit "$(cat ${status})"
fi

cd ${pb}/archive/errorlogs/e.3.${date} && ${pb}/scripts/processlogs
cd ${pb}/archive/errorlogs/e.4.${date} && ${pb}/scripts/processlogs
cd ${pb}/archive/errorlogs/e.5.${date} && ${pb}/scripts/processlogs
cd ${pb}/archive/errorlogs
${pb}/scripts/comparelogs e.3.${date} e.4.${date}
${pb}/scripts/comparelogs e.4.${date} e.3.${date}
${pb}/scripts/comparelogs e.5.${date} e.4.${date}
${pb}/scripts/comparelogs e.4.${date} e.5.${date}
${pb}/scripts/bothlogs e.3.${date} e.4.${date} e.5.${date}

rm -f ${lock}