summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2012-10-29 15:40:45 -0400
committerRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2012-10-29 15:40:45 -0400
commit8ca52570aa2d0e14b848692ddf759212d81168e3 (patch)
treef8ae07f464e4dc296ea619bfdfdd8c9434d4251c
parentinitial support for /var/tmp/portage in tmpfs (diff)
downloadcatalyst-8ca52570aa2d0e14b848692ddf759212d81168e3.tar.gz
catalyst-8ca52570aa2d0e14b848692ddf759212d81168e3.tar.bz2
catalyst-8ca52570aa2d0e14b848692ddf759212d81168e3.zip
keep logs outside of chroot
Every time stage build is restarted, the build logs of the previous run are lost. This new feature allows the logs to be kept outside the chroot and thus protected from purging. This new feature forces portage to use FEATURES="clean-logs" no matter what, but it should have no effect on users not using the new functionality added by this patch. This new function is DISABLED per default due to a lack of feedback, however, it is highly suggested that this is made default for the next release cycle.
-rwxr-xr-xcatalyst3
-rw-r--r--files/catalyst.conf5
-rw-r--r--modules/generic_stage_target.py6
-rw-r--r--targets/support/chroot-functions.sh2
4 files changed, 15 insertions, 1 deletions
diff --git a/catalyst b/catalyst
index 483a6e53..ed3fbd5c 100755
--- a/catalyst
+++ b/catalyst
@@ -168,6 +168,9 @@ def parse_config(myconfig):
if myconf.has_key("var_tmpfs_portage"):
conf_values["var_tmpfs_portage"]=myconf["var_tmpfs_portage"];
+ if myconf.has_key("port_logdir"):
+ conf_values["port_logdir"]=myconf["port_logdir"];
+
def import_modules():
# import catalyst's own modules (i.e. catalyst_support and the arch modules)
targetmap={}
diff --git a/files/catalyst.conf b/files/catalyst.conf
index 49d2a15f..ea74eb16 100644
--- a/files/catalyst.conf
+++ b/files/catalyst.conf
@@ -81,6 +81,11 @@ snapshot_cache="/var/tmp/catalyst/snapshot_cache"
# also where it will put its temporary files and caches.
storedir="/var/tmp/catalyst"
+# port_logdir is where all build logs will be kept. This dir will be automatically cleaned
+# of all logs over 30 days old. If left undefined the logs will remain in the build directory
+# as usual and get cleaned every time a stage build is restarted.
+# port_logdir="/var/tmp/catalyst/tmp"
+
# var_tmpfs_portage will mount a tmpfs for /var/tmp/portage so building takes place in RAM
# this feature requires a pretty large tmpfs ({open,libre}office needs ~8GB to build)
# WARNING: If you use too much RAM everything will fail horribly and it is not our fault.
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index ae7d97cd..b5efe05e 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -226,6 +226,12 @@ class generic_stage_target(generic_target):
self.mountmap["/var/cache/icecream"]="/var/cache/icecream"
self.env["PATH"]="/usr/lib/icecc/bin:"+self.env["PATH"]
+ if self.settings.has_key("port_logdir"):
+ self.mounts.append("/var/log/portage")
+ self.mountmap["/var/log/portage"]=self.settings["port_logdir"]
+ self.env["PORT_LOGDIR"]="/var/log/portage"
+ self.env["PORT_LOGDIR_CLEAN"]='find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +30 -delete'
+
def override_cbuild(self):
if self.makeconf.has_key("CBUILD"):
self.settings["CBUILD"]=self.makeconf["CBUILD"]
diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
index fecbad42..35ffbaa5 100644
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -64,7 +64,7 @@ get_libdir() {
setup_myfeatures(){
setup_myemergeopts
- export FEATURES="-news"
+ export FEATURES="-news clean-logs"
if [ -n "${clst_CCACHE}" ]
then
export clst_myfeatures="${clst_myfeatures} ccache"