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