Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
d7bd18ba
Commit
d7bd18ba
authored
6 years ago
by
Auke Klazema
Browse files
Options
Downloads
Patches
Plain Diff
SW-595
: Move aditional search path for config files to config locator
parent
34b32f89
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
LCS/Common/include/Common/LofarLocators.h
+8
-4
8 additions, 4 deletions
LCS/Common/include/Common/LofarLocators.h
LCS/Common/src/FileLocator.cc
+1
-1
1 addition, 1 deletion
LCS/Common/src/FileLocator.cc
MAC/GCF/TM/src/GCF_Scheduler.cc
+2
-3
2 additions, 3 deletions
MAC/GCF/TM/src/GCF_Scheduler.cc
with
11 additions
and
8 deletions
LCS/Common/include/Common/LofarLocators.h
+
8
−
4
View file @
d7bd18ba
...
@@ -45,11 +45,15 @@ public:
...
@@ -45,11 +45,15 @@ public:
#define CONFIG_SUB_DIR "etc"
#define CONFIG_SUB_DIR "etc"
// Create a ConfigLocator with a default search path.
// Create a ConfigLocator with a default search path.
ConfigLocator
()
:
FileLocator
()
ConfigLocator
()
:
FileLocator
()
{
{
setSubdir
(
CONFIG_SUB_DIR
);
}
setSubdir
(
CONFIG_SUB_DIR
);
addPathAtFront
(
"$HOME/.lofar"
);
}
// Create a ConfigLocator with a predefined search path.
// Create a ConfigLocator with a predefined search path.
explicit
ConfigLocator
(
const
string
&
aPath
)
:
FileLocator
(
aPath
)
explicit
ConfigLocator
(
const
string
&
aPath
)
:
FileLocator
(
aPath
)
{
{
setSubdir
(
CONFIG_SUB_DIR
);
}
setSubdir
(
CONFIG_SUB_DIR
);
addPathAtFront
(
"$HOME/.lofar"
);
}
private
:
private
:
ConfigLocator
(
const
ConfigLocator
&
that
);
ConfigLocator
(
const
ConfigLocator
&
that
);
...
...
This diff is collapsed.
Click to expand it.
LCS/Common/src/FileLocator.cc
+
1
−
1
View file @
d7bd18ba
...
@@ -242,7 +242,7 @@ string FileLocator::locate (const string& aFile)
...
@@ -242,7 +242,7 @@ string FileLocator::locate (const string& aFile)
else
{
// test subdir
else
{
// test subdir
fullname
+=
itsSubdir
+
"/"
+
aFile
;
fullname
+=
itsSubdir
+
"/"
+
aFile
;
}
}
std
::
cout
<<
"Searching for : "
<<
fullname
<<
std
::
endl
;
result
=
stat
(
fullname
.
c_str
(),
&
fileStat
);
result
=
stat
(
fullname
.
c_str
(),
&
fileStat
);
if
(
result
==
0
)
{
// found?
if
(
result
==
0
)
{
// found?
return
(
fullname
);
return
(
fullname
);
...
...
This diff is collapsed.
Click to expand it.
MAC/GCF/TM/src/GCF_Scheduler.cc
+
2
−
3
View file @
d7bd18ba
...
@@ -112,11 +112,10 @@ void GCFScheduler::init(int argc, char** argv, const string& logfile)
...
@@ -112,11 +112,10 @@ void GCFScheduler::init(int argc, char** argv, const string& logfile)
// Try to open the log_prop file, if process has its own log_prop file then use it
// Try to open the log_prop file, if process has its own log_prop file then use it
// the INIT_LOGGER otherwise use the default mac.log_prop
// the INIT_LOGGER otherwise use the default mac.log_prop
ConfigLocator
aCL
;
ConfigLocator
aCL
;
aCL
.
addPathAtFront
(
"$HOME/.lofar"
);
// Make it search in the user directroy first
string
procName
(
basename
(
argv
[
0
]));
string
procName
(
basename
(
argv
[
0
]));
string
logPropFile
(
procName
+
".log_prop"
);
string
logPropFile
(
procName
+
".log_prop"
);
// First try logpropfile <task>.log_prop
// First try logpropfile <task>.log_prop
if
(
aCL
.
locate
(
logPropFile
)
==
""
)
{
if
(
aCL
.
locate
(
logPropFile
)
==
""
)
{
// locator could not find it try defaultname
// locator could not find it try defaultname
logPropFile
=
"mac.log_prop"
;
logPropFile
=
"mac.log_prop"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment