ENH: relocate WM_PROJECT_SITE default (issue #1050)

- was PREFIX/site, now PROJECT/site

  This avoids several issues when installing OpenFOAM in clusters
  without an intermediate OpenFOAM-specific installation prefix.

  The 'site' directory may have a reserved meaning in these situations
  and it is undesirable to 'leak' upwards into the parent directory to
  look for configuration files.

  Placing the default within the project directory avoids this.
  Alternative locations can be given via the WM_PROJECT_SITE variable.
This commit is contained in:
Mark Olesen
2018-11-29 18:04:44 +01:00
parent be46f96862
commit 9e094f1f07
11 changed files with 23 additions and 25 deletions

View File

@ -68,7 +68,7 @@ static inline bool userResourceDir(Foam::fileName& queried)
// Corresponds to foamEtcFile -mode=g
// Looks for
// - $WM_PROJECT_SITE
// - $WM_PROJECT_INST_DIR/site
// - $WM_PROJECT_DIR/site
static inline bool groupResourceDir(Foam::fileName& queried)
{
#ifdef FOAM_RESOURCE_SITE_ENVNAME

View File

@ -71,7 +71,7 @@ fileNameList findEtcDirs
//
// \note Treatment of empty or undefined variables
// - \b \$WM_PROJECT_VERSION : Use compile-time value of OPENFOAM
// - \b \$WM_PROJECT_SITE : Use $WM_PROJECT_INST_DIR/site
// - \b \$WM_PROJECT_SITE : Use $WM_PROJECT_DIR/site
//
// \return The list of full paths of all the matching files or
// an empty list if the name cannot be found.

View File

@ -66,14 +66,9 @@ SourceFiles
//- when the directory corresponding to FOAM_RESOURCE_SITE_ENVNAME is empty.
// The fallback search appends "/site" to the directory.
//
// Default: "WM_PROJECT_INST_DIR"
//
// \note If packaging OpenFOAM into a single directory (eg, spack, EasyBuild),
// this should be changed to "WM_PROJECT_DIR" to avoid searching within
// the prefix (parent) directory.
//
// Default: "WM_PROJECT_DIR"
// Used by foamEtcFiles() and stringOps::expand()
#define FOAM_RESOURCE_SITE_FALLBACK_ENVNAME "WM_PROJECT_INST_DIR"
#define FOAM_RESOURCE_SITE_FALLBACK_ENVNAME "WM_PROJECT_DIR"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //