Gentoo Archives: gentoo-commits

From: Richard Farina <zerochaos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:master commit in: /, files/, targets/support/, modules/
Date: Mon, 29 Oct 2012 19:43:27
Message-Id: 1351539645.8ca52570aa2d0e14b848692ddf759212d81168e3.zerochaos@gentoo
1 commit: 8ca52570aa2d0e14b848692ddf759212d81168e3
2 Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 29 19:40:45 2012 +0000
4 Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 29 19:40:45 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=8ca52570
7
8 keep logs outside of chroot
9
10 Every time stage build is restarted, the build logs of the previous run
11 are lost. This new feature allows the logs to be kept outside the chroot
12 and thus protected from purging. This new feature forces portage to use
13 FEATURES="clean-logs" no matter what, but it should have no effect on
14 users not using the new functionality added by this patch.
15
16 This new function is DISABLED per default due to a lack of feedback,
17 however, it is highly suggested that this is made default for the next
18 release cycle.
19
20 ---
21 catalyst | 3 +++
22 files/catalyst.conf | 5 +++++
23 modules/generic_stage_target.py | 6 ++++++
24 targets/support/chroot-functions.sh | 2 +-
25 4 files changed, 15 insertions(+), 1 deletions(-)
26
27 diff --git a/catalyst b/catalyst
28 index 483a6e5..ed3fbd5 100755
29 --- a/catalyst
30 +++ b/catalyst
31 @@ -168,6 +168,9 @@ def parse_config(myconfig):
32 if myconf.has_key("var_tmpfs_portage"):
33 conf_values["var_tmpfs_portage"]=myconf["var_tmpfs_portage"];
34
35 + if myconf.has_key("port_logdir"):
36 + conf_values["port_logdir"]=myconf["port_logdir"];
37 +
38 def import_modules():
39 # import catalyst's own modules (i.e. catalyst_support and the arch modules)
40 targetmap={}
41
42 diff --git a/files/catalyst.conf b/files/catalyst.conf
43 index 49d2a15..ea74eb1 100644
44 --- a/files/catalyst.conf
45 +++ b/files/catalyst.conf
46 @@ -81,6 +81,11 @@ snapshot_cache="/var/tmp/catalyst/snapshot_cache"
47 # also where it will put its temporary files and caches.
48 storedir="/var/tmp/catalyst"
49
50 +# port_logdir is where all build logs will be kept. This dir will be automatically cleaned
51 +# of all logs over 30 days old. If left undefined the logs will remain in the build directory
52 +# as usual and get cleaned every time a stage build is restarted.
53 +# port_logdir="/var/tmp/catalyst/tmp"
54 +
55 # var_tmpfs_portage will mount a tmpfs for /var/tmp/portage so building takes place in RAM
56 # this feature requires a pretty large tmpfs ({open,libre}office needs ~8GB to build)
57 # WARNING: If you use too much RAM everything will fail horribly and it is not our fault.
58
59 diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
60 index ae7d97c..b5efe05 100644
61 --- a/modules/generic_stage_target.py
62 +++ b/modules/generic_stage_target.py
63 @@ -226,6 +226,12 @@ class generic_stage_target(generic_target):
64 self.mountmap["/var/cache/icecream"]="/var/cache/icecream"
65 self.env["PATH"]="/usr/lib/icecc/bin:"+self.env["PATH"]
66
67 + if self.settings.has_key("port_logdir"):
68 + self.mounts.append("/var/log/portage")
69 + self.mountmap["/var/log/portage"]=self.settings["port_logdir"]
70 + self.env["PORT_LOGDIR"]="/var/log/portage"
71 + self.env["PORT_LOGDIR_CLEAN"]='find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +30 -delete'
72 +
73 def override_cbuild(self):
74 if self.makeconf.has_key("CBUILD"):
75 self.settings["CBUILD"]=self.makeconf["CBUILD"]
76
77 diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
78 index fecbad4..35ffbaa 100644
79 --- a/targets/support/chroot-functions.sh
80 +++ b/targets/support/chroot-functions.sh
81 @@ -64,7 +64,7 @@ get_libdir() {
82
83 setup_myfeatures(){
84 setup_myemergeopts
85 - export FEATURES="-news"
86 + export FEATURES="-news clean-logs"
87 if [ -n "${clst_CCACHE}" ]
88 then
89 export clst_myfeatures="${clst_myfeatures} ccache"