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-05 10:07:20 +0000 |
commit | bac6e3a2d70d1c757f4ee3a51dcad1ef89cca922 (patch) | |
tree | 0b9d620f31b1a36d898a5fa0093916f356d43240 | |
parent | catalyst-auto: Record how long the catalyst runs take. (diff) | |
download | releng-bac6e3a2d70d1c757f4ee3a51dcad1ef89cca922.tar.gz releng-bac6e3a2d70d1c757f4ee3a51dcad1ef89cca922.tar.bz2 releng-bac6e3a2d70d1c757f4ee3a51dcad1ef89cca922.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 48dd9cfe..80bf8b78 100644 --- a/tools/catalyst-auto-amd64.conf +++ b/tools/catalyst-auto-amd64.conf @@ -59,11 +59,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 @@ -76,6 +72,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} |