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