[PATCH wayland 3/5 v2] man: Properly handle multiple man page aliases

Jonas Ådahl jadahl at gmail.com
Wed Dec 5 13:53:05 PST 2012


On Wed, Dec 5, 2012 at 7:04 PM, David Herrmann
<dh.herrmann at googlemail.com> wrote:
> Hi Jonas
>
> On Sat, Dec 1, 2012 at 6:12 PM, Jonas Ådahl <jadahl at gmail.com> wrote:
>> Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
>> ---
>>
>> v2: Properly specify dependencies. Without this make -j8 fails.
>>
>>  doc/man/Makefile.am |    9 ++++++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
>> index 1407953..6d4fcd4 100644
>> --- a/doc/man/Makefile.am
>> +++ b/doc/man/Makefile.am
>> @@ -20,7 +20,7 @@ if HAVE_MANPAGES_STYLESHEET
>>
>>  CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES)
>>  EXTRA_DIST += $(MANPAGES) $(MANPAGES_ALIASES) $(XML_FILES)
>> -man_MANS += $(MANPAGES) $(MANPAGES_ALIASES)
>> +man_MANS += $(MANPAGES) $(MANPAGES_ALIASES) fixup_aliases
>>
>>  XSLTPROC_FLAGS = \
>>         --stringparam man.authors.section.enabled 0 \
>> @@ -31,8 +31,11 @@ XSLTPROC_FLAGS = \
>>
>>  XSLTPROC_PROCESS_MAN = \
>>         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
>> -       $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(MANPAGES_STYLESHEET) $< && \
>> -       $(SED) -i -e 's/^\.so \(.*\)\.\(.\)$$/\.so man\2\/\1\.\2/' $(MANPAGES_ALIASES)
>> +       $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(MANPAGES_STYLESHEET) $<
>> +
>> +fixup_aliases: $(MANPAGES_ALIASES)
>> +       $(SED) -i -e 's/^\.so \([a-z_]\+\)\.\([0-9]\)$$/\.so man\2\/\1\.\2/' \
>> +               $(MANPAGES_ALIASES)
>
> Could you explain the SED change here? I think the previous regexp
> matches a whole line and the new one also matches a whole line. How
> does that change the replacement?
> I'm just curios what corner case you found here that wasn't working previously.
>

The regular expression ^\.so \(.*\)\.\(.\)$ will match lines such as
man3/wl_display_connect.3 or man3/man3/wl_display_connect.3 because
the \(.*\) will match anything. Changing that part to \([^/]*\) would
avoid that but I made the match expression in the patch more picky.

Jonas


More information about the wayland-devel mailing list