Gentoo Archives: gentoo-commits

From: "Andrew Gaffney (agaffney)" <agaffney@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] releng r575 - trunk/tools
Date: Sun, 28 Sep 2008 04:31:53
Message-Id: E1Kjnwk-000221-Ie@stork.gentoo.org
1 Author: agaffney
2 Date: 2008-09-28 04:31:49 +0000 (Sun, 28 Sep 2008)
3 New Revision: 575
4
5 Modified:
6 trunk/tools/ChangeLog
7 trunk/tools/catalyst-auto
8 Log:
9 Add pre_build() and post_build() support
10
11 Modified: trunk/tools/ChangeLog
12 ===================================================================
13 --- trunk/tools/ChangeLog 2008-09-05 02:50:40 UTC (rev 574)
14 +++ trunk/tools/ChangeLog 2008-09-28 04:31:49 UTC (rev 575)
15 @@ -2,6 +2,9 @@
16 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
17 # $Id$
18
19 + 28 Sep 2008; Andrew Gaffney <agaffney@g.o> catalyst-auto:
20 + Add pre_build() and post_build() support
21 +
22 05 Sep 2008; Andrew Gaffney <agaffney@g.o>
23 catalyst-auto-amd64.conf:
24 Change a few config values
25
26 Modified: trunk/tools/catalyst-auto
27 ===================================================================
28 --- trunk/tools/catalyst-auto 2008-09-05 02:50:40 UTC (rev 574)
29 +++ trunk/tools/catalyst-auto 2008-09-28 04:31:49 UTC (rev 575)
30 @@ -43,6 +43,20 @@
31 fi
32 }
33
34 +pre_build() {
35 + # This is a skeleton function that you can override from the config file.
36 + # It will be executed before the build is started. You can use this to
37 + # update a svn checkout of spec files
38 + local foo=bar
39 +}
40 +
41 +post_build() {
42 + # This is a skeleton function that you can override from the config file.
43 + # It will be executed after the build is successfully completed. You can
44 + # use this to rsync the builds to another box
45 + local foo=bar
46 +}
47 +
48 # Parse args
49 params=${#}
50 while [ ${#} -gt 0 ]
51 @@ -80,6 +94,11 @@
52 TMPDIR=/tmp/catalyst-auto.${PID}
53 DATESTAMP=$(date +%Y%m%d)
54
55 +if ! run_cmd "pre_build" "${TMPDIR}/log/pre_build.log"; then
56 + send_email "Catalyst build error - pre_build" "$(echo -e "Your pre_build function sucks\n\n"; tail -n 200 "${TMPDIR}/log/pre_build.log")"
57 + exit 1
58 +fi
59 +
60 if [ ${verbose} = 1 ]; then
61 echo "TMPDIR = ${TMPDIR}"
62 echo "DATESTAMP = ${DATESTAMP}"
63 @@ -132,9 +151,9 @@
64 done
65
66 # Create snapshot
67 -if ! run_cmd "catalyst -c ${CATALYST_CONFIG} -s ${DATESTAMP}" "${TMPDIR}/log/snapshot-${DATESTAMP}.log"; then
68 - send_email "Catalyst build error - snapshot" "$(tail -n 200 ${TMPDIR}/log/snapshot-${DATESTAMP}.log)"
69 - exit 1
70 +if ! run_cmd "catalyst -c ${CATALYST_CONFIG} -s ${DATESTAMP}" "${TMPDIR}/log/snapshot.log"; then
71 + send_email "Catalyst build error - snapshot" "$(tail -n 200 ${TMPDIR}/log/snapshot.log)"
72 + exit 1
73 fi
74
75 for i in ${SPECS}; do
76 @@ -146,6 +165,11 @@
77 fi
78 done
79
80 +if ! run_cmd "post_build" "${TMPDIR}/log/post_build.log"; then
81 + send_email "Catalyst build error - post_build" "$(echo -e "Your post_build function sucks\n\n"; tail -n 200 "${TMPDIR}/log/post_build.log")"
82 + exit 1
83 +fi
84 +
85 send_email "Catalyst build success" "Everything finished successfully."
86
87 if ! rm -rf "${TMPDIR}"; then