about summary refs log tree commit diff
path: root/xcheckrestart
blob: aa3b138b311bfebb9b52cb61d5e9ddf3af8194d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# xcheckrestart [-v] - list programs using outdated libraries

verbose=false
[ "$1" = -v ] && verbose=true

for f in /proc/[0-9]*; do
	LIBS=$(grep -Po '    *\K    .* \(deleted\)$' $f/maps 2>/dev/null |
		grep -v -e /SYSV -e /.cache/fontconfig -e 'drm mm object' |
	       	sort -u )
	if [ "$LIBS" ]; then
		EXE=$(readlink $f/exe)
		PKG=$(xbps-query -o "${EXE% (deleted)}")
		PKG=${PKG%%:*}
		PKG=${PKG%-*}
		printf '%d %s (%s)\n' ${f#/proc/} "$EXE" "$PKG"
		$verbose && printf '%s\n' "$LIBS"
	fi
done