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).
This commit is contained in:
parent
0d9ff7f075
commit
68807e5f37
8 changed files with 120 additions and 15 deletions
22
ChangeLog
22
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.
|
||||
|
|
15
Makefile.in
15
Makefile.in
|
@ -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 \
|
||||
|
|
46
configure
vendored
46
configure
vendored
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
:
|
||||
|
|
Loading…
Reference in a new issue