Gentoo Archives: gentoo-commits

From: "Jorge Manuel B. S. Vicetto" <jmbsvicetto@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/releng:master commit in: tools/
Date: Thu, 05 May 2016 10:10:19
Message-Id: 1462442840.bac6e3a2d70d1c757f4ee3a51dcad1ef89cca922.jmbsvicetto@gentoo
1 commit: bac6e3a2d70d1c757f4ee3a51dcad1ef89cca922
2 Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 5 10:07:20 2016 +0000
4 Commit: Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
5 CommitDate: Thu May 5 10:07:20 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/releng.git/commit/?id=bac6e3a2
7
8 Move the code to update symlinks to a separate function, call it from pre_build and after each set build.
9
10 Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo.org>
11
12 tools/catalyst-auto | 10 +++++++++-
13 tools/catalyst-auto-amd64.conf | 13 ++++++++-----
14 2 files changed, 17 insertions(+), 6 deletions(-)
15
16 diff --git a/tools/catalyst-auto b/tools/catalyst-auto
17 index b928ac9..cc4da35 100755
18 --- a/tools/catalyst-auto
19 +++ b/tools/catalyst-auto
20 @@ -81,6 +81,13 @@ run_cmd() {
21 fi
22 }
23
24 +update_symlinks() {
25 + # This is a skeleton function that you can override from the config file.
26 + # It will be called by pre_build and after completing the build of a set
27 + # to ensure the symlinks point to the latest built stages.
28 + local foo=bar
29 +}
30 +
31 pre_build() {
32 # This is a skeleton function that you can override from the config file.
33 # It will be executed before the build is started. You can use this to
34 @@ -246,7 +253,7 @@ for i in $(find -name '*.spec'); do
35 sed -i 's|^snapshot:.*$|snapshot: '${DATESTAMP}'|' ${i}
36
37 # We don't want to mangle the source_subpath for our stage1 spec
38 - if ! grep -q '^target: *stage1$' ${i}; then
39 + if ! [[grep -q '^target: *stage1$' ${i} || grep -q '^target: *stage4$' ${i} ]]; then
40 sed -i 's|^source_subpath:.*$|source_subpath: '${new_source_subpath}'|' ${i}
41 fi
42
43 @@ -329,6 +336,7 @@ for a in "" ${SETS}; do
44 run_cmd "time catalyst -P -c ${CATALYST_CONFIG} -f ${i}" "${LOGFILE}"
45 done
46
47 + update_symlinks
48 done
49
50 if ! run_cmd "post_build" "${TMPDIR}/log/post_build.log"; then
51
52 diff --git a/tools/catalyst-auto-amd64.conf b/tools/catalyst-auto-amd64.conf
53 index 48dd9cf..80bf8b7 100644
54 --- a/tools/catalyst-auto-amd64.conf
55 +++ b/tools/catalyst-auto-amd64.conf
56 @@ -59,11 +59,7 @@ give_latest_from_dates() {
57 tr '~' '-'
58 }
59
60 -pre_build() {
61 - pushd ${REPO_DIR}
62 - git pull
63 - popd
64 -
65 +update_symlinks() {
66 # Symlink the latest stages3 to build from
67 for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do
68 pushd $d
69 @@ -76,6 +72,13 @@ pre_build() {
70 done
71 }
72
73 +pre_build() {
74 + pushd ${REPO_DIR}
75 + git pull
76 + popd
77 + update_symlinks
78 +}
79 +
80 post_build() {
81 pushd ${BUILD_SRCDIR_BASE}/default
82 mkdir -p ${BUILD_DESTDIR_BASE}