887953
From 0cef0696d665b385706d9be7aad48afee2537775 Mon Sep 17 00:00:00 2001
887953
From: Milind Changire <mchangir@redhat.com>
887953
Date: Tue, 12 Feb 2019 16:25:37 +0530
887953
Subject: [PATCH 530/530] spec: fix lua script execution during install
887953
887953
Explicit bash shell invocation in the os.execute() API is not required.
887953
Since the script starts with the #!/bin/sh hash-bang sequence,
887953
os.execute() successfully spawns and runs the script.
887953
887953
Label: DOWNSTREAM ONLY
887953
887953
BUG: 1410145
887953
Change-Id: I7774380adb1c164f50145270e91c1d2c086cd9d4
887953
Signed-off-by: Milind Changire <mchangir@redhat.com>
887953
Reviewed-on: https://code.engineering.redhat.com/gerrit/162774
887953
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
887953
---
887953
 glusterfs.spec.in | 63 +++++++++++++------------------------------------------
887953
 1 file changed, 15 insertions(+), 48 deletions(-)
887953
887953
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
887953
index 2680bec..89cd501 100644
887953
--- a/glusterfs.spec.in
887953
+++ b/glusterfs.spec.in
887953
@@ -1640,10 +1640,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -1677,10 +1674,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -1714,10 +1708,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -1751,10 +1742,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -1788,10 +1776,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -1825,10 +1810,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -1862,10 +1844,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -1900,10 +1879,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -1938,10 +1914,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -1976,10 +1949,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -2015,10 +1985,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -2053,10 +2020,7 @@ if [ $? -eq 0 ]; then
887953
 fi
887953
 ]]
887953
 
887953
--- Since we run pretrans scripts only for RPMs built for a server build,
887953
--- we can now use os.tmpname() since it is available on RHEL6 and later
887953
--- platforms which are server platforms.
887953
-ok, how, val = os.execute("/bin/bash -c \"" .. script .. "\"")
887953
+ok, how, val = os.execute(script)
887953
 if not (ok == 0) then
887953
    error("Detected running glusterfs processes", ok)
887953
 end
887953
@@ -2113,6 +2077,9 @@ fi
887953
 %endif
887953
 
887953
 %changelog
887953
+* Tue Feb 09 2019 Milind Changire <mchangir@redhat.com>
887953
+- Fix lua script execution during install (#1410145)
887953
+
887953
 * Sat Feb 09 2019 Milind Changire <mchangir@redhat.com>
887953
 - Avoid creation of temporary file in lua script during install (#1410145)
887953
 
887953
-- 
887953
1.8.3.1
887953