diff --git a/applications/test/etcFiles/Test-etcFiles.C b/applications/test/etcFiles/Test-etcFiles.C index d4d76aea58b4fad4cab16e6f1d0ae49773093a5c..022c5295af0962181d5670ed866b2531621e5ddf 100644 --- a/applications/test/etcFiles/Test-etcFiles.C +++ b/applications/test/etcFiles/Test-etcFiles.C @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) argList::addNote ( "Locate user/group/other file with semantics similar to the " - "~OpenFOAM/fileName expansion." + "<etc>/fileName expansion." ); argList args(argc, argv, false, true); diff --git a/bin/foamCopySettings b/bin/foamCopySettings index 962edcdb62d5c529eaa5834ca98f3256b3f350f2..afc747d280df50577c2253285bcbaf8d4f1a961b 100755 --- a/bin/foamCopySettings +++ b/bin/foamCopySettings @@ -33,8 +33,8 @@ # - requires rsync # # Note -# The foamCopySettings.rc (found with the ~OpenFOAM expansion) can be used -# to add any custom rsync options. +# The foamCopySettings.rc (found via foamEtcFile) can be used to add any +# custom rsync options. #------------------------------------------------------------------------------ Script=${0##*/} @@ -51,8 +51,8 @@ Usage: $Script srcDir dstDir - requires rsync Note - The $Script.rc (found via the ~OpenFOAM expansion - see foamEtcFile) - can be used to add any custom rsync options. + The $Script.rc (found via foamEtcFile) can be used to add any + custom rsync options. USAGE exit 1 diff --git a/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C b/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C index 7404683aea7fe2674a4cbe734aa606b10dfedc6a..72ca009902d4022a1f6210db4624570c7f724cb0 100644 --- a/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C +++ b/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C @@ -162,7 +162,7 @@ bool Foam::dynamicCode::resolveTemplates } } - // Not found - fallback to ~OpenFOAM expansion + // Not found - fallback to <etc> expansion if (file.empty()) { file = findEtcFile(codeTemplateDirName/templateName); @@ -423,7 +423,7 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const << "Could not find the code template(s): " << badFiles << nl << "Under the $" << codeTemplateEnvName - << " directory or via via the ~OpenFOAM/" + << " directory or via via the <etc>/" << codeTemplateDirName << " expansion" << exit(FatalError); } diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index b287fc6d2d1965bcccf482cd598871b3b6aaf357..ea321d04b6861a39846226102df9ae896ae50ecf 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -76,7 +76,7 @@ Description Note - The document browser used is defined by the \b FOAM_DOC_BROWSER environment variable or the <tt>Documentation/docBrowser</tt> entry - in the <tt>~OpenFOAM/controlDict</tt> file. + in the <tt>\<etc\>/controlDict</tt> file. The \%f token is used as a placeholder for the file name. - The valid (mandatory) arguments can be adjusted via the addArgument static method instead of directly diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C index d66ebcb099be199467ac2ffcbf3293cfdd3bb3a0..0d86363d3f9b0f0ab2d2b444963c15018110904f 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C @@ -26,6 +26,7 @@ License #include "stringOps.H" #include "typeInfo.H" #include "etcFiles.H" +#include "Pstream.H" #include "StringStream.H" #include "OSstream.H" #include "OSspecific.H" @@ -92,8 +93,8 @@ static void expandLeadingTag(std::string& s, const char b, const char e) // Expand a leading tilde // ~/ => home directory -// ~OpenFOAM => user/group/other OpenFOAM directory // ~user => home directory for specified user +// Deprecated ~OpenFOAM => <etc> instead static void expandLeadingTilde(std::string& s) { if (s[0] != '~') @@ -121,6 +122,24 @@ static void expandLeadingTilde(std::string& s) if (user == "OpenFOAM") { + // Compat Warning + const int version(1806); + + // Single warning (on master) with guard to avoid Pstream::master() + // when Pstream has not yet been initialized + if (Pstream::parRun() ? Pstream::master() : true) + { + std::cerr + << nl + << "--> FOAM Warning :" << nl + << " Found [v" << version << "] '" + << "~OpenFOAM" << "' string expansion instead of '" + << "<etc>" << "' in string\n\"" << s << "\"\n" << nl + << std::endl; + + error::warnAboutAge("expansion", version); + } + s = findEtcFile(file); } else diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.H b/src/OpenFOAM/primitives/strings/stringOps/stringOps.H index b31f9383223956d60464910a5220c2385b618994..6e965085fa3ae669680cfae1294342b8742af509 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.H +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.H @@ -228,7 +228,6 @@ namespace stringOps // -# tilde expansion // - leading "~/" : home directory // - leading "~user" : home directory for specified user - // - leading "~OpenFOAM" : user/group/other OpenFOAM directory // // Supports default and alternative values as per the POSIX shell. // \code @@ -245,6 +244,9 @@ namespace stringOps // - Malformed entries (eg, brace mismatch, sigil followed by bad chars) // are left as is. // + // \note Deprecated(2018-11) Use "<etc>" instead of the rarely used + // "~OpenFOAM" expansion + // // \sa // Foam::findEtcFile string expand @@ -268,7 +270,6 @@ namespace stringOps // -# tilde expansion // - leading "~/" : home directory // - leading "~user" : home directory for specified user - // - leading "~OpenFOAM" : user/group/other OpenFOAM directory // // Supports default and alternative values as per the POSIX shell. // \code @@ -285,6 +286,9 @@ namespace stringOps // - Malformed entries (eg, brace mismatch, sigil followed by bad chars) // are left as is. // + // \note Deprecated(2018-11) Use "<etc>" instead of the rarely used + // "~OpenFOAM" expansion + // // \sa // Foam::findEtcFile void inplaceExpand