diff options
author | Jessica Clarke <jrtc27@FreeBSD.org> | 2024-09-10 17:54:44 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2024-12-09 21:47:08 +0000 |
commit | 6608a478cddb98c1ad52ec0abae5240915fb2c57 (patch) | |
tree | 6394ca42bdb9e5cafd23f3e4ede8c16f4a121994 /tools/build | |
parent | 91549cf666db4e6064f43dfa6062904db3385a8f (diff) |
depend-cleanup.sh: Extend clean_dep to support a custom regex
This will avoid having to duplicate the loop every time the default
regex isn't good enough, and will be used by upcoming commits.
(cherry picked from commit cc30f4ae6790cf4f19bc4787d7528dfea79ef27a)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1543
Diffstat (limited to 'tools/build')
-rwxr-xr-x | tools/build/depend-cleanup.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 22baf65517fe..c12c8e203324 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -88,11 +88,12 @@ run() # $1 directory # $2 source filename w/o extension # $3 source extension +# $4 optional regex for egrep -w clean_dep() { for libcompat in "" $ALL_libcompats; do dirprfx=${libcompat:+obj-lib${libcompat}/} - if egrep -qw "$2\.$3" "$OBJTOP"/$dirprfx$1/.depend.$2.*o 2>/dev/null; then + if egrep -qw "${4:-$2\.$3}" "$OBJTOP"/$dirprfx$1/.depend.$2.*o 2>/dev/null; then echo "Removing stale ${libcompat:+lib${libcompat} }dependencies and objects for $2.$3" run rm -f \ "$OBJTOP"/$dirprfx$1/.depend.$2.* \ |