Blame SOURCES/0073-Fix-info-for-s390x-s390-1285601.patch

903092
From dab391a5c52622b4c08f87dc394f133419da218a Mon Sep 17 00:00:00 2001
903092
From: Robert Marshall <rmarshall@redhat.com>
903092
Date: Tue, 14 Mar 2017 15:20:53 -0400
903092
Subject: [PATCH 73/75] Fix --info for s390x/s390 (#1285601)
903092
903092
The --info flag for grubby on s390/s390x always returned (null). Fixed
903092
codepath to use extractTitle where necessary and get the actual title.
903092
903092
Related: rhbz#1285601
903092
---
903092
 grubby.c | 15 +++++++++++----
903092
 1 file changed, 11 insertions(+), 4 deletions(-)
903092
903092
diff --git a/grubby.c b/grubby.c
903092
index 4d3834b..f960ebd 100644
903092
--- a/grubby.c
903092
+++ b/grubby.c
903092
@@ -2782,7 +2782,7 @@ void setFallbackImage(struct grubConfig *config, int hasNew)
903092
 	}
903092
 }
903092
 
903092
-void displayEntry(struct singleEntry *entry, const char *prefix, int index)
903092
+void displayEntry(struct grubConfig *config, struct singleEntry *entry, const char *prefix, int index)
903092
 {
903092
 	struct singleLine *line;
903092
 	char *root = NULL;
903092
@@ -2877,7 +2877,14 @@ void displayEntry(struct singleEntry *entry, const char *prefix, int index)
903092
 
903092
 	line = getLineByType(LT_TITLE, entry->lines);
903092
 	if (line) {
903092
-		printf("title=%s\n", line->elements[1].item);
903092
+                char *entryTitle;
903092
+                /* if we can extractTitle, then it's a zipl config and
903092
+                 * if not then we go ahead with what's existed prior */
903092
+                entryTitle = extractTitle(config, line);
903092
+                if (!entryTitle) {
903092
+                    entryTitle=line->elements[1].item;
903092
+                }
903092
+		printf("title=%s\n", entryTitle);
903092
 	} else {
903092
 		char *title;
903092
 		line = getLineByType(LT_MENUENTRY, entry->lines);
903092
@@ -3277,11 +3284,11 @@ int displayInfo(struct grubConfig *config, char *kernel, const char *prefix)
903092
 			printf("lba\n");
903092
 	}
903092
 
903092
-	displayEntry(entry, prefix, i);
903092
+	displayEntry(config, entry, prefix, i);
903092
 
903092
 	i++;
903092
 	while ((entry = findEntryByPath(config, kernel, prefix, &i))) {
903092
-		displayEntry(entry, prefix, i);
903092
+		displayEntry(config, entry, prefix, i);
903092
 		i++;
903092
 	}
903092
 
903092
-- 
903092
2.9.3
903092