]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-02-09 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Sat, 9 Feb 2008 12:31:11 +0000 (12:31 +0000)
committerrobertmh <robertmh@localhost>
Sat, 9 Feb 2008 12:31:11 +0000 (12:31 +0000)
        * configure.ac: Probe for `help2man'.
        * Makefile.in (builddir): New variable.
        (HELP2MAN): Likewise.  Set to `true' when @HELP2MAN@ doesn't provide it,
        or otherwise add a few flags/options to 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).

ChangeLog
Makefile.in
configure
configure.ac
util/i386/pc/grub-install.in
util/i386/pc/grub-mkrescue.in
util/powerpc/ieee1275/grub-mkrescue.in
util/update-grub.in

index 7e84a1ec836cea2a3eb3114051f984925a2e43bc..6de01cff1cb357f6c2123a40fcb7596c27d0862a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,24 @@
-2008-02-08  Christian Franke  <franke@computer.org>
+2008-02-09  Robert Millan  <rmh@aybabtu.com>
+
+       * configure.ac: Probe for `help2man'.
+       * Makefile.in (builddir): New variable.
+       (HELP2MAN): Likewise.  Set to `true' when @HELP2MAN@ doesn't provide it,
+       or otherwise add a few flags/options to 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).
+
+2008-02-09  Christian Franke  <franke@computer.org>
 
        * commands/cat.c (grub_cmd_cat): Print '\r' as hex to
        avoid overwriting previous output.
index ba07577952eb1ac13f0059769db226f8eb1bfcf0..c2f432ff3776281584dc491a420b435627063791 100644 (file)
@@ -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,12 @@ OBJCOPY = @OBJCOPY@
 STRIP = @STRIP@
 NM = @NM@
 RUBY = @RUBY@
+HELP2MAN = @HELP2MAN@
+ifeq (, $(HELP2MAN))
+HELP2MAN = true
+else
+HELP2MAN := LANG=C $(HELP2MAN) --no-info --source=FSF
+endif
 AWK = @AWK@
 LIBCURSES = @LIBCURSES@
 LIBLZO = @LIBLZO@
@@ -157,27 +164,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)/man1
        @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) --section=1 $(builddir)/$$file > $(DESTDIR)$(mandir)/man1/$$dest.1; \
        done
-       $(mkinstalldirs) $(DESTDIR)$(sbindir)
+       $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8
        @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) --section=8 $(builddir)/$$file > $(DESTDIR)$(mandir)/man8/$$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) --section=1 $(builddir)/$$file > $(DESTDIR)$(mandir)/man1/$$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) --section=8 $(builddir)/$$file > $(DESTDIR)$(mandir)/man8/$$dest.8; \
        done
        $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d
        @list='$(update-grub_SCRIPTS)'; for file in $$list; do \
index 99e2eede17504069e368a75f917957c73cc16a95..9177d9c7d098fd3d5ce2a596cd2b74f432dd3f64 100644 (file)
--- a/configure
+++ b/configure
@@ -674,6 +674,7 @@ INSTALL_DATA
 AWK
 SET_MAKE
 RUBY
+HELP2MAN
 CC
 CFLAGS
 LDFLAGS
@@ -2237,7 +2238,7 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
-# This is not a "must".
+# These are not a "must".
 # Extract the first word of "ruby", so it can be a program name with args.
 set dummy ruby; ac_word=$2
 { echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -2278,6 +2279,46 @@ echo "${ECHO_T}no" >&6; }
 fi
 
 
+# Extract the first word of "help2man", so it can be a program name with args.
+set dummy help2man; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_HELP2MAN+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $HELP2MAN in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_HELP2MAN="$HELP2MAN" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+HELP2MAN=$ac_cv_path_HELP2MAN
+if test -n "$HELP2MAN"; then
+  { echo "$as_me:$LINENO: result: $HELP2MAN" >&5
+echo "${ECHO_T}$HELP2MAN" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
 
 #
 # Checks for host programs.
@@ -8844,6 +8885,7 @@ INSTALL_DATA!$INSTALL_DATA$ac_delim
 AWK!$AWK$ac_delim
 SET_MAKE!$SET_MAKE$ac_delim
 RUBY!$RUBY$ac_delim
+HELP2MAN!$HELP2MAN$ac_delim
 CC!$CC$ac_delim
 CFLAGS!$CFLAGS$ac_delim
 LDFLAGS!$LDFLAGS$ac_delim
@@ -8870,7 +8912,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 84; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 73f60875f433dbbc31d149c8abc14e52c4b27c96..38c957243fd97d3153fec62b55cc9729be9888de 100644 (file)
@@ -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.
index 4428816fa5f8e729650dae888d505ab41000041f..34e98e9f42c15fba15ae586e2acfc2775699a042 100644 (file)
@@ -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
index 835f7318902407279bae177e2e9518218d379d40..620c0f0936c584d83c3201d55daa2b21217cc869 100644 (file)
@@ -49,7 +49,7 @@ Make GRUB rescue image.
 
 grub-mkimage generates a bootable rescue image of the specified type.
 
-Report bugs to <grub-devel@gnu.org>.
+Report bugs to <bug-grub@gnu.org>.
 EOF
 }
 
index 61495abcdadfb8ba6f9a8f349a8137b211c97043..8e72eac8b5b784803611bbb74c1d9439a44653da 100644 (file)
@@ -48,7 +48,7 @@ Make GRUB rescue image.
 
 grub-mkimage generates a bootable rescue CD image for PowerMac and CHRP.
 
-Report bugs to <grub-devel@gnu.org>.
+Report bugs to <bug-grub@gnu.org>.
 EOF
 }
 
index ed8864529889568f88a0e96d040e150c56abc90b..b4bb6058d04df63dd9809e63eb325ef5757a02d6 100644 (file)
@@ -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
+Usage: $0 [OPTION]
+Generate /boot/grub/grub.cfg
+
+  -h, --help              print this message and exit
+  -v, --version           print the version information and exit
+  -y                      ignored for compatibility
+
+Report bugs to <bug-grub@gnu.org>.
+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
     :