Commit c9c2fbcf authored by mark's avatar mark

ENH: handle source packs that unpack to 'OpenFOAM-plus'

- This may occur with some frequency.

- Add some comments and reduce the number of variable at the top.
parent ac4ed6d2
......@@ -50,10 +50,6 @@ and package versions, it may not work for all users and environments.
5) If you use `clang` as compiler, it must be the same version as `llvm`.
6) Please make sure that the unpacked OpenFOAM `etc/bashrc` file
contains the correct version name
(if you download from other sources than the standard release files).
---
## Script Configuration
......
......@@ -8,10 +8,16 @@
# Use ThirdParty compiler, but retain most default software versions.
#
# Adjust the relevant USER INPUT sections below prior to running.
#
# - INPUT (1) has the top-level packaging
# - INPUT (2) has version preferences
#
# Input Directory:
# - ./packages # Contains the tar files
#
# Output Directories
# - ./install # The compiled installation
# - ./log # Log files from the build scripts
#
# License
# GPL v3 or later
# Copyright (C) 2016 Roger Almenar, ESI GmbH.
......@@ -24,19 +30,14 @@ FoamVersion=v1612+
OFdirName=OpenFOAM-$FoamVersion
TPdirName=ThirdParty-$FoamVersion
# Source package names may differ from the directory names
OFsource=$OFdirName
TPsource=$TPdirName
# Local directories
INSTALL_DIR=$PWD/install
PACKAGE_DIR=$PWD/packages
LOGFILE_DIR=$PWD/log
# Source package names may differ from the directory names above
# uncomment and change if needed)
# OFsource=OpenFOAM-plus
# TPsource=ThirdParty-plus
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# User input continues below at USER INPUT (2)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#------------------------------------------------------------------------------
_preferences()
{
......@@ -90,9 +91,14 @@ _preferences <<-USER_INPUT
# -----------------------------------------------------------------------------
USER_INPUT
#
# NO FURTHER EDITING BELOW THIS LINE
# NO NORMAL EDITING BELOW THIS LINE
#------------------------------------------------------------------------------
# Local directories
INSTALL_DIR=$PWD/install
PACKAGE_DIR=$PWD/packages
LOGFILE_DIR=$PWD/log
# Special treatment for gcc sub-components (needs rethinking)
case "$compilerVersion" in
Gcc | Gcc48)
......@@ -484,9 +490,17 @@ unpackAllFiles()
exit 1
}
# Unpack OpenFOAM and ThirdParty (names may differ)
_unpack $OFsource; _mvdir "$OFsource" "$OFdirName"
_unpack $TPsource; _mvdir "$TPsource" "$TPdirName"
# Unpack OpenFOAM and ThirdParty
# Source package names may differ from the directory names
# Also handle '-plus' extensions (common problem?)
_unpack "${OFsource:=$OFdirName}"
_mvdir "$OFsource" "$OFdirName"
_mvdir OpenFOAM-plus "$OFdirName"
_unpack "${TPsource:=$TPdirName}";
_mvdir "$TPsource" "$TPdirName"
_mvdir ThirdParty-plus "$TPdirName"
cd $INSTALL_DIR/$OFdirName || {
echo "Error: cannot change to $INSTALL_DIR/$OFdirName"
......@@ -952,13 +966,23 @@ compileOpenFOAM()
_listSettings
[ "$optList" = true ] && exit 0
if [ "${purgeOLDFILES:-false}" = true ]
then
commentUNPACK="(purge old files)"
else
commentUNPACK="(keep old files)"
fi
commentTHIRD=""
commentFOAM=""
/bin/cat<<SUMMARY
Build stages selected
---------------------
-unpack ${runUNPACK:-false}
-third ${runTHIRD:-false}
-foam ${runFOAM:-false}
-unpack ${runUNPACK:-false} $commentUNPACK
-third ${runTHIRD:-false} $commentTHIRD
-foam ${runFOAM:-false} $commentFOAM
---------------------
SUMMARY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment