Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/releng:master commit in: tools/
Date: Sun, 31 May 2020 16:45:21
Message-Id: 1590943439.0d1104d04fefd4ca6f78fc3721be05cabd77eb19.vapier@gentoo
1 commit: 0d1104d04fefd4ca6f78fc3721be05cabd77eb19
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 31 16:43:59 2020 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Sun May 31 16:43:59 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/releng.git/commit/?id=0d1104d0
7
8 catalyst-auto: fix preclean logic after snapshot changes
9
10 The snapshot generation logic was moved earlier in the build (before
11 the cleaning logic) which caused the preclean to nuke the freshly
12 generated cache. Move all the preclean logic back up before that.
13
14 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
15
16 tools/catalyst-auto | 33 +++++++++++++++------------------
17 1 file changed, 15 insertions(+), 18 deletions(-)
18
19 diff --git a/tools/catalyst-auto b/tools/catalyst-auto
20 index a1e1d7f2..34238c01 100755
21 --- a/tools/catalyst-auto
22 +++ b/tools/catalyst-auto
23 @@ -280,6 +280,21 @@ run_catalyst_commands() {
24 fi
25 fi
26
27 + # Nuke any previous tmpdirs to keep them from accumulating.
28 + if [[ ${preclean} == 1 ]]; then
29 + rm -rf "${TMP_PATH:-/tmp}/catalyst-auto".*
30 +
31 + snapshot_cache=$(catalyst_var snapshot_cache)
32 + if [[ -z ${snapshot_cache} ]]; then
33 + echo "error: snapshot_cache not set in config file"
34 + exit 1
35 + fi
36 + pushd "${BUILD_SRCDIR_BASE}" >/dev/null || exit 1
37 + rm -rf --one-file-system \
38 + kerncache packages snapshots tmp "${snapshot_cache}"/*
39 + popd >/dev/null
40 + fi
41 +
42 if catalyst --help | grep -q "git-treeish"; then
43 snapshot_log=$(mktemp --tmpdir="${TMP_PATH:-/tmp}")
44 if ! run_cmd "${snapshot_log}" catalyst -c "${CATALYST_CONFIG}" -s stable; then
45 @@ -301,12 +316,6 @@ run_catalyst_commands() {
46 DATESTAMP=$(date -u +%Y%m%d)
47 TMPDIR=$(mktemp -d --tmpdir="${TMP_PATH:-/tmp}" "catalyst-auto.${TIMESTAMP}.XXXXXX")
48
49 - # Nuke any previous tmpdirs to keep them from accumulating.
50 - if [[ ${preclean} == 1 ]]; then
51 - rm -rf "${TMPDIR%.??????}".*
52 - mkdir "${TMPDIR}"
53 - fi
54 -
55 if [[ ${verbose} -ge 1 ]]; then
56 echo "TMPDIR = ${TMPDIR}"
57 echo "TIMESTAMP = ${TIMESTAMP}"
58 @@ -371,18 +380,6 @@ run_catalyst_commands() {
59 exit
60 fi
61
62 - if [[ ${preclean} == 1 ]]; then
63 - snapshot_cache=$(catalyst_var snapshot_cache)
64 - if [[ -z ${snapshot_cache} ]]; then
65 - echo "error: snapshot_cache not set in config file"
66 - exit 1
67 - fi
68 - pushd "${BUILD_SRCDIR_BASE}" >/dev/null || exit 1
69 - rm -rf --one-file-system \
70 - kerncache packages snapshots tmp "${snapshot_cache}"/*
71 - popd >/dev/null
72 - fi
73 -
74 build_failure=0
75
76 timeprefix=()