2021-11-15 20:20:43 +00:00
|
|
|
use str
|
|
|
|
|
2021-12-11 21:09:02 +00:00
|
|
|
fn -check {|f|
|
2021-11-15 20:20:43 +00:00
|
|
|
var @missings = (try {
|
2021-12-11 21:09:02 +00:00
|
|
|
sudo ldd $f 2>/dev/null | grep 'not found' | eawk {|_ m @_| put $m }
|
2021-11-15 20:20:43 +00:00
|
|
|
} except e {
|
|
|
|
})
|
|
|
|
if (> (count $missings) 1) {
|
|
|
|
var p = (LC_ALL=C pacman -Qo $f)
|
|
|
|
echo $p' seem broken: missing '(str:join ', ' $missings)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-11 21:09:02 +00:00
|
|
|
fn -check-executable {|f|
|
2021-11-15 20:20:43 +00:00
|
|
|
if ?(test -x $f) {
|
|
|
|
-check $f
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-11 21:09:02 +00:00
|
|
|
fn -cbin {||
|
2021-11-15 20:20:43 +00:00
|
|
|
echo (styled 'Searching broken binaries…' bold bright-yellow)
|
|
|
|
sudo find /usr/bin -maxdepth 1 -type f 2>/dev/null | each $-check~
|
|
|
|
}
|
|
|
|
|
2021-12-11 21:09:02 +00:00
|
|
|
fn -clib {||
|
2021-11-15 20:20:43 +00:00
|
|
|
echo (styled 'Searching broken libs…' bold bright-yellow)
|
|
|
|
sudo find /usr/lib/*.so* -maxdepth 1 -type f 2>/dev/null | each $-check-executable~
|
|
|
|
}
|
|
|
|
|
2021-12-11 21:09:02 +00:00
|
|
|
fn -copt {||
|
2021-11-15 20:20:43 +00:00
|
|
|
echo (styled 'Searching broken binariess in opt…' bold bright-yellow)
|
|
|
|
sudo find /opt -maxdepth 3 -type f 2>/dev/null | each $-check-executable~
|
|
|
|
}
|
|
|
|
|
2021-12-11 21:09:02 +00:00
|
|
|
edit:add-var checklinks~ {||
|
2021-11-15 20:20:43 +00:00
|
|
|
-cbin
|
|
|
|
-clib
|
|
|
|
-copt
|
|
|
|
}
|