Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenFOAM-plus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Development
OpenFOAM-plus
Commits
3f2caeea
Commit
3f2caeea
authored
6 years ago
by
Mark OLESEN
Browse files
Options
Downloads
Patches
Plain Diff
ENH: do not foamCleanPath on system directories (issue
#1102
)
- skip /, /bin, /usr/bin ... as potential filters.
parent
537ad464
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/foamCleanPath
+17
-5
17 additions, 5 deletions
bin/foamCleanPath
with
17 additions
and
5 deletions
bin/foamCleanPath
+
17
−
5
View file @
3f2caeea
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
# - false matches possible when the filter contains '.' (sed regex) etc.
# - false matches possible when the filter contains '.' (sed regex) etc.
# - a single composite filter can be passed in. This composite filter
# - a single composite filter can be passed in. This composite filter
# is assumed to be delimited by whitespace, colons or semi-colons.
# is assumed to be delimited by whitespace, colons or semi-colons.
# - will not filter out standard system paths (/usr/bin etc)
#
#
# Examples for cleaning the path:
# Examples for cleaning the path:
#
#
...
@@ -194,11 +195,22 @@ printDebug "input>$dirList<"
...
@@ -194,11 +195,22 @@ printDebug "input>$dirList<"
# Apply filters via sed. Path and filter cannot contain '?'.
# Apply filters via sed. Path and filter cannot contain '?'.
for
filter
for
filter
do
do
if
[
-n
"
$filter
"
]
case
"
$filter
"
in
then
(
/
|
/bin
|
/sbin
|
/lib
|
/lib64
|
/opt
\
printDebug
"remove>
$filter
<"
|
/usr
|
/usr/bin
|
/usr/sbin
|
/usr/lib
|
/usr/lib64
\
dirList
=
$(
echo
"
$dirList
:"
|
sed
-e
"s?
${
filter
}
[^:]*:??g"
)
|
/usr/local
|
/usr/local/bin
|
/usr/local/lib
|
/usr/local/lib64
)
fi
# Do not filter out system directories
printDebug
"skip>
$filter
<"
;;
(
*
)
if
[
-n
"
$filter
"
]
then
printDebug
"remove>
$filter
<"
dirList
=
$(
echo
"
$dirList
:"
|
sed
-e
"s?
${
filter
}
[^:]*:??g"
)
fi
;;
esac
done
done
printDebug
"intermediate>
$dirList
<"
printDebug
"intermediate>
$dirList
<"
...
...
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