diff options
author | Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org> | 2016-05-05 10:07:20 +0000 |
---|---|---|
committer | Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org> | 2016-05-29 20:04:13 +0000 |
commit | baa33e4ac841a398bc6d09c2d75022ca39b0b1ca (patch) | |
tree | 5c94a1037d184282b52cbd198f220bdac34c792e | |
parent | catalyst-auto: Record how long the catalyst runs take. (diff) | |
download | releng-baa33e4ac841a398bc6d09c2d75022ca39b0b1ca.tar.gz releng-baa33e4ac841a398bc6d09c2d75022ca39b0b1ca.tar.bz2 releng-baa33e4ac841a398bc6d09c2d75022ca39b0b1ca.zip |
Move the code to update symlinks to a separate function, call it from pre_build and after each set build.
Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>
-rwxr-xr-x | tools/catalyst-auto | 10 | ||||
-rw-r--r-- | tools/catalyst-auto-amd64.conf | 13 |
2 files changed, 17 insertions, 6 deletions
diff --git a/tools/catalyst-auto b/tools/catalyst-auto index b928ac98..cc4da35e 100755 --- a/tools/catalyst-auto +++ b/tools/catalyst-auto @@ -81,6 +81,13 @@ run_cmd() { fi } +update_symlinks() { + # This is a skeleton function that you can override from the config file. + # It will be called by pre_build and after completing the build of a set + # to ensure the symlinks point to the latest built stages. + local foo=bar +} + pre_build() { # This is a skeleton function that you can override from the config file. # It will be executed before the build is started. You can use this to @@ -246,7 +253,7 @@ for i in $(find -name '*.spec'); do sed -i 's|^snapshot:.*$|snapshot: '${DATESTAMP}'|' ${i} # We don't want to mangle the source_subpath for our stage1 spec - if ! grep -q '^target: *stage1$' ${i}; then + if ! [[grep -q '^target: *stage1$' ${i} || grep -q '^target: *stage4$' ${i} ]]; then sed -i 's|^source_subpath:.*$|source_subpath: '${new_source_subpath}'|' ${i} fi @@ -329,6 +336,7 @@ for a in "" ${SETS}; do run_cmd "time catalyst -P -c ${CATALYST_CONFIG} -f ${i}" "${LOGFILE}" done + update_symlinks done if ! run_cmd "post_build" "${TMPDIR}/log/post_build.log"; then diff --git a/tools/catalyst-auto-amd64.conf b/tools/catalyst-auto-amd64.conf index d5554bc3..8017935a 100644 --- a/tools/catalyst-auto-amd64.conf +++ b/tools/catalyst-auto-amd64.conf @@ -58,11 +58,7 @@ give_latest_from_dates() { tr '~' '-' } -pre_build() { - pushd ${REPO_DIR} - git pull - popd - +update_symlinks() { # Symlink the latest stages3 to build from for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do pushd $d @@ -75,6 +71,13 @@ pre_build() { done } +pre_build() { + pushd ${REPO_DIR} + git pull + popd + update_symlinks +} + post_build() { pushd ${BUILD_SRCDIR_BASE}/default mkdir -p ${BUILD_DESTDIR_BASE}/${TYPE}/${ARCH}/default/${DATESTAMP} |