1 |
On Sunday 23 October 2005 00:08, Marius Mauch wrote: |
2 |
> - needs better integration of isolated-functions.sh, probably should be |
3 |
> a separate patch (Brian?) |
4 |
|
5 |
Not sure what you mean by better as I'm happy with the current method. Other |
6 |
than the hardcoded path, it should work fine... |
7 |
|
8 |
> - module loader should be improved somehow (low priority) |
9 |
> - logging currenty only occurs after successful merges |
10 |
> - probably more that I can't remember atm |
11 |
|
12 |
I don't mind any of these. |
13 |
|
14 |
|
15 |
--- pym/portage.py (revision 2155) |
16 |
+++ pym/portage.py (working copy) |
17 |
|
18 |
+ # exploit listdir() file order so we process log entries in cronological order |
19 |
+ mylogfiles.reverse() |
20 |
|
21 |
Exploiting listdir()'s ordering is a bad idea. A bugfix to it could quite |
22 |
possibly change the ordering returned. Looking at cacheddir(), results are |
23 |
current being returned in filesystem order. |
24 |
|
25 |
Seeing that interspersed einfo and ewarn calls will be separated by class |
26 |
anyway, is there any need to play with the ordering at all? As far as the |
27 |
rest of the code goes, it only affects whether INFO comes before WARN or |
28 |
not. Phases themselves come out in the correct order regardless. |
29 |
|
30 |
+ for s in logsystems: |
31 |
+ try: |
32 |
+ # FIXME: ugly ad.hoc import code |
33 |
+ # TODO: implement a common portage module loader |
34 |
+ logmodule = __import__("elog_modules.mod_"+s) |
35 |
+ m = getattr(logmodule, "mod_"+s) |
36 |
+ m.process(mysettings, cpv, mylogentries, fulllog) |
37 |
+ except (ImportError, AttributeError), e: |
38 |
+ print "!!! Error while importing logging modules:" |
39 |
+ print e |
40 |
|
41 |
print "!!! Error while importing logging module %s:" % s |
42 |
would be better in case the exception doesn't contain the module name. |
43 |
|
44 |
|
45 |
--- pym/portage_const.py (revision 2155) |
46 |
+++ pym/portage_const.py (working copy) |
47 |
|
48 |
+EBUILD_PHASES = "setup unpack compile test install preinst postinst prerm postrm" |
49 |
|
50 |
This constant is can only ever be used as a list. It should be defined |
51 |
that way. It might also be worth combining this list into the keys of |
52 |
actionmap_deps. |
53 |
|
54 |
|
55 |
--- bin/isolated-functions.sh (revision 0) |
56 |
+++ bin/isolated-functions.sh (revision 0) |
57 |
|
58 |
+esyslog() { |
59 |
+ local pri= |
60 |
+ local tag= |
61 |
+ |
62 |
+ if [ -x /usr/bin/logger ] |
63 |
+ then |
64 |
+ pri="$1" |
65 |
+ tag="$2" |
66 |
+ |
67 |
+ shift 2 |
68 |
+ [ -z "$*" ] && return 0 |
69 |
+ |
70 |
+ /usr/bin/logger -p "${pri}" -t "${tag}" -- "$*" |
71 |
+ fi |
72 |
+ |
73 |
+ return 0 |
74 |
+} |
75 |
|
76 |
What's this one for? Ebuilds should never be logging to syslog directly... |
77 |
|
78 |
-- |
79 |
Jason Stubbs |
80 |
-- |
81 |
gentoo-portage-dev@g.o mailing list |