Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 991 - general support for syslog-style portage logging
Summary: general support for syslog-style portage logging
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Low normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 1646 6084 11360 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-03-06 17:34 UTC by Nathaniel Pinckney
Modified: 2011-10-30 22:18 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nathaniel Pinckney 2002-03-06 17:34:22 UTC
This patch is for /usr/lib/portage/pym/portage.py and adds some code so it will append to /var/log/ebuild.log (easily changable) for most actions.

The log will look similar to something like this:

20020306.150925: Ebuild: clean on /usr/portage/app-misc/gentoo/gentoo-0.11.18.ebuild
20020306.150925: Ebuild: merge on /usr/portage/app-misc/gentoo/gentoo-0.11.18.ebuild
20020306.152115: Ebuild: unmerge on /var/db/pkg/app-misc/rox-1.1.8-r2/rox-1.1.8-r2.ebuild
20020306.152116: Ebuild: prerm on //var/db/pkg/app-misc/rox-1.1.8-r2/rox-1.1.8-r2.ebuild
20020306.152116: Ebuild: postrm on //var/db/pkg/app-misc/rox-1.1.8-r2/rox-1.1.8-r2.ebuild

A handy use for this is when you want to get the system back to a previous state (after you find out some package that installed 50 libraries sucks ;)), you can see what dependencys were installed when you installed a package.

Let me know what you think,
Thanks,
Nathaniel <nathaniel37@yahoo.com>



--- portage.py.orig     Wed Mar  6 15:05:45 2002
+++ portage.py  Wed Mar  6 15:09:21 2002
@@ -76,6 +76,9 @@
 import shutil
 import xpak
 import re
+import time
+
+elogfi='/var/log/ebuild.log'
 
 # master category list.  Any new categories should be added to this list to
 # ensure that they all categories are read when we check the portage directory
@@ -688,6 +691,10 @@
        a=open(settings["T"]+"/src_uri_all","w")
        a.write(flatten(alluris))
        a.close()
+
+       logfi = open(elogfi,'a')
+       logfi.write('%s: Ebuild: %s on %s\n' % (time.strftime('%Y%m%d.%H%M%S',ti
me.localtime(time.time())),mydo,myebuild));
+       logfi.close();
        
        if mydo=="unpack": 
                if settings["MAINTAINER_noauto"]=="1":
Comment 1 Daniel Robbins (RETIRED) gentoo-dev 2002-03-15 01:24:19 UTC
pretty neat :)
Comment 2 Bruce A. Locke (RETIRED) gentoo-dev 2002-07-14 15:24:35 UTC
*** Bug 1646 has been marked as a duplicate of this bug. ***
Comment 3 Bruce A. Locke (RETIRED) gentoo-dev 2002-07-14 15:27:14 UTC
Might as well convert this bug to a general request for emerge to support logging...
Comment 4 Daniel Robbins (RETIRED) gentoo-dev 2002-09-03 15:46:35 UTC
*** Bug 6084 has been marked as a duplicate of this bug. ***
Comment 5 Nicholas Jones (RETIRED) gentoo-dev 2002-10-22 22:54:25 UTC
basic logging will be in 2.0.42
Comment 6 SpanKY gentoo-dev 2003-01-08 14:18:23 UTC
*** Bug 11360 has been marked as a duplicate of this bug. ***
Comment 7 SpanKY gentoo-dev 2003-10-23 09:10:52 UTC
review /var/log/emerge.log