1 |
On Tue, 16 Feb 2016 22:48:08 -0600 |
2 |
Ryan Hill <rhill@g.o> wrote: |
3 |
|
4 |
> On Mon, 15 Feb 2016 15:35:12 +0100 |
5 |
> Michał Górny <mgorny@g.o> wrote: |
6 |
> > On Mon, 15 Feb 2016 14:37:41 +0100 |
7 |
> > "Justin Lecher (jlec)" <jlec@g.o> wrote: |
8 |
> > > On 15/02/16 13:59, Michał Górny wrote: |
9 |
> > > > On Mon, 15 Feb 2016 09:16:53 +0100 |
10 |
> > > > "Justin Lecher (jlec)" <jlec@g.o> wrote: |
11 |
> > > >> _isdp_big-warning() { |
12 |
> > > >> debug-print-function ${FUNCNAME} "${@}" |
13 |
> > > >> case ${1} in |
14 |
> > > >> pre-check ) |
15 |
> > > >> echo "" |
16 |
> > > > Don't mix echo with ewarn. |
17 |
> > > Why? |
18 |
> > Because they won't go through the same output channels. |
19 |
> |
20 |
> That's kinda the point. You want a blank (unstarred) space |
21 |
> to separate out the "important" messages from the generic |
22 |
> spew put out by the package manager/eclasses/build system |
23 |
> that you have no control over. |
24 |
|
25 |
This is not just that. Different output channels mean that: |
26 |
|
27 |
- some of them can be turned off. In this case, you end up with empty |
28 |
lines and no message. |
29 |
|
30 |
- There is no guarantee of correct output order! The empty lines may |
31 |
move randomly over the text. |
32 |
|
33 |
- When the function happens to be used in $(), part of the output will |
34 |
be collected (not that it's 100% valid concern right now because |
35 |
EAPI 6 doesn't guarantee e* using stderr yet). |
36 |
|
37 |
> If you have several different messages you want a blank space |
38 |
> in between them so you can use e* to create whitespace within |
39 |
> the message to avoid the wall of text syndrome while still |
40 |
> making it clear where it begins and ends. |
41 |
> |
42 |
> Let's take openrc for example (not picking on anyone, it's just |
43 |
> the last package with a bunch of different post-install messages |
44 |
> I happened to emerge). |
45 |
> |
46 |
> Currently: |
47 |
> |
48 |
> * The OpenRC dependency data has already been migrated. |
49 |
> * Caching service dependencies ... [ ok ] |
50 |
> * In this version of OpenRC, the loopback interface no longer |
51 |
> * satisfies the net virtual. |
52 |
> * If you have services now which do not start because of this, |
53 |
> * They can be fixed by adding rc_need="!net" |
54 |
> * to the /etc/conf.d/<servicename> file. |
55 |
> * You should also file a bug against the service asking that |
56 |
> * need net be dropped from the dependencies. |
57 |
> * The bug you file should block the following tracker: |
58 |
> * https://bugs.gentoo.org/show_bug.cgi?id=439092 |
59 |
> * |
60 |
> * Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not |
61 |
> * fixed correctly in earlier versions of OpenRC. |
62 |
> * The correct fix is implemented in this version, but that |
63 |
> * means netmount needs to be added to the default runlevel if |
64 |
> * you are using nfs file systems. |
65 |
> * |
66 |
> * You should now update all files in /etc, using etc-update |
67 |
> * or equivalent before restarting any services or this host. |
68 |
> |
69 |
> This is pretty much unreadable to me. |
70 |
> |
71 |
> Better: |
72 |
> |
73 |
> * The OpenRC dependency data has already been migrated. |
74 |
> * Caching service dependencies ... [ ok ] |
75 |
> * |
76 |
> * In this version of OpenRC, the loopback interface no longer |
77 |
> * satisfies the net virtual. |
78 |
> * |
79 |
> * If you have services now which do not start because of this, |
80 |
> * They can be fixed by adding rc_need="!net" |
81 |
> * to the /etc/conf.d/<servicename> file. |
82 |
> * |
83 |
> * You should also file a bug against the service asking that |
84 |
> * need net be dropped from the dependencies. |
85 |
> * |
86 |
> * The bug you file should block the following tracker: |
87 |
> * https://bugs.gentoo.org/show_bug.cgi?id=439092 |
88 |
> * |
89 |
> * Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not |
90 |
> * fixed correctly in earlier versions of OpenRC. |
91 |
> * |
92 |
> * The correct fix is implemented in this version, but that |
93 |
> * means netmount needs to be added to the default runlevel if |
94 |
> * you are using nfs file systems. |
95 |
> * |
96 |
> * You should now update all files in /etc, using etc-update |
97 |
> * or equivalent before restarting any services or this host. |
98 |
> |
99 |
> This is better but you still have to read the whole thing to |
100 |
> make sure you didn't miss anything important. |
101 |
> |
102 |
> Even better: |
103 |
> |
104 |
> * The OpenRC dependency data has already been migrated. |
105 |
> * Caching service dependencies ... [ ok ] |
106 |
> |
107 |
> * In this version of OpenRC, the loopback interface no longer |
108 |
> * satisfies the net virtual. |
109 |
> * |
110 |
> * If you have services now which do not start because of this, |
111 |
> * They can be fixed by adding rc_need="!net" |
112 |
> * to the /etc/conf.d/<servicename> file. |
113 |
> * |
114 |
> * You should also file a bug against the service asking that |
115 |
> * need net be dropped from the dependencies. |
116 |
> * The bug you file should block the following tracker: |
117 |
> * |
118 |
> * https://bugs.gentoo.org/show_bug.cgi?id=439092 |
119 |
> |
120 |
> * Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not |
121 |
> * fixed correctly in earlier versions of OpenRC. |
122 |
> * |
123 |
> * The correct fix is implemented in this version, but that |
124 |
> * means netmount needs to be added to the default runlevel if |
125 |
> * you are using nfs file systems. |
126 |
> |
127 |
> * You should now update all files in /etc, using etc-update |
128 |
> * or equivalent before restarting any services or this host. |
129 |
> |
130 |
> Here I can read the first line of the second block and know I can |
131 |
> skip the next 12 lines without missing anything. The next block |
132 |
> isn't worded the greatest, but that's beside the point. And now |
133 |
> I get an important message at the end that I previously never |
134 |
> noticed because tl;dr. |
135 |
> |
136 |
> You're right that using echo means the whitespace doesn't get |
137 |
> saved by the elog system. A while back someone proposed we |
138 |
> add espace for exactly this reason but IIRC they were laughed |
139 |
> down, which is a shame. |
140 |
|
141 |
So... to summarize your point. You shouldn't use the correct function |
142 |
that is saved in elog which is primary way of getting info because you |
143 |
find it more convenient to have empty non-'starred' lines that don't |
144 |
actually get to elog and make elog a mess? |
145 |
|
146 |
If you really don't like empty 'starred' lines (and I actually like |
147 |
them since they make separation between packages cleaner), why not |
148 |
submit a patch for Portage and make 'elog' with no arguments output log |
149 |
line without a star? That's a trivial solution that doesn't require |
150 |
extra functions for the sake of inventing elogspace, ewarnspace, ... |
151 |
|
152 |
-- |
153 |
Best regards, |
154 |
Michał Górny |
155 |
<http://dev.gentoo.org/~mgorny/> |