]> SALOME platform Git repositories - tools/pvdeliv.git/commitdiff
Salome HOME
remove subprocess pipes
authorCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 18 Oct 2016 16:35:54 +0000 (18:35 +0200)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 18 Oct 2016 16:35:54 +0000 (18:35 +0200)
scripts/salome_compile.py
scripts/salome_download.py

index 587955ed51b7d18d245493d24f9fd981735fa7ce..418e53bf601da548bfeaf7e8912e1f65bc1c8d0e 100644 (file)
@@ -18,7 +18,7 @@ def __getCurrentVersion(srcDir,pattern, config):
     return s
   elif isinstance(srcLoc,tuple):
     dirGitLoc=os.path.splitext(os.path.basename(srcLoc[0]))[0]
-    p=subprocess.Popen(["git","rev-parse","--verify","HEAD"],cwd=dirGitLoc,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+    p=subprocess.Popen(["git","rev-parse","--verify","HEAD"],cwd=dirGitLoc)
     p_out,p_err=p.communicate()
     if p.returncode != 0:
       msg = "Error in __getCurrentVersion\n" + p_err
@@ -81,7 +81,7 @@ def __compilePart2(topSrcDir,pattern,config,envAcc,buildDir,splitInstall):
     print("make in %s"%(buildDir))
     paraCompFlag = config["paraCompFlag"]
     if not splitInstall:
-      p=subprocess.Popen(["make",paraCompFlag,"install"],cwd=buildDir,env=computeEnv(envAcc),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      p=subprocess.Popen(["make",paraCompFlag,"install"],cwd=buildDir,env=computeEnv(envAcc))
       a,b=p.communicate()
       f=file(os.path.join(buildDir,compOut),"w") ; f.write(a) ; f.flush()
       f=file(os.path.join(buildDir,compErr),"w") ; f.write(b) ; f.flush()
@@ -89,14 +89,14 @@ def __compilePart2(topSrcDir,pattern,config,envAcc,buildDir,splitInstall):
         msg = "Error in build step. See details in %s and %s\n"%(os.path.join(buildDir,compOut), os.path.join(buildDir,compErr))
         raise Exception(msg)
     else:
-      p=subprocess.Popen(["make",paraCompFlag],cwd=buildDir,env=computeEnv(envAcc),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      p=subprocess.Popen(["make",paraCompFlag],cwd=buildDir,env=computeEnv(envAcc))
       a0,b0=p.communicate()
       f=file(os.path.join(buildDir,compOut),"w") ; f.write(a0) ; f.flush()
       f=file(os.path.join(buildDir,compErr),"w") ; f.write(b0) ; f.flush()
       if p.returncode != 0:
         msg = "Error in build step. See details in %s and %s\n"%(os.path.join(buildDir,compOut), os.path.join(buildDir,compErr))
         raise Exception(msg)
-      p=subprocess.Popen(["make",paraCompFlag,"install"],cwd=buildDir,env=computeEnv(envAcc),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      p=subprocess.Popen(["make",paraCompFlag,"install"],cwd=buildDir,env=computeEnv(envAcc))
       a1,b1=p.communicate()
       f=file(os.path.join(buildDir,compOut),"w") ; f.write(a0+a1) ; f.flush()
       f=file(os.path.join(buildDir,compErr),"w") ; f.write(b0+b1) ; f.flush()
@@ -117,7 +117,7 @@ def __compileOldCommon(topSrcDir,pattern,config,envAcc,srcDir,topBuildDir,topIns
       return myInstallDir
     myCmd=[os.path.join(srcDir,"configure"),"--prefix=%s"%(myInstallDir)]+addCfgParam
     print "Command: ", " ".join(myCmd)
-    p=subprocess.Popen(myCmd,cwd=myBuildDir,env=computeEnv(envAcc),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+    p=subprocess.Popen(myCmd,cwd=myBuildDir,env=computeEnv(envAcc))
     __compilePart1(p,myBuildDir)
     __compilePart2(topSrcDir,pattern,config,envAcc,myBuildDir,splitInstall)
     return myInstallDir
@@ -134,7 +134,7 @@ def compileNew(topSrcDir,pattern,config,envAcc,srcDir,topBuildDir,topInstallDir,
       return myInstallDir
     myCmd=["cmake","-DCMAKE_INSTALL_PREFIX=%s"%(myInstallDir)]+addCfgParam+[srcDir]
     print(" ".join(myCmd))
-    p=subprocess.Popen(myCmd,cwd=myBuildDir,env=computeEnv(envAcc),stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+    p=subprocess.Popen(myCmd,cwd=myBuildDir,env=computeEnv(envAcc))
     __compilePart1(p,myBuildDir)
     __compilePart2(topSrcDir,pattern,config,envAcc,myBuildDir,False)
     return myInstallDir
index e59244a201aeafc98808d40bcdca49048a433dd5..a44b4d8293b55bbdd33752c980ed4a1b5e5679f5 100644 (file)
@@ -80,7 +80,7 @@ def __extractSrcFromGit(gitLoc,srcDir,pattern,use_pleiade_mirrors=False):
     if not os.path.exists(dirGitLoc):
       print("Cloning %s..."%dirGitLoc)
       def __connect():
-        p=subprocess.Popen("GIT_SSL_NO_VERIFY=true git clone %s"%(gitLoc[0]), shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+        p=subprocess.Popen("GIT_SSL_NO_VERIFY=true git clone %s"%(gitLoc[0]), shell=True)
         p_out,p_err=p.communicate()
         return p.returncode, p_out, p_err
 
@@ -103,7 +103,7 @@ def __extractSrcFromGit(gitLoc,srcDir,pattern,use_pleiade_mirrors=False):
           local_command = "git config "
           local_command += "-f .gitmodules "
           local_command += "submodule.%s.url %s" % (key, val)
-          p=subprocess.Popen(local_command,cwd=dirGitLoc,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+          p=subprocess.Popen(local_command,cwd=dirGitLoc,shell=True)
           p.communicate()
 
     else:
@@ -114,21 +114,21 @@ def __extractSrcFromGit(gitLoc,srcDir,pattern,use_pleiade_mirrors=False):
           local_command = "git config "
           local_command += "-f .gitmodules "
           local_command += "submodule.%s.url %s" % (key, val)
-          p=subprocess.Popen(local_command,cwd=dirGitLoc,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+          p=subprocess.Popen(local_command,cwd=dirGitLoc,shell=True)
           p.communicate()
 
       # Fetch
       print("Fetching %s..."%dirGitLoc)
       assert(os.path.exists(os.path.join(dirGitLoc,".git")))
-      p=subprocess.Popen(["git","fetch","--prune"],cwd=dirGitLoc,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      p=subprocess.Popen(["git","fetch","--prune"],cwd=dirGitLoc)
       p.communicate()
-      p=subprocess.Popen(["git","fetch","--tags"],cwd=dirGitLoc,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      p=subprocess.Popen(["git","fetch","--tags"],cwd=dirGitLoc)
       p.communicate()
       pass
     pass
 
     # Checkout
-    p=subprocess.Popen(["git","checkout",gitLoc[1]],cwd=dirGitLoc,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+    p=subprocess.Popen(["git","checkout",gitLoc[1]],cwd=dirGitLoc)
     p_out,p_err=p.communicate()
     if p.returncode != 0:
       msg = "Error in checkout\n" + p_err
@@ -136,12 +136,12 @@ def __extractSrcFromGit(gitLoc,srcDir,pattern,use_pleiade_mirrors=False):
 
     # Init and Update submodules
     if dirGitLoc in ["ParaView", "prerequisites-salome.paraview"]:
-      p=subprocess.Popen(["git","submodule","update","--init","--recursive"],cwd=dirGitLoc,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      p=subprocess.Popen(["git","submodule","update","--init","--recursive"],cwd=dirGitLoc)
       p.communicate()
       if p.returncode != 0:
         msg = "Error in submodule update\n" + p_err
         raise Exception(msg)
-      p=subprocess.Popen(["git","checkout","--",".gitmodules"],cwd=dirGitLoc,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+      p=subprocess.Popen(["git","checkout","--",".gitmodules"],cwd=dirGitLoc)
       p.communicate()
       if p.returncode != 0:
         msg = "Error in submodule update\n" + p_err