Skip to contentSkip to conversation

Unbreak help2man invocations

PATCH In review Grégoire Sutre 2 participants 3 messages Feb 10, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Unbreak help2man invocations

Following Vladimir's suggestion on IRC, the attached patch fixes bug http://savannah.gnu.org/bugs/?35452.

Grégoire

p.s. The patch uses @PACKAGE_TARNAME@ instead of @PACKAGE@ in the name of the directory that grub-mkconfig_lib is sourced from, to preserve the definition of pkgdatadir that was in grub-mkconfig.in. But I guess that those two are always equal for GRUB.

2012-02-10 Grégoire Sutre <[email protected]>

Source grub-mkconfig_lib from the build directory at build time. Suggested by: Vladimir Serbinenko.

* gentpl.py (manpage): Set pkgdatadir to $(builddir) on help2man call.
* util/grub-install.in: Define pkgdatadir if not already set, and source grub-mkconfig_lib from there.
* util/grub-kbdcomp.in: Likewise.
* util/grub-mkconfig.in: Likewise.
* util/grub-mknetdir.in: Likewise.
* util/grub-mkrescue.in: Likewise.
* util/grub-mkstandalone.in: Likewise.
* util/grub-reboot.in: Likewise.
* util/grub-set-default.in: Likewise.
* util/powerpc/ieee1275/grub-mkrescue.in: Likewise.

=== modified file 'gentpl.py'

gentpl.py +1 -1
@@ -465,7 +465,7 @@ def manpage():
     r += gvar_add("man_MANS", "[+ name +].[+ mansection +]\n")
     r += rule("[+ name +].[+ mansection +]", "[+ name +]", """
 chmod a+x [+ name +]
-PATH=$(builddir):$$PATH $(HELP2MAN) --section=[+ mansection +] -i $(top_srcdir)/docs/man/[+ name +].h2m -o $@ [+ name +]
+PATH=$(builddir):$$PATH pkgdatadir=$(builddir) $(HELP2MAN) --section=[+ mansection +] -i $(top_srcdir)/docs/man/[+ name +].h2m -o $@ [+ name +]
 """)
     r += gvar_add("CLEANFILES", "[+ name +].[+ mansection +]")
     r += "endif\n"

=== modified file 'util/grub-install.in'

grub-install.in +4 -1
@@ -34,6 +34,9 @@ platform=@platform@
 host_os=@host_os@
 pkglibdir="${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`"
 datadir="@datadir@"
+if [ "x$pkgdatadir" = x ]; then
+    pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`"
+fi
 localedir="@datadir@/locale"
 
 self="`basename $0`"
@@ -77,7 +80,7 @@ else
     disk_module=native
 fi
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+. "${pkgdatadir}/grub-mkconfig_lib"
 
 # Usage: usage
 # Print the usage.

=== modified file 'util/grub-kbdcomp.in'

grub-kbdcomp.in +4 -1
@@ -7,12 +7,15 @@ exec_prefix="@exec_prefix@"
 bindir="@bindir@"
 datarootdir="@datarootdir@"
 datadir="@datadir@"
+if [ "x$pkgdatadir" = x ]; then
+    pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`"
+fi
 
 grub_mklayout="${bindir}/`echo grub-mklayout | sed ${transform}`"
 
 ckbcomp_options=""
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+. "${pkgdatadir}/grub-mkconfig_lib"
 
 self=`basename $0`
 

=== modified file 'util/grub-mkconfig.in'

grub-mkconfig.in +4 -4
@@ -31,7 +31,9 @@ PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 host_os=@host_os@
 datadir="@datadir@"
-pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`"
+if [ "x$pkgdatadir" = x ]; then
+    pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`"
+fi
 grub_cfg=""
 grub_mkconfig_dir="${sysconfdir}"/grub.d
 
@@ -42,7 +44,7 @@ grub_script_check="${bindir}/`echo grub-
 
 GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"`
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+. "${pkgdatadir}/grub-mkconfig_lib"
 
 # Usage: usage
 # Print the usage.
@@ -95,8 +97,6 @@ do
     esac
 done
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
-
 if [ "x$EUID" = "x" ] ; then
   EUID=`id -u`
 fi

=== modified file 'util/grub-mknetdir.in'

grub-mknetdir.in +4 -1
@@ -30,6 +30,9 @@ PACKAGE_VERSION=@PACKAGE_VERSION@
 host_os=@host_os@
 pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
 datadir="@datadir@"
+if [ "x$pkgdatadir" = x ]; then
+    pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`"
+fi
 
 self=`basename $0`
 
@@ -52,7 +55,7 @@ efi32_dir="${libdir}/$(echo ${PACKAGE_TA
 efi64_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi"
 itanium_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/ia64-efi"
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+. "${pkgdatadir}/grub-mkconfig_lib"
 
 # Usage: usage
 # Print the usage.

=== modified file 'util/grub-mkrescue.in'

grub-mkrescue.in +4 -1
@@ -30,6 +30,9 @@ PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 datadir="@datadir@"
+if [ "x$pkgdatadir" = x ]; then
+    pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`"
+fi
 pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
 
 self=`basename $0`
@@ -46,7 +49,7 @@ grub_mkimage="${bindir}/`echo grub-mkima
 
 xorriso=xorriso
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+. "${pkgdatadir}/grub-mkconfig_lib"
 
 # Usage: usage
 # Print the usage.

=== modified file 'util/grub-mkstandalone.in'

grub-mkstandalone.in +4 -1
@@ -31,6 +31,9 @@ PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
 datadir="@datadir@"
+if [ "x$pkgdatadir" = x ]; then
+    pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`"
+fi
 
 self=`basename $0`
 
@@ -40,7 +43,7 @@ format=
 grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`"
 source=
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+. "${pkgdatadir}/grub-mkconfig_lib"
 
 # Usage: usage
 # Print the usage.

=== modified file 'util/grub-reboot.in'

grub-reboot.in +4 -1
@@ -26,6 +26,9 @@ PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 datarootdir="@datarootdir@"
 datadir="@datadir@"
+if [ "x$pkgdatadir" = x ]; then
+    pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`"
+fi
 
 self=`basename $0`
 
@@ -34,7 +37,7 @@ rootdir=
 bootdir=
 grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+. "${pkgdatadir}/grub-mkconfig_lib"
 
 # Usage: usage
 # Print the usage.

=== modified file 'util/grub-set-default.in'

grub-set-default.in +4 -1
@@ -26,6 +26,9 @@ PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
 datarootdir="@datarootdir@"
 datadir="@datadir@"
+if [ "x$pkgdatadir" = x ]; then
+    pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`"
+fi
 
 self=`basename $0`
 
@@ -34,7 +37,7 @@ rootdir=
 bootdir=
 grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+. "${pkgdatadir}/grub-mkconfig_lib"
 
 # Usage: usage
 # Print the usage.

=== modified file 'util/powerpc/ieee1275/grub-mkrescue.in'

powerpc/ieee1275/grub-mkrescue.in +4 -1
@@ -32,12 +32,15 @@ platform=@platform@
 pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}`
 datarootdir="@datarootdir@"
 datadir="@datadir@"
+if [ "x$pkgdatadir" = x ]; then
+    pkgdatadir="${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`"
+fi
 
 self=`basename $0`
 
 grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`"
 
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+. "${pkgdatadir}/grub-mkconfig_lib"
 
 # Usage: usage
 # Print the usage.
#1 lore raw
Quoted 3 lines · Grégoire Sutre

Following Vladimir's suggestion on IRC, the attached patch fixes bug http://savannah.gnu.org/bugs/?35452.

Go ahead.

Quoted 6 lines

Grégoire

p.s. The patch uses @PACKAGE_TARNAME@ instead of @PACKAGE@ in the name of the directory that grub-mkconfig_lib is sourced from, to preserve the definition of pkgdatadir that was in grub-mkconfig.in. But I guess that those two are always equal for GRUB.

@PACKAGE_TARNAME@ is more appropriate in this case but they are both equal in GRUB.

Quoted 6 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
#2 lore raw
Quoted 5 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 3 lines · Grégoire Sutre

Following Vladimir's suggestion on IRC, the attached patch fixes bug http://savannah.gnu.org/bugs/?35452.

Go ahead.

I've committed the patch and closed the bug report.

Grégoire