Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 184779
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: SpanKY <vapier@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Ulrich Müller <ulm@gentoo.org>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
eclass-to-manpage.awk.diff Proposed patch for eclass-to-manpage.awk patch Ulrich Müller 2007-07-09 21:34 0000 2.20 KB Details | Diff
eclass-to-manpage.awk.diff Proposed patch for eclass-to-manpage.awk patch Ulrich Müller 2007-07-10 22:13 0000 2.20 KB Details | Diff
eutils.eclass.patch Patch for eutils.eclass patch Ulrich Müller 2007-07-15 21:12 0000 435 bytes Details | Diff
eclass-to-manpage.awk.diff Updated patch for eclass-to-manpage.awk patch Ulrich Müller 2007-07-24 09:08 0000 434 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 184779 depends on: Show dependency tree
Bug 184779 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-07-09 21:25 0000
While trying to convert the (rather lengthy) documentation in
elisp-common.eclass to a format that can be processed with
eclass-to-manpage.awk, I discovered that the parsing of the awk script is
somewhat fragile.

Especially, I think it is not a good idea to have significant trailing
whitespace: An empty comment line will end paragraph parsing, while a comment
line containing one blank does not. (Also, trailing whitespace is not allowed
in ebuilds and the "Eclass Howto" says that eclasses have the same syntax as
ordinary ebuilds.)

Attached patch will make parsing more robust.

------- Comment #1 From Ulrich Müller 2007-07-09 21:34:08 0000 -------
Created an attachment (id=124365) [details]
Proposed patch for eclass-to-manpage.awk

Following changes:
1. Trailing whitespace is no longer significant. (So an empty comment line
   doesn't end paragraph parsing anymore. Use an empty line or a line like
   "# @END" for that.)
2. Don't distinguish between spaces and TABs.
3. Canonical order of man page sections, "SEE ALSO" should be last.

------- Comment #2 From Ulrich Müller 2007-07-10 22:13:46 0000 -------
Created an attachment (id=124487) [details]
Proposed patch for eclass-to-manpage.awk

------- Comment #3 From Ulrich Müller 2007-07-15 21:12:38 0000 -------
Created an attachment (id=124963) [details]
Patch for eutils.eclass

eutils.eclass is the only eclass with man page documentation so far.

This trivial patch should be applied, so that it will give the same result with
the changed awk as before.

------- Comment #4 From Ulrich Müller 2007-07-20 05:56:43 0000 -------
Hah! It was bound to happen:

RCS file: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v
Working file: eutils.eclass
head: 1.286
[...]
revision 1.286
date: 2007-07-17 13:59:18 +0200;  author: swegener;  state: Exp;  lines: +10
-10;  commitid: 23f6469caf084567;
Apply whitespace checks from repoman to eclasses.

------- Comment #5 From SpanKY 2007-07-20 05:59:55 0000 -------
swegener: you fail :p

i'll see about merging your updates this weekend, thanks

------- Comment #6 From Sven Wegener 2007-07-20 11:01:57 0000 -------
:(

------- Comment #7 From SpanKY 2007-07-24 07:59:46 0000 -------
do you really need all the extraneous whitespace allowance or did you add it
for completeness sake ?  i merged the obvious fix to allow paragraphs to flow
over comment blocks that lack trailing whitespace ...

------- Comment #8 From Ulrich Müller 2007-07-24 09:08:16 0000 -------
Created an attachment (id=125858) [details]
Updated patch for eclass-to-manpage.awk

(In reply to comment #7)
> do you really need all the extraneous whitespace allowance or did you add
> it for completeness sake ?  i merged the obvious fix to allow paragraphs
> to flow over comment blocks that lack trailing whitespace ...

Hmm... Now eat_paragraph will terminate on a comment line containing only
whitespace, i.e. your previous syntax will not work anymore (and trailing
whitespace is still significant, but the other way around).

I think attached patch should be merged in addition. The rest (of my previous
patch) is not essential.

------- Comment #9 From Ulrich Müller 2007-07-25 05:18:13 0000 -------
I just committed elisp{,-common}.eclass which contains some code snippets (we
briefly discussed it on IRC yesterday). After applying the patch from
attachment #125858 [details] this works without further changes due to the following
groff feature (section 5.1.5 "Implicit Line Breaks"):

| A line that begins with a space causes a break and the space is output
| at the beginning of the next line. Note that this space isn't adjusted,
| even in fill mode.

Especially there is no need for .nf/.fi pairs.

------- Comment #10 From Ulrich Müller 2007-08-15 13:24:29 0000 -------
O.K., now there is @CODE. But AFAICS you cannot use indented code snippets
since the parser eats the indentation, i.e. the leading white space.

The patch from attachment #125858 [details] will fix it.

------- Comment #11 From Ulrich Müller 2007-08-22 07:34:08 0000 -------
(In reply to comment #8)
> Created an attachment (id=125858) [edit] [details]
> Updated patch for eclass-to-manpage.awk

Any objections if I commit this change myself?

------- Comment #12 From Ulrich Müller 2007-08-30 21:25:24 0000 -------
> Any objections if I commit this change myself?

Seems not to be the case - committed.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug