e7a346
From 58e52a8862aff553a883ee8b554f38baa2bda9a6 Mon Sep 17 00:00:00 2001
e7a346
From: Milind Changire <mchangir@redhat.com>
e7a346
Date: Tue, 7 Nov 2017 18:32:59 +0530
e7a346
Subject: [PATCH 34/74] build: remove pretrans script for python-gluster
e7a346
e7a346
Remove pretrans scriptlet for python-gluster.
e7a346
e7a346
Label: DOWNSTREAM ONLY
e7a346
e7a346
Change-Id: Iee006354c596aedbd70438a3bdd583de28837190
e7a346
Signed-off-by: Milind Changire <mchangir@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/122556
e7a346
Reviewed-by: Prashanth Pai <ppai@redhat.com>
e7a346
Reviewed-by: Aravinda Vishwanathapura Krishna Murthy <avishwan@redhat.com>
e7a346
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
e7a346
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e7a346
---
e7a346
 glusterfs.spec.in | 42 ------------------------------------------
e7a346
 1 file changed, 42 deletions(-)
e7a346
e7a346
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
e7a346
index f4386de..8c16477 100644
e7a346
--- a/glusterfs.spec.in
e7a346
+++ b/glusterfs.spec.in
e7a346
@@ -1976,48 +1976,6 @@ end
e7a346
 
e7a346
 
e7a346
 
e7a346
-%pretrans -n python-gluster -p <lua>
e7a346
-if not posix.access("/bin/bash", "x") then
e7a346
-    -- initial installation, no shell, no running glusterfsd
e7a346
-    return 0
e7a346
-end
e7a346
-
e7a346
--- TODO: move this completely to a lua script
e7a346
--- For now, we write a temporary bash script and execute that.
e7a346
-
e7a346
-script = [[#!/bin/sh
e7a346
-pidof -c -o %PPID -x glusterfsd &>/dev/null
e7a346
-
e7a346
-if [ $? -eq 0 ]; then
e7a346
-   pushd . > /dev/null 2>&1
e7a346
-   for volume in /var/lib/glusterd/vols/*; do cd $volume;
e7a346
-       vol_type=`grep '^type=' info | awk -F'=' '{print $2}'`
e7a346
-       volume_started=`grep '^status=' info | awk -F'=' '{print $2}'`
e7a346
-       if [ $vol_type -eq 0 ] && [ $volume_started -eq 1 ] ; then
e7a346
-          exit 1;
e7a346
-       fi
e7a346
-   done
e7a346
-
e7a346
-   popd > /dev/null 2>&1
e7a346
-   exit 1;
e7a346
-fi
e7a346
-]]
e7a346
-
e7a346
--- Since we run pretrans scripts only for RPMs built for a server build,
e7a346
--- we can now use os.tmpname() since it is available on RHEL6 and later
e7a346
--- platforms which are server platforms.
e7a346
-tmpname = os.tmpname()
e7a346
-tmpfile = io.open(tmpname, "w")
e7a346
-tmpfile:write(script)
e7a346
-tmpfile:close()
e7a346
-ok, how, val = os.execute("/bin/bash " .. tmpname)
e7a346
-os.remove(tmpname)
e7a346
-if not (ok == 0) then
e7a346
-   error("Detected running glusterfs processes", ok)
e7a346
-end
e7a346
-
e7a346
-
e7a346
-
e7a346
 %if ( 0%{!?_without_rdma:1} )
e7a346
 %pretrans rdma -p <lua>
e7a346
 if not posix.access("/bin/bash", "x") then
e7a346
-- 
e7a346
1.8.3.1
e7a346