15a207
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
15a207
From: Peter Jones <pjones@redhat.com>
15a207
Date: Mon, 3 Aug 2015 11:46:42 -0400
15a207
Subject: [PATCH] Try to make sure configure.ac and grub-rpm-sort play nice.
15a207
15a207
Apparently the test for whether to use grub-rpm-sort and also the
15a207
renaming of it to grub2-rpm-sort on the runtime side weren't right.
15a207
15a207
Related: rhbz#1124074
15a207
15a207
Signed-off-by: Peter Jones <pjones@redhat.com>
15a207
---
15a207
 configure.ac              | 2 +-
15a207
 util/grub-mkconfig_lib.in | 9 ++++++---
15a207
 2 files changed, 7 insertions(+), 4 deletions(-)
15a207
15a207
diff --git a/configure.ac b/configure.ac
15a207
index 679f634ce4c..71d1056969e 100644
15a207
--- a/configure.ac
15a207
+++ b/configure.ac
15a207
@@ -1796,7 +1796,7 @@ AC_SUBST([LIBDEVMAPPER])
15a207
 AC_ARG_ENABLE([rpm-sort],
15a207
               [AS_HELP_STRING([--enable-rpm-sort],
15a207
                               [enable native rpm sorting of kernels in grub (default=guessed)])])
15a207
-if test x"$enable_rpm-sort" = xno ; then
15a207
+if test x"$enable_rpm_sort" = xno ; then
15a207
   rpm_sort_excuse="explicitly disabled"
15a207
 fi
15a207
 
15a207
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
15a207
index 7fe3598435c..113a41f9409 100644
15a207
--- a/util/grub-mkconfig_lib.in
15a207
+++ b/util/grub-mkconfig_lib.in
15a207
@@ -33,6 +33,9 @@ fi
15a207
 if test "x$grub_mkrelpath" = x; then
15a207
   grub_mkrelpath="${bindir}/@grub_mkrelpath@"
15a207
 fi
15a207
+if test "x$grub_rpm_sort" = x; then
15a207
+  grub_rpm_sort="${sbindir}/@grub_rpm_sort@"
15a207
+fi
15a207
 
15a207
 if which gettext >/dev/null 2>/dev/null; then
15a207
   :
15a207
@@ -214,10 +217,10 @@ version_sort ()
15a207
    esac
15a207
 }
15a207
 
15a207
-if [ "x$RPMLIB" = x ]; then
15a207
+if [ "x$grub_rpm_sort" != x -a -x "$grub_rpm_sort" ]; then
15a207
+  kernel_sort="$grub_rpm_sort"
15a207
+else
15a207
   kernel_sort=version_sort
15a207
-else
15a207
-  kernel_sort="${sbindir}/grub-rpm-sort"
15a207
 fi
15a207
 
15a207
 version_test_numeric ()