]> SALOME platform Git repositories - tools/pvdeliv.git/commitdiff
Salome HOME
option for Pleiade mirrors kw11013
authorCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 13 Sep 2016 08:43:30 +0000 (10:43 +0200)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Tue, 13 Sep 2016 08:43:30 +0000 (10:43 +0200)
scripts/BuildSalomeMini.py
scripts/SalomeMiniConfig.cfg
scripts/salome_config.py
scripts/salome_download.py

index c8f4e4ab97760418ae5f7f755bf8810741846892..f5c4e5c09ce8c2ae1be2b0e8884d571708ec1c26 100755 (executable)
@@ -1,6 +1,7 @@
 #! /usr/bin/env python
 
 import os,sys,shutil,glob
+from optparse import OptionParser
 
 from salome_misc import AutoChdir
 from salome_config import read_config_file, initialize, update_config_file
@@ -12,7 +13,7 @@ from salome_environ import accumulateEnv, generateFileEnv
 
 current_directory=os.path.dirname(os.path.abspath(__file__))
 
-def __init(envAcc={}, paraview_version=None):
+def __init(envAcc={}, paraview_version=None, use_pleiade_mirrors=False):
   # Read configuration
   filename=os.path.join(current_directory, "SalomeMiniConfig.cfg")
   config=read_config_file(filename)
@@ -20,6 +21,11 @@ def __init(envAcc={}, paraview_version=None):
     config["paraview_version"] = paraview_version[0]
     config["paraview_git_version"] = paraview_version[1]
     update_config_file(filename, {"paraview_version": paraview_version[0], "paraview_git_version":paraview_version[1]})
+    pass
+  if use_pleiade_mirrors:
+    config["use_pleiade_mirrors"] = use_pleiade_mirrors
+    #update_config_file(filename, {"use_pleiade_mirrors": "yes"})
+    pass
   # Check system prerequisites
   check_gcc_version(config["gcc_version_min"], envAcc)
   # Download archives
@@ -66,9 +72,9 @@ ENDIF()
   return os.path.abspath(destReal)
 ####################
 
-def __let_us_go(paraview_version=None):
+def __let_us_go(paraview_version=None, use_pleiade_mirrors=False):
   envAcc={}
-  config=__init(paraview_version=paraview_version)
+  config=__init(paraview_version=paraview_version, use_pleiade_mirrors=use_pleiade_mirrors)
 
   # Prepare build
   rootDir="SalomeMini"
@@ -152,31 +158,30 @@ def __let_us_go(paraview_version=None):
   print("Env file generated : %s"%envFile)
   pass
 
-def __usage(exe):
-  return """
-Usage: %s [--with-paraview-version=number,sha1]\n
-Use option --with-paraview-version to build a specific paraview version. Give the
-version number (e.g. 5.1) and a git sha1.
-"""%(exe)
+def __parse_options():
+  parser = OptionParser()
+  parser.add_option("--with-paraview-version", dest="paraview_version",
+                    help="Build a specific paraview version. Give the version number (e.g. 5.1) and a git sha1.", metavar="number,sha1")
+  parser.add_option("--pleiade",
+                    action="store_true", dest="pleiade", default=False,
+                    help="Use PLEIADE mirrors (for EDF).")
+  (options, args) = parser.parse_args()
+  return options, args
 
 ###
 if __name__ == "__main__":
-  if len(sys.argv) not in [1,2]:
-    print __usage(sys.argv[0])
+  options, args = __parse_options()
+  if args:
+    print "Unrecognized argument(s):", ",".join(args)
     sys.exit(1)
 
   paraview_version = None
-  if len(sys.argv) == 2:
-    if sys.argv[1].startswith("--with-paraview-version="):
-      try:
-        number,sha1 = sys.argv[1].split("=")[1].split(",")
-        paraview_version = (number.strip(),sha1.strip())
-      except:
-        print "Syntax error in paraview version"
-        print __usage(sys.argv[0])
-        sys.exit(1)
-    else:
-      print __usage(sys.argv[0])
+  if options.paraview_version:
+    try:
+      number,sha1 = options.paraview_version.split(",")
+      paraview_version = (number.strip(),sha1.strip())
+    except:
+      print "Syntax error in paraview version"
       sys.exit(1)
 
-  __let_us_go(paraview_version)
+  __let_us_go(paraview_version=paraview_version, use_pleiade_mirrors=options.pleiade)
index 6948cd8a053cc32646700091f06289bc319019e6..e32016061c2d6c915e24b468506b4800fa3154a6 100644 (file)
@@ -18,15 +18,18 @@ swig_url=http://downloads.sourceforge.net/project/swig/swig/swig-2.0.8/swig-2.0.
 
 [ParaView]
 paraview_git_repo=https://github.com/Kitware/ParaView.git
-paraview_git_version=97cdb51f
+#paraview_git_repo=https://gitlab.kitware.com/paraview/paraview.git
+paraview_git_repo_pleiade=https://git.forge.pleiade.edf.fr/git/prerequisites-salome.paraview.git
+paraview_git_version=09fee996
 paraview_version=5.1
 
 [SALOME]
-# Last Update: 31/08/2016
+# Last Update: 13/09/2016
 salome_git_repo=https://git.salome-platform.org/gitpub
-medcoupling_version=7146d186409953ffb6875c8b75deaf6971ce981a
+salome_git_repo_pleiade=https://git.forge.pleiade.edf.fr/git
+medcoupling_version=c05e2c047dcd8953a4242c696dd34abf0674ffdf
 repo_config_version=e31ab9172f3922b62b56c10969e2b88eda24c002
-paravis_version=f8c7a434ba8797c580c2fe4c532a4cbac580d309
+paravis_version=f671e69102c5ae8e2194509a6b719fae0b06d26c
 
 [Build options]
 make_nb_jobs=6
@@ -34,3 +37,4 @@ do_archive_download=yes
 
 [System]
 gcc_version_min=4.9.2
+use_pleiade_mirrors=no
index 8f156b1f703ee2916b5a407a9da22efab99835b3..e4a22f5f64d82703e259327562552f85b6f29f83 100644 (file)
@@ -28,15 +28,18 @@ def read_config_file(config_filename):
   config["swig_version"] = c.get('Prerequisites', 'swig_version', 0)
   config["swig_url"] = c.get('Prerequisites', 'swig_url', 0)
   config["paraview_git_repo"] = c.get('ParaView', 'paraview_git_repo', 0)
+  config["paraview_git_repo_pleiade"] = c.get('ParaView', 'paraview_git_repo_pleiade', 0)
   config["paraview_git_version"] = c.get('ParaView', 'paraview_git_version', 0)
   config["paraview_version"] = c.get('ParaView', 'paraview_version', 0)
   config["salome_git_repo"] = c.get('SALOME', 'salome_git_repo', 0)
+  config["salome_git_repo_pleiade"] = c.get('SALOME', 'salome_git_repo_pleiade', 0)
   config["medcoupling_version"] = c.get('SALOME', 'medcoupling_version', 0)
   config["repo_config_version"] = c.get('SALOME', 'repo_config_version', 0)
   config["paravis_version"] = c.get('SALOME', 'paravis_version', 0)
   config["make_nb_jobs"] = c.get('Build options', 'make_nb_jobs', 0)
   config["do_archive_download"] = c.getboolean('Build options', 'do_archive_download')
   config["gcc_version_min"] = c.get('System', 'gcc_version_min')
+  config["use_pleiade_mirrors"] = c.getboolean('System', 'use_pleiade_mirrors')
   return config
 
 __softwares = ["cmake","python","hdf5","swig","qt","med","medcoupling","paraview","paravis"]
@@ -63,11 +66,20 @@ def initialize(config):
 
   config["paraCompFlag"] = "-j%s"%config["make_nb_jobs"]
 
-  config["paraviewLoc"] = (config["paraview_git_repo"],config["paraview_git_version"])
-  salome_git_repo = config["salome_git_repo"]
-  config["medcouplingLoc"] = (os.path.join(salome_git_repo,"tools","medcoupling.git"),config["medcoupling_version"])
-  config["repoConfigLoc"] = (os.path.join(salome_git_repo,"tools","configuration.git"),config["repo_config_version"])
-  config["paravisLoc"] = (os.path.join(salome_git_repo,"modules","paravis.git"),config["paravis_version"])
+  if config["use_pleiade_mirrors"]:
+    config["paraviewLoc"] = (config["paraview_git_repo_pleiade"],config["paraview_git_version"])
+    salome_git_repo = config["salome_git_repo_pleiade"]
+    config["medcouplingLoc"] = (os.path.join(salome_git_repo,"tools-salome.medcoupling.git"),config["medcoupling_version"])
+    config["repoConfigLoc"] = (os.path.join(salome_git_repo,"tools-salome.configuration.git"),config["repo_config_version"])
+    config["paravisLoc"] = (os.path.join(salome_git_repo,"modules-salome.paravis.git"),config["paravis_version"])
+  else:
+    config["paraviewLoc"] = (config["paraview_git_repo"],config["paraview_git_version"])
+    salome_git_repo = config["salome_git_repo"]
+    config["medcouplingLoc"] = (os.path.join(salome_git_repo,"tools","medcoupling.git"),config["medcoupling_version"])
+    config["repoConfigLoc"] = (os.path.join(salome_git_repo,"tools","configuration.git"),config["repo_config_version"])
+    config["paravisLoc"] = (os.path.join(salome_git_repo,"modules","paravis.git"),config["paravis_version"])
+    pass
+
   pass
 
 def update_config_file(filename, dico):
index 55d6e0669d640312f6874fc605d4bd93d8501d1b..4ead437355c980808d9ca10b52948d2279e513f0 100644 (file)
@@ -1,9 +1,11 @@
 #! /usr/bin/env python
 
 import os
+import sys
 import tarfile
 import shutil
 import subprocess
+import urllib2
 
 from salome_misc import AutoChdir
 
@@ -78,7 +80,7 @@ def __extractSrcFromGit(gitLoc,srcDir,pattern):
     if p.returncode != 0:
       msg = "Error in checkout\n" + p_err
       raise Exception(msg)
-    if dirGitLoc=="ParaView":
+    if dirGitLoc in ["ParaView", "prerequisites-salome.paraview"]:
       p=subprocess.Popen(["git","submodule","update","--init"],cwd=dirGitLoc,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
       p_out,p_err=p.communicate()
       if p.returncode != 0:
@@ -95,8 +97,11 @@ def extractSrc(srcDir,pattern,config):
   else:
     raise Exception("Unrecognized localization of source : %s"%srcLoc)
 
-import urllib2
-def __download(url, outfile):
+def __download(url, outfile, use_pleiade_mirrors, subfolder):
+  if use_pleiade_mirrors:
+    archive_name = os.path.basename(url)
+    url = os.path.join("http://ftp.pleiade.edf.fr/projets/YAMM/Public/SALOME/sources", subfolder, archive_name)
+
   print "Downloading",outfile,"..."
   if os.path.exists(outfile):
     print "Already downloaded" # :TODO: should include MD5 check
@@ -143,12 +148,13 @@ def download_archives(current_directory, config):
     pass
 
   if do_archive_download:
-    __download(config["cmake_url"], cmakeLoc)
-    __download(config["med_url"], medLoc)
-    __download(config["hdf5_url"], hdf5Loc)
-    __download(config["swig_url"], swigLoc)
-    __download(config["qt_url"], qtLoc)
-    __download(config["python_url"], pythonLoc)
+    use_pleiade_mirrors = config["use_pleiade_mirrors"]
+    __download(config["cmake_url"], cmakeLoc, use_pleiade_mirrors, "prerequis")
+    __download(config["med_url"], medLoc, use_pleiade_mirrors, "tools")
+    __download(config["hdf5_url"], hdf5Loc, use_pleiade_mirrors, "prerequis")
+    __download(config["swig_url"], swigLoc, use_pleiade_mirrors, "prerequis")
+    __download(config["qt_url"], qtLoc, use_pleiade_mirrors, "prerequis")
+    __download(config["python_url"], pythonLoc, use_pleiade_mirrors, "prerequis")
     pass
 
   config["cmakeLoc"] = cmakeLoc