From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 76CA71382C5 for ; Sun, 31 May 2020 16:45:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A88CBE0943; Sun, 31 May 2020 16:45:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 89DBFE0943 for ; Sun, 31 May 2020 16:45:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3F91734ED80 for ; Sun, 31 May 2020 16:45:19 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3E12131 for ; Sun, 31 May 2020 16:45:17 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1590943439.0d1104d04fefd4ca6f78fc3721be05cabd77eb19.vapier@gentoo> Subject: [gentoo-commits] proj/releng:master commit in: tools/ X-VCS-Repository: proj/releng X-VCS-Files: tools/catalyst-auto X-VCS-Directories: tools/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 0d1104d04fefd4ca6f78fc3721be05cabd77eb19 X-VCS-Branch: master Date: Sun, 31 May 2020 16:45:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8822f639-954a-4174-a7bc-58c92db8614f X-Archives-Hash: 2b37953fe80b14754952ef45f2032dd6 commit: 0d1104d04fefd4ca6f78fc3721be05cabd77eb19 Author: Mike Frysinger gentoo org> AuthorDate: Sun May 31 16:43:59 2020 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Sun May 31 16:43:59 2020 +0000 URL: https://gitweb.gentoo.org/proj/releng.git/commit/?id=0d1104d0 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 gentoo.org> tools/catalyst-auto | 33 +++++++++++++++------------------ 1 file 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=()