From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JNaoP-00076m-Ar for mharc-grub-devel@gnu.org; Fri, 08 Feb 2008 16:31:09 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JNaoO-00076f-Ix for grub-devel@gnu.org; Fri, 08 Feb 2008 16:31:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JNaoJ-00075V-Vu for grub-devel@gnu.org; Fri, 08 Feb 2008 16:31:08 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNaoJ-00075N-JV for grub-devel@gnu.org; Fri, 08 Feb 2008 16:31:03 -0500 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JNaoI-0003uh-Bg for grub-devel@gnu.org; Fri, 08 Feb 2008 16:31:02 -0500 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JNaoC-0007VF-L1 for grub-devel@gnu.org; Fri, 08 Feb 2008 22:31:01 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1JNamK-0007q0-7U for grub-devel@gnu.org; Fri, 08 Feb 2008 22:29:00 +0100 Date: Fri, 8 Feb 2008 22:29:00 +0100 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20080208212900.GA30078@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline Content-Transfer-Encoding: 8bit Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] manpages for everything X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2008 21:31:08 -0000 --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hey, I just wrote manpages for everything! Well, actually I wrote this patch that makes our build system probe for help2man, and use it to generate a manpage automatically for each utility. :-) They can be a good substitute for the info manual we don't have yet, or (in the future) a complement to it. -- Robert Millan I know my rights; I want my phone call! What use is a phone call… if you are unable to speak? (as seen on /.) --VS++wcV0S1rZb1Fb Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="manpages.diff" 2008-02-08 Robert Millan * configure.ac: Probe for `help2man'. * Makefile.in (builddir): New variable. (HELP2MAN): Likewise. Set to `true' when @HELP2MAN@ doesn't provide it. (install-local): For every executable utility or script that is installed, invoke $(HELP2MAN) to install a manpage based on --help output. * util/i386/pc/grub-install.in: Move down `update-grub_lib' sourcing, so that it doesn't prevent --help from working in build tree. * util/i386/pc/grub-mkrescue.in (usage): Replace `grub-devel@gnu.org' with `bug-grub@gnu.org'. * util/powerpc/ieee1275/grub-mkrescue.in (usage): Likewise. * util/update-grub.in (usage): New function. Implement proper argument check, with support for --help and --version (as well as existing -y). diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/configure.ac ./configure.ac --- ../grub2/configure.ac 2008-02-04 20:56:11.000000000 +0100 +++ ./configure.ac 2008-02-08 20:51:30.000000000 +0100 @@ -115,8 +115,9 @@ AC_PROG_INSTALL AC_PROG_AWK AC_PROG_MAKE_SET -# This is not a "must". +# These are not a "must". AC_PATH_PROG(RUBY, ruby) +AC_PATH_PROG(HELP2MAN, help2man) # # Checks for host programs. diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/Makefile.in ./Makefile.in --- ../grub2/Makefile.in 2008-02-04 20:56:11.000000000 +0100 +++ ./Makefile.in 2008-02-08 22:14:45.000000000 +0100 @@ -20,6 +20,7 @@ SHELL = /bin/sh transform = @program_transform_name@ srcdir = @srcdir@ +builddir = @builddir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ @@ -71,6 +72,10 @@ OBJCOPY = @OBJCOPY@ STRIP = @STRIP@ NM = @NM@ RUBY = @RUBY@ +HELP2MAN = @HELP2MAN@ +ifeq (, $(HELP2MAN)) +HELP2MAN = true +endif AWK = @AWK@ LIBCURSES = @LIBCURSES@ LIBLZO = @LIBLZO@ @@ -157,27 +162,31 @@ install-local: all dest="`echo $$file | sed 's,.*/,,'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkgdatadir)/$$dest; \ done - $(mkinstalldirs) $(DESTDIR)$(bindir) + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir) @list='$(bin_UTILITIES)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ + $(HELP2MAN) --no-info $(builddir)/$$file > $(DESTDIR)$(mandir)/$$dest.1; \ done - $(mkinstalldirs) $(DESTDIR)$(sbindir) + $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir) @list='$(sbin_UTILITIES)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ + $(HELP2MAN) --no-info $(builddir)/$$file > $(DESTDIR)$(mandir)/$$dest.8; \ done @list='$(bin_SCRIPTS)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ + $(HELP2MAN) --no-info $(builddir)/$$file > $(DESTDIR)$(mandir)/$$dest.1; \ done @list='$(sbin_SCRIPTS)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ + $(HELP2MAN) --no-info $(builddir)/$$file > $(DESTDIR)$(mandir)/$$dest.8; \ done $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d @list='$(update-grub_SCRIPTS)'; for file in $$list; do \ diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/util/i386/pc/grub-install.in ./util/i386/pc/grub-install.in --- ../grub2/util/i386/pc/grub-install.in 2008-01-12 16:11:57.000000000 +0100 +++ ./util/i386/pc/grub-install.in 2008-02-08 22:03:01.000000000 +0100 @@ -45,9 +45,6 @@ force_lba= recheck=no debug=no -# for make_system_path_relative_to_its_root() -. ${libdir}/grub/update-grub_lib - # Usage: usage # Print the usage. usage () { @@ -120,6 +117,9 @@ for option in "$@"; do esac done +# for make_system_path_relative_to_its_root() +. ${libdir}/grub/update-grub_lib + if test "x$install_device" = x; then echo "install_device not specified." 1>&2 usage diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/util/i386/pc/grub-mkrescue.in ./util/i386/pc/grub-mkrescue.in --- ../grub2/util/i386/pc/grub-mkrescue.in 2008-02-03 19:31:02.000000000 +0100 +++ ./util/i386/pc/grub-mkrescue.in 2008-02-08 22:12:09.000000000 +0100 @@ -49,7 +49,7 @@ Make GRUB rescue image. grub-mkimage generates a bootable rescue image of the specified type. -Report bugs to . +Report bugs to . EOF } diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/util/powerpc/ieee1275/grub-mkrescue.in ./util/powerpc/ieee1275/grub-mkrescue.in --- ../grub2/util/powerpc/ieee1275/grub-mkrescue.in 2008-01-31 18:09:39.000000000 +0100 +++ ./util/powerpc/ieee1275/grub-mkrescue.in 2008-02-08 22:12:26.000000000 +0100 @@ -48,7 +48,7 @@ Make GRUB rescue image. grub-mkimage generates a bootable rescue CD image for PowerMac and CHRP. -Report bugs to . +Report bugs to . EOF } diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/util/update-grub.in ./util/update-grub.in --- ../grub2/util/update-grub.in 2008-01-12 16:11:56.000000000 +0100 +++ ./util/update-grub.in 2008-02-08 22:05:29.000000000 +0100 @@ -31,6 +31,41 @@ platform=@platform@ grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` +# Usage: usage +# Print the usage. +usage () { + cat <. +EOF +} + +# Check the arguments. +for option in "$@"; do + case "$option" in + -h | --help) + usage + exit 0 ;; + -v | --version) + echo "$0 (GNU GRUB ${PACKAGE_VERSION})" + exit 0 ;; + -y) + echo "$0: warning: Ignoring -y option (no longer needed)." >&2 + ;; + -*) + echo "Unrecognized option \`$option'" 1>&2 + usage + exit 1 + ;; + esac +done + # for convert_system_path_to_grub_path(), font_path() . ${libdir}/grub/update-grub_lib @@ -43,10 +78,6 @@ if [ "$UID" != 0 ] ; then exit 1 fi -if [ "$1" = "-y" ] ; then - echo "$0: warning: Ignoring -y option (no longer needed)." >&2 -fi - set $grub_mkdevicemap dummy if test -f "$1"; then : --VS++wcV0S1rZb1Fb--