On Fri, 28 Dec 2012 09:38:17 +0100
Joerg Mayer <[email protected]> wrote:

> Add version and description to manpage, make extension configurable.

Hello Jörg and thanks for your effort!

> Remove some trailing whitespace from manpage.

I have took these unrelated changes and merged them to my tested_stuff
branch, thanks.

> Note1: This requires sed during the build process. Is this acceptable?

I think no, not for building an *exported* source dump, but we do
something very similar for the svn version string, please see the
export target in the makefile and refine the patch accordingly.

> Note2: Apply patch, then rename flashrom.8 to flashrom.man.in

I am not sure if it should be renamed at all... the export target does
a similar thing to the makefile... of course renaming the makefile is a
bad idea, but I am not sure if renaming the manpage is a benefit either?

> Signed-off-by: Joerg Mayer <[email protected]>
> 
> Index: flashrom.8
> ===================================================================
> --- flashrom.8        (revision 1633)
> +++ flashrom.8        (working copy)
> @@ -1,4 +1,4 @@
> -.TH FLASHROM 8 "Dec, 2012"
> +.TH FLASHROM @MANEXT@ "@DATE@" "@VERSION@" "A flash programmer"

TBH the whole MANEXT thing is nonsense, although of course magic
numbers are not nice in general and I appreciate your thinking about
this.

The manpage sections indicate the topic of the program and this is a
unix "standard". 8 means system/admin utils and flashrom does not and
will never fit into any other category (maybe games? well you are
gambling with the system, but I think they meant that differently... :)
I have removed this part and all related bits. I have also removed the
additional header "A flash programmer", because I think it is clear
enough already and this line does not improve the situation.

> Index: Makefile
> ===================================================================
> --- Makefile  (revision 1633)
> +++ Makefile  (working copy)
> @@ -35,6 +35,7 @@
>  DIFF    = diff
>  PREFIX  ?= /usr/local
>  MANDIR  ?= $(PREFIX)/share/man
> +MANEXT  ?= 8

see above.

> +     sed -e "s#@MANEXT@#$(MANEXT)#g" -e "s#@VERSION@#$(VERSION)#g" -e 
> "s#@DATE@#$(DATE)#g" <$< >$@

The missing @ creates (arguably) unwanted output.

I have attached what remains. I am not sure we really want this kind of
feature, but I don't see a reason why we should not include it either
(after a refinement). One nice feature would be to automate the date
too... because this is the only problem this patches solves, that I see
in the current scheme (i.e. we forget to keep the date up to date :)
-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner
>From a0f150047ce8bb070f3b97bd03d647da17917d96 Mon Sep 17 00:00:00 2001
From: Stefan Tauner <[email protected]>
Date: Fri, 28 Dec 2012 11:03:53 +0100
Subject: [PATCH] Add version automatically to manpage.

Signed-off-by: Joerg Mayer <[email protected]>
---
 Makefile   |    8 ++++++--
 flashrom.8 |    2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 0425545..5214a4e 100644
--- a/Makefile
+++ b/Makefile
@@ -318,6 +318,7 @@ SVNVERSION := $(shell LC_ALL=C svnversion -cn . 2>/dev/null | sed -e "s/.*://" -
 RELEASE := 0.9.6.1
 VERSION := $(RELEASE)-r$(SVNVERSION)
 RELEASENAME ?= $(VERSION)
+DATE := Dec 2012
 
 SVNDEF := -D'FLASHROM_VERSION="$(VERSION)"'
 
@@ -608,7 +609,7 @@ FEATURE_LIBS += $(shell LC_ALL=C grep -q "NEEDLIBZ := yes" .libdeps && printf "%
 LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS)
 OBJS = $(CLI_OBJS) $(LIBFLASHROM_OBJS)
 
-all: hwlibs features $(PROGRAM)$(EXEC_SUFFIX)
+all: hwlibs features $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8
 ifeq ($(ARCH), x86)
 	@+$(MAKE) -C util/ich_descriptors_tool/ TARGET_OS=$(TARGET_OS) EXEC_SUFFIX=$(EXEC_SUFFIX)
 endif
@@ -632,7 +633,7 @@ TAROPTIONS = $(shell LC_ALL=C tar --version|grep -q GNU && echo "--owner=root --
 # This includes all frontends and libflashrom.
 # We don't use EXEC_SUFFIX here because we want to clean everything.
 clean:
-	rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a *.o *.d
+	rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a *.o *.d $(PROGRAM).8
 	@+$(MAKE) -C util/ich_descriptors_tool/ clean
 
 distclean: clean
@@ -826,6 +827,9 @@ endif
 	@$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features
 	@rm -f .featuretest.c .featuretest$(EXEC_SUFFIX)
 
+flashrom.8: flashrom.man.in
+	sed -e "s#@VERSION@#$(VERSION)#g" -e "s#@DATE@#$(DATE)#g" <$< >$@
+
 install: $(PROGRAM)$(EXEC_SUFFIX)
 	mkdir -p $(DESTDIR)$(PREFIX)/sbin
 	mkdir -p $(DESTDIR)$(MANDIR)/man8
diff --git a/flashrom.8 b/flashrom.8
index 102bd62..9bf02c9 100644
--- a/flashrom.8
+++ b/flashrom.8
@@ -1,4 +1,4 @@
-.TH FLASHROM 8 "Dec, 2012"
+.TH FLASHROM 8"@DATE@" "@VERSION@"
 .SH NAME
 flashrom \- detect, read, write, verify and erase flash chips
 .SH SYNOPSIS
-- 
Kind regards, Stefan Tauner

_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to