Blame SOURCES/0001-macros.efi-srpm-make-all-of-our-macros-always-expand.patch

b0466f
From 29e47cd8011b1569c4a73c8e395c7fb5192e6dc1 Mon Sep 17 00:00:00 2001
b0466f
From: Peter Jones <pjones@redhat.com>
b0466f
Date: Fri, 4 May 2018 15:02:14 -0400
b0466f
Subject: [PATCH] macros.efi-srpm: make all of our macros always expandable,
b0466f
 even if wrong
b0466f
b0466f
In particular, arch and altarch give "none", and when they do efi_has_arch
b0466f
and efi_has_alt_arch are 0 (respectively).  if they're correct, they'll
b0466f
be 1.
b0466f
b0466f
Signed-off-by: Peter Jones <pjones@redhat.com>
b0466f
---
b0466f
 macros.efi-srpm.in | 17 ++++++++++++-----
b0466f
 1 file changed, 12 insertions(+), 5 deletions(-)
b0466f
b0466f
diff --git a/macros.efi-srpm.in b/macros.efi-srpm.in
b0466f
index 5f8a784af8a..f3b4c68b2f9 100644
b0466f
--- a/macros.efi-srpm.in
b0466f
+++ b/macros.efi-srpm.in
b0466f
@@ -38,7 +38,7 @@
b0466f
     elseif arch("%{arm}") then
b0466f
       return("arm")
b0466f
     else
b0466f
-      return("")
b0466f
+      return("none")
b0466f
     end
b0466f
   end
b0466f
   -- alt arch
b0466f
@@ -46,24 +46,30 @@
b0466f
     if arch("x86_64") then
b0466f
       return("ia32")
b0466f
     else
b0466f
-      return(nil)
b0466f
+      return("none")
b0466f
     end
b0466f
   end
b0466f
   -- make some macros
b0466f
   local done = rpm.expand("%{?_efi}")
b0466f
   if done == nil or done == "" then
b0466f
+    local arch = getarch()
b0466f
     local alt = getaltarch()
b0466f
     print("%global _efi @@EFI_ARCHES@@\\n")
b0466f
     print("%global _efi_vendor @@EFI_VENDOR@@\\n")
b0466f
+    if arch == "none" then
b0466f
+      print("%global _efi_has_arch 0\\n")
b0466f
+    else
b0466f
+      print("%global _efi_has_arch 1\\n")
b0466f
+    end
b0466f
     print("%global _efi_arch " .. getarch() .. "\\n")
b0466f
     print("%global _efi_arch_upper " .. string.upper(getarch()) .. "\\n")
b0466f
-    if alt == nil then
b0466f
+    if alt == "none" then
b0466f
       print("%global _efi_has_alt_arch 0\\n")
b0466f
     else
b0466f
       print("%global _efi_has_alt_arch 1\\n")
b0466f
-      print("%global _efi_alt_arch " .. alt .. "\\n")
b0466f
-      print("%global _efi_alt_arch_upper " .. string.upper(alt) .. "\\n")
b0466f
     end
b0466f
+    print("%global _efi_alt_arch " .. alt .. "\\n")
b0466f
+    print("%global _efi_alt_arch_upper " .. string.upper(alt) .. "\\n")
b0466f
   end
b0466f
 }}
b0466f
 
b0466f
@@ -79,6 +85,7 @@
b0466f
 
b0466f
 %efi_arch %{expand:%{_efi_srpm_macros_setup}}%{_efi_arch}
b0466f
 %efi_arch_upper %{expand:%{_efi_srpm_macros_setup}}%{_efi_arch_upper}
b0466f
+%efi_has_arch %{expand:%{_efi_srpm_macros_setup}}0%{_efi_has_arch}
b0466f
 %efi_has_alt_arch %{expand:%{_efi_srpm_macros_setup}}0%{_efi_has_alt_arch}
b0466f
 %efi_alt_arch %{expand:%{_efi_srpm_macros_setup}}%{?_efi_alt_arch}%{nil}
b0466f
 %efi_alt_arch_upper %{expand:%{_efi_srpm_macros_setup}}%{?_efi_alt_arch_upper}%{nil}
b0466f
-- 
b0466f
2.14.3
b0466f