diff options
author | Mike Frysinger <vapier@gentoo.org> | 2020-05-31 12:43:59 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2020-05-31 12:43:59 -0400 |
commit | 0d1104d04fefd4ca6f78fc3721be05cabd77eb19 (patch) | |
tree | abc1a6090e4170e9b3b3aa5bf8285c2f30ed590e /tools/catalyst-auto | |
parent | catalyst-auto: standardize indentation (diff) | |
download | releng-0d1104d04fefd4ca6f78fc3721be05cabd77eb19.tar.gz releng-0d1104d04fefd4ca6f78fc3721be05cabd77eb19.tar.bz2 releng-0d1104d04fefd4ca6f78fc3721be05cabd77eb19.zip |
catalyst-auto: fix preclean logic after snapshot changes
The snapshot generation logic was moved earlier in the build (before
the cleaning logic) which caused the preclean to nuke the freshly
generated cache. Move all the preclean logic back up before that.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tools/catalyst-auto')
-rwxr-xr-x | tools/catalyst-auto | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/tools/catalyst-auto b/tools/catalyst-auto index a1e1d7f2..34238c01 100755 --- a/tools/catalyst-auto +++ b/tools/catalyst-auto @@ -280,6 +280,21 @@ run_catalyst_commands() { fi fi + # Nuke any previous tmpdirs to keep them from accumulating. + if [[ ${preclean} == 1 ]]; then + rm -rf "${TMP_PATH:-/tmp}/catalyst-auto".* + + snapshot_cache=$(catalyst_var snapshot_cache) + if [[ -z ${snapshot_cache} ]]; then + echo "error: snapshot_cache not set in config file" + exit 1 + fi + pushd "${BUILD_SRCDIR_BASE}" >/dev/null || exit 1 + rm -rf --one-file-system \ + kerncache packages snapshots tmp "${snapshot_cache}"/* + popd >/dev/null + fi + if catalyst --help | grep -q "git-treeish"; then snapshot_log=$(mktemp --tmpdir="${TMP_PATH:-/tmp}") if ! run_cmd "${snapshot_log}" catalyst -c "${CATALYST_CONFIG}" -s stable; then @@ -301,12 +316,6 @@ run_catalyst_commands() { DATESTAMP=$(date -u +%Y%m%d) TMPDIR=$(mktemp -d --tmpdir="${TMP_PATH:-/tmp}" "catalyst-auto.${TIMESTAMP}.XXXXXX") - # Nuke any previous tmpdirs to keep them from accumulating. - if [[ ${preclean} == 1 ]]; then - rm -rf "${TMPDIR%.??????}".* - mkdir "${TMPDIR}" - fi - if [[ ${verbose} -ge 1 ]]; then echo "TMPDIR = ${TMPDIR}" echo "TIMESTAMP = ${TIMESTAMP}" @@ -371,18 +380,6 @@ run_catalyst_commands() { exit fi - if [[ ${preclean} == 1 ]]; then - snapshot_cache=$(catalyst_var snapshot_cache) - if [[ -z ${snapshot_cache} ]]; then - echo "error: snapshot_cache not set in config file" - exit 1 - fi - pushd "${BUILD_SRCDIR_BASE}" >/dev/null || exit 1 - rm -rf --one-file-system \ - kerncache packages snapshots tmp "${snapshot_cache}"/* - popd >/dev/null - fi - build_failure=0 timeprefix=() |