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

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