Make sure that elog entries are also processed in *rm phases and that they are only...
authorZac Medico <zmedico@gentoo.org>
Wed, 21 Jun 2006 03:15:05 +0000 (03:15 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 21 Jun 2006 03:15:05 +0000 (03:15 -0000)
svn path=/main/branches/2.1/; revision=3576

pym/portage.py

index 0abfb87996de9e7db701d7647e621d61c00a6003..dad2583bc2fbd2ef71e4c730a4762fa276b1f94e 100644 (file)
@@ -508,6 +508,13 @@ def elog_process(cpv, mysettings):
                except portage_exception.PortageException, e:
                        print e
 
+       # clean logfiles to avoid repetitions
+       for f in mylogfiles:
+               try:
+                       os.unlink(os.path.join(mysettings["T"], "logging", f))
+               except OSError:
+                       pass
+
 #parse /etc/env.d and generate /etc/profile.env
 
 def env_update(makelinks=1, target_root=None, prev_mtimes=None):
@@ -6145,6 +6152,10 @@ class dblink:
                        a = doebuild(myebuildpath, "postrm", self.myroot, self.settings,
                         use_cache=0, tree="vartree", mydbapi=self.vartree.dbapi,
                         vartree=self.vartree)
+                       
+                       # process logs created during pre/postrm
+                       elog_process(self.mycpv, self.settings)
+                       
                        # XXX: Decide how to handle failures here.
                        if a != 0:
                                writemsg("!!! FAILED postrm: "+str(a)+"\n", noiselevel=-1)