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