Identifying broken applications following careless use of make -DBATCH_DELETE_OLD_FILES delete-old-libs

Alexander Leidinger Alexander at leidinger.net
Mon Dec 14 08:39:07 UTC 2020


Quoting Graham Perrin <grahamperrin at gmail.com> (from Mon, 14 Dec 2020  
07:41:45 +0000):

> Re:  
> <https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html#updating-src-completing-check-old> I made careless use  
> of:
>
> cd /usr/src && make -DBATCH_DELETE_OLD_FILES delete-old-libs
[...]
> Please: how can I positively identify other applications that I  
> might have broken through careless deletion of old libraries?

% cat remove_old_libs_with_unresolved_libs.sh
#!/bin/sh

find /usr/local/*bin* /usr/local/lib* -type f \
| xargs ldd -f '%p|%A\n' 2>/dev/null \
| grep '^not found' | grep compat/pkg | cut -d '|' -f2 \
| sort -u | xargs rm -v

% cat list_ports_using_nonexisting_lib.sh
#!/bin/sh

find /usr/local/*bin* /usr/local/lib* -type f \
| xargs ldd -f '%p|%A\n' 2>/dev/null \
| grep '^not found' | cut -d '|' -f2 \
| xargs pkg which -q | sort -u


Bye,
Alexander.

-- 
http://www.Leidinger.net Alexander at Leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org    netchild at FreeBSD.org  : PGP 0x8F31830F9F2772BF
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digitale PGP-Signatur
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20201214/4b444cea/attachment.sig>


More information about the freebsd-current mailing list