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

From: Alexander Leidinger <Alexander_at_leidinger.net>
Date: Mon, 14 Dec 2020 09:38:38 +0100
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

Received on Mon Dec 14 2020 - 07:39:07 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:26 UTC