Skip to content

Commit 03e060c

Browse files
author
meihuisu
committed
rework the orderedLibrariesToInstall logic in ucvm_setup.py
1 parent ecab20c commit 03e060c

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

setup/setup.list

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@
444444
"UCVMConfigureFlags": "--with-netcdf-include-path=${UCVM_INSTALL_PATH}/lib/netcdf/include --with-netcdf-lib-path=${UCVM_INSTALL_PATH}/lib/netcdf/lib",
445445
"md5sum": "f48ee01534365006934f0c63d4055ea0",
446446
"Ask": "no",
447-
"Needs":"Curl"
447+
"Needs":"Curl HDF5"
448448
},
449449
"HDF5": {
450450
"Path": "hdf5",

ucvm_setup.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -943,34 +943,40 @@ def _addPROJ_LIB_python() :
943943
print("\nNow setting up the required UCVM libraries...")
944944

945945
#orderedLibrariesToInstall = []
946-
for library in config_data["libraries"]:
946+
def _add2orderedToInstallList(library):
947947
the_library = config_data["libraries"][library]
948-
if library in librariesToInstall:
949-
## bring in the dependency
948+
if library in orderedLibrariesToInstall:
949+
# no need to do anything
950+
pass
951+
else:
950952
if the_library.get("Needs", "") != "":
951953
needlist=the_library["Needs"].split()
952954
for need in needlist:
953-
if need in orderedLibrariesToInstall:
954-
# no need to do anything
955-
pass
956-
else:
957-
orderedLibrariesToInstall.append(need)
958-
orderedLibrariesToInstall.append(library)
955+
_add2orderedToInstallList(need)
959956

957+
orderedLibrariesToInstall.append(library)
958+
else:
959+
orderedLibrariesToInstall.append(library)
960960

961-
for library in config_data["libraries"]:
961+
#orderedLibrariesToInstall = []
962+
for library in config_data["libraries"]:
963+
if library in librariesToInstall:
964+
_add2orderedToInstallList(library)
965+
#print(orderedLibrariesToInstall)
966+
967+
##
968+
for library in orderedLibrariesToInstall:
962969
the_library = config_data["libraries"][library]
963-
if library in orderedLibrariesToInstall:
964-
print("\n CHECKING on ", library)
965-
try:
966-
#downloadWithProgress(the_library["URL"], "./work/lib", "Downloading " + library + "..." )
967-
tarname = the_library["URL"].split("/")[-1]
970+
print("\n CHECKING on ", library)
971+
try:
972+
#downloadWithProgress(the_library["URL"], "./work/lib", "Downloading " + library + "..." )
973+
tarname = the_library["URL"].split("/")[-1]
968974

969-
print("Calling URL Install with tarname,ucvmpath:",tarname,ucvmpath)
975+
print("Calling URL Install with tarname,ucvmpath:",tarname,ucvmpath)
970976

971-
installConfigMakeInstall(tarname, ucvmpath, "library", the_library)
972-
except Exception as e:
973-
eG(e, "Error installing library " + library + ".")
977+
installConfigMakeInstall(tarname, ucvmpath, "library", the_library)
978+
except Exception as e:
979+
eG(e, "Error installing library " + library + ".")
974980

975981
print("\nNow setting up CVM models...")
976982

0 commit comments

Comments
 (0)