Blame SOURCES/0044-inspection-Get-icons-from-RHEL-and-CentOS-7-RHBZ-116.patch

0d20ef
From 82cac591adf3549b42390230816cc525962b4519 Mon Sep 17 00:00:00 2001
0d20ef
From: "Richard W.M. Jones" <rjones@redhat.com>
0d20ef
Date: Mon, 17 Nov 2014 10:25:33 +0000
0d20ef
Subject: [PATCH] inspection: Get icons from RHEL and CentOS 7 (RHBZ#1164619).
0d20ef
0d20ef
(cherry picked from commit c8a608ecf8576bb754749db982714fa35cedfbe4)
0d20ef
---
0d20ef
 src/inspect-icon.c | 22 +++++++++++++---------
0d20ef
 1 file changed, 13 insertions(+), 9 deletions(-)
0d20ef
0d20ef
diff --git a/src/inspect-icon.c b/src/inspect-icon.c
0d20ef
index 0ffca72..4f10dfb 100644
0d20ef
--- a/src/inspect-icon.c
0d20ef
+++ b/src/inspect-icon.c
0d20ef
@@ -303,24 +303,28 @@ icon_fedora (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
0d20ef
  * RHEL 5, 6:
0d20ef
  * As above, but the file has been optimized to about 16K.
0d20ef
  *
0d20ef
+ * In RHEL 7 the logos were completely broken (RHBZ#1063300).
0d20ef
+ *
0d20ef
  * Conveniently the RHEL clones also have the same file with the
0d20ef
  * same name, but containing their own logos.  Sense prevails!
0d20ef
  */
0d20ef
-#define SHADOWMAN_ICON "/usr/share/pixmaps/redhat/shadowman-transparent.png"
0d20ef
-
0d20ef
 static char *
0d20ef
 icon_rhel (guestfs_h *g, struct inspect_fs *fs, size_t *size_r)
0d20ef
 {
0d20ef
   size_t max_size = 0;
0d20ef
+  const char *shadowman;
0d20ef
 
0d20ef
-  if (fs->distro == OS_DISTRO_RHEL) {
0d20ef
-    if (fs->major_version <= 4)
0d20ef
-      max_size = 66000;
0d20ef
-    else
0d20ef
-      max_size = 17000;
0d20ef
-  }
0d20ef
+  if (fs->major_version >= 5 && fs->major_version <= 6)
0d20ef
+    max_size = 17000;
0d20ef
+  else
0d20ef
+    max_size = 66000;
0d20ef
+
0d20ef
+  if (fs->major_version <= 6)
0d20ef
+    shadowman = "/usr/share/pixmaps/redhat/shadowman-transparent.png";
0d20ef
+  else
0d20ef
+    shadowman = "/usr/share/pixmaps/fedora-logo-sprite.png";
0d20ef
 
0d20ef
-  return get_png (g, fs, SHADOWMAN_ICON, size_r, max_size);
0d20ef
+  return get_png (g, fs, shadowman, size_r, max_size);
0d20ef
 }
0d20ef
 
0d20ef
 #define DEBIAN_ICON "/usr/share/pixmaps/debian-logo.png"
0d20ef
-- 
0d20ef
1.8.3.1
0d20ef