From b151fa14f49c2b5e4da7bdfdb5eaf29aaf985a7b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 22 Sep 2010 21:45:17 -0700 Subject: [PATCH] Add support for FEATURES=binpkg-logs which is similar to unmerge-logs, but applies to all binary package merges. --- cnf/make.globals | 3 ++- man/make.conf.5 | 4 ++++ pym/_emerge/Binpkg.py | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cnf/make.globals b/cnf/make.globals index 6679918fd..e3c17c5d1 100644 --- a/cnf/make.globals +++ b/cnf/make.globals @@ -44,7 +44,8 @@ FETCHCOMMAND_RSYNC="rsync -avP \"\${URI}\" \"\${DISTDIR}/\${FILE}\"" RESUMECOMMAND_RSYNC="rsync -avP \"\${URI}\" \"\${DISTDIR}/\${FILE}\"" # Default user options -FEATURES="assume-digests distlocks fixpackages fixlafiles news parallel-fetch protect-owned +FEATURES="assume-digests binpkg-logs distlocks fixpackages + fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" diff --git a/man/make.conf.5 b/man/make.conf.5 index 68137a816..a55e7fc97 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -209,6 +209,10 @@ existing digest, the digest will be regenerated regardless of whether or not \fIassume\-digests\fR is enabled. The \fBebuild\fR(1) \fBdigest\fR command has a \fB\-\-force\fR option that can be used to force regeneration of digests. .TP +.B binpkg\-logs +Keep logs from successful binary package merges. This is relevant only when +\fBPORT_LOGDIR\fR is set. +.TP .B buildpkg Binary packages will be created for all packages that are merged. Also see \fBquickpkg\fR(1) and \fBemerge\fR(1) \fB\-\-buildpkg\fR and diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py index 7fc11ea59..89f136106 100644 --- a/pym/_emerge/Binpkg.py +++ b/pym/_emerge/Binpkg.py @@ -318,5 +318,13 @@ class Binpkg(CompositeTask): finally: settings.pop("PORTAGE_BINPKG_FILE", None) self._unlock_builddir() + + if retval == os.EX_OK and \ + 'binpkg-logs' not in self.settings.features and \ + self.settings.get("PORTAGE_LOG_FILE"): + try: + os.unlink(self.settings["PORTAGE_LOG_FILE"]) + except OSError: + pass return retval -- 2.26.2