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