Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
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
Analyze
Contributor analytics
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
Development
openfoam
Commits
bad35371
Commit
bad35371
authored
16 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
bin/foamCheckSourceDeps works again
- added -rm | -remove option - added -rmdir option
parent
a42e73af
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/foamCheckSourceDeps
+64
-24
64 additions, 24 deletions
bin/foamCheckSourceDeps
with
64 additions
and
24 deletions
bin/foamCheckSourceDeps
+
64
−
24
View file @
bad35371
...
...
@@ -31,40 +31,80 @@
#
# Search for *.dep files that are without a corresponding .C or .L file.
# These could indicate a directory that has been moved.
# - print questionable directory
and dep file
# - print questionable directory and
the *.
dep file
#------------------------------------------------------------------------------
if
[
"
$1
"
=
"-h"
-o
"
$1
"
=
"-help"
]
then
cat
<<
USAGE
1>&2
Usage:
${
0
##*/
}
[dir1 .. dirN]
usage
()
{
while
[
"$#"
-ge
1
]
;
do
echo
"
$1
"
;
shift
;
done
cat
<<
USAGE
1>&2
Usage:
${
0
##*/
}
[OPTION] [dir1 .. dirN]
options:
-rm | -remove remove the offending .dep file
-rmdir find and remove empty directories (recursively)
* Search for .dep files that are without a corresponding .C or .L file.
This could indicate a directory that has been moved.
- print questionable directory and file
Search for .dep files that are without a corresponding .C or .L file.
This could indicate a directory that has been moved.
- print questionable directory and file
USAGE
exit
1
fi
exit
1
}
unset
optRemove optrmDir
# parse options
while
[
"$#"
-gt
0
]
do
case
"
$1
"
in
-h
|
-help
)
usage
;;
-rm
|
-remove
)
optRemove
=
true
shift
;;
-rmdir
)
optrmDir
=
true
shift
;;
-
*
)
usage
"unknown option: '
$*
'"
;;
*
)
break
;;
esac
done
if
[
"$#"
-eq
0
]
then
set
--
.
set
--
.
fi
for
checkDir
do
if
[
-d
$checkDir
]
then
find
$checkDir
-name
'*.dep'
-print
|
while
read
depFile
;
do
Cfile
=
$(
echo
$depFile
|
sed
-e
's/\.dep$/.C/'
)
# also check flex files
Lfile
=
$(
echo
$depFile
|
sed
-e
's/\.C$/.L/'
)
if
[
!
-f
$Cfile
-a
!
-f
$Lfile
]
then
echo
"
$(
dirname
$Cfile
)
${
depFile
##*/
}
"
fi
done
fi
if
[
-d
$checkDir
]
then
find
$checkDir
-name
'*.dep'
-print
|
while
read
depFile
do
# check C++ and Flex files
if
[
!
-r
"
${
depFile
%dep
}
C"
-a
!
-r
"
${
depFile
%dep
}
L"
]
;
then
echo
"
${
depFile
%/[^/]*
}
${
depFile
##*/
}
"
[
"
$optRemove
"
]
&&
rm
-f
$depFile
fi
done
fi
done
if
[
"
$optrmDir
"
]
then
for
checkDir
do
if
[
-d
$checkDir
]
then
echo
"scan directory:
$checkDir
"
find
$checkDir
-depth
-type
d
-empty
-print
-exec
rmdir
\{\}
\;
fi
done
fi
# -----------------------------------------------------------------------------
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