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