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
8b028026
Commit
8b028026
authored
16 years ago
by
Mark Olesen
Browse files
Options
Downloads
Patches
Plain Diff
renamed bin/foamCheckSourceDeps -> bin/rmdepold and cleaned up
parent
523d0617
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/rmdepold
+34
-35
34 additions, 35 deletions
bin/rmdepold
with
34 additions
and
35 deletions
bin/
foamCheckSourceDeps
→
bin/
rmdepold
+
34
−
35
View file @
8b028026
...
...
@@ -24,32 +24,33 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
#
foamCheckSourceDeps
#
rmdepold
#
# Description
# Usage:
foamCheckSourceDeps
[dir1 .. dirN]
# Usage:
rmdepold
[dir1 .. dirN]
#
#
Search for
*.dep files that are without a corresponding .C or .L file.
# Th
ese could indicate
a directory
that
has been moved.
#
Remove
*.dep files that are without a corresponding .C or .L file.
# Th
is often occurs when
a directory has been moved.
# - print questionable directory and the *.dep file
# - optionally remove empty directories
#------------------------------------------------------------------------------
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)
-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.
Remove *
.dep files that are without a corresponding .C or .L file.
This
often occurs when
a directory has been moved.
- print questionable directory and file
- optionally remove empty directories
USAGE
exit
1
}
unset
optR
emove optrmD
ir
unset
optR
md
ir
# parse options
while
[
"$#"
-gt
0
]
...
...
@@ -58,12 +59,8 @@ do
-h
|
-help
)
usage
;;
-rm
|
-remove
)
optRemove
=
true
shift
;;
-rmdir
)
opt
rmD
ir
=
true
opt
Rmd
ir
=
true
shift
;;
-
*
)
...
...
@@ -75,36 +72,38 @@ do
esac
done
if
[
"$#"
-eq
0
]
then
set
--
.
fi
# default is the current directory
[
"$#"
-gt
0
]
||
set
--
.
for
checkDir
do
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
echo
"searching:
$checkDir
"
else
echo
"skipping non-dir:
$checkDir
"
continue
fi
done
if
[
"
$optrmDir
"
]
then
for
checkDir
find
$checkDir
-name
'*.dep'
-print
|
while
read
depFile
do
if
[
-d
$checkDir
]
# check C++ and Flex files
if
[
!
-r
"
${
depFile
%dep
}
C"
-a
!
-r
"
${
depFile
%dep
}
L"
]
;
then
echo
"
scan directory:
$checkDir
"
find
$checkDir
-depth
-type
d
-empty
-print
-exec
rmdir
\{\}
\;
echo
"
rm
$depFile
"
rm
-f
$depFile
2>/dev/null
fi
done
fi
# remove empty dirs
if
[
"
$optRmdir
"
]
then
# get subdirs ourselves so we can avoid particular directories
for
dir
in
$(
find
$checkDir
-mindepth
1
-maxdepth
1
-type
d
\(
-name
.git
-prune
-o
-print
\)
)
do
echo
"check dir:
$dir
"
find
$dir
-depth
-type
d
-empty
-exec
rmdir
{}
\;
-print
done
fi
done
# -----------------------------------------------------------------------------
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