Mailinglist Archive: radeonhd (621 mails)

< Previous Next >
Re: [radeonhd] [PATCH] Automatic man page update from rhd_id.c strings
  • From: Hans Ulrich Niedermann <hun@xxxxxxxxxxxxxxxx>
  • Date: Mon, 29 Oct 2007 15:53:13 +0100
  • Message-id: <4725F3D9.5050508@xxxxxxxxxxxxxxxx>
Matthias Hopf wrote:
On Oct 29, 07 13:21:21 +0100, Hans Ulrich Niedermann wrote:
All the required building blocks are contained in this patch:

* A program to be linked against rhd_id.c which prints the chipset
strings by calling RHDIdentify().
* sed(1) expressions and shell code to actually update the man page
using those strings.
* Example "make update-man" target which interactively updates the
man page in $(srcdir).

Question: why isn't rhd_id.c parsed instead of compiling a build tool
for extracting that information? Having rhd_id.c parsed would e.g. be
more cross-compiling friendly.

Two reasons:

a) I guessed that the output strings could be more easily made to
be something reasonable, even if someone decided to rewrite
RHDIdentify() to use the device list structs in rhd_id.c to
produce its output.

That guess might be wrong - I'm not part of your group of core
developers, obviously :)

b) Parsing a C program is definitely non-trivial compared to parsing
some simple text. Executing the code instead of parsing all the
#ifdefs and comments with sed seemed to be easier.

Well... it might be possible to use the proper C preprocessor
in a first step and only then parse the result with sed, but
that seems a lot less straightforward. It would remain to be
seen how portable that can be made. We currently do not
distinguish between CFLAGS and CPPFLAGS e.g., which requires
more changes all over the place.

I try not to propose too invasive changes to avoid the natural "All
those gazillion changes for just that little effect?" reactions, so
I'd quickly rule out such a CPPFLAGS/CFLAGS separation as a precursor to
the man page check.

* Interactive update of man page in source (this code).

I would rather do this as an intermediate step, performing this on each
and every man page compilation. A string like %CARD_IDS% could be
replaced by the card names.

This would boldly break cross-compilation on purpose, which I would not
dare suggest as a non-core developer :-)

Besides, I don't see a need to run all that complicated stuff on every
build - when it only needs to be run after a subset of rhd_id.c changes.

A good way IMHO would probably be to run the updater (whichever we end
up choosing) everytime "make all" is run in src/, if MAINTAINER_MODE.

That would remind the devopler who has modified the device list in
rhd_id.c but forgotten to update the man page - and that is the point of
the exercise, right?

--
Hans Ulrich Niedermann

< Previous Next >
Follow Ups