mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-25 01:55:19 +01:00
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.
This commit is contained in:
parent
a86678a3d6
commit
cc30f4ae67
@ -89,11 +89,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.* \
|
||||
|
Loading…
Reference in New Issue
Block a user