Re: a script to find broken packages before they break you!
* Previdi Roberto previdi.robe...@gmail.com [27.07.2009 13:07]: hello list. I wrote this little script taking inspiration from the powerful gentoo command revdep-rebuild. It scans all the binary files in /usr/bin and shows the broken ones (the ones linking non existent library) #!/bin/sh for i in $(find /usr/bin/*); do broken=$(ldd $i | grep not found) if [ $broken != ]; then echo $i: $broken fi done i called it /usr/local/bin/revdep-scan when you run it it prints an output like this: /usr/bin/fsousaged: libfsoframework.so.0 = not found i have also seen that you can issue an opkg search missing_lib_path to find the package to reinstall, but you must pass the whole path, like /usr/lib/libfsoframework.so.0 for it to work, so i'm not able to guess it automatically (i could just try /usr/lib ...) -- roby ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community Nice script. You can use regex to search the package: LIB=$(echo $broken | awk '{print $2}') PKG=$(opkg search */${LIB} | awk '{print $1}') opkg install $PKG or build a list of packages and install them at the end of the script regards, Frederik -- IRC: playya @ Freenode, Gimpnet xmpp: pla...@draugr.de signature.asc Description: Digital signature ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
a script to find broken packages before they break you!
hello list. I wrote this little script taking inspiration from the powerful gentoo command revdep-rebuild. It scans all the binary files in /usr/bin and shows the broken ones (the ones linking non existent library) #!/bin/sh for i in $(find /usr/bin/*); do broken=$(ldd $i | grep not found) if [ $broken != ]; then echo $i: $broken fi done i called it /usr/local/bin/revdep-scan when you run it it prints an output like this: /usr/bin/fsousaged: libfsoframework.so.0 = not found i have also seen that you can issue an opkg search missing_lib_path to find the package to reinstall, but you must pass the whole path, like /usr/lib/libfsoframework.so.0 for it to work, so i'm not able to guess it automatically (i could just try /usr/lib ...) -- roby ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: a script to find broken packages before they break you!
for the script to work you may need to opkg install ldd, if it's not installed by default on your distribution. On Mon, Jul 27, 2009 at 1:06 PM, Previdi Roberto previdi.robe...@gmail.comwrote: ... broken=$(ldd $i | grep not found) ... -- roby ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: a script to find broken packages before they break you!
2009/7/27 Previdi Roberto previdi.robe...@gmail.com: hello list. I wrote this little script taking inspiration from the powerful gentoo command revdep-rebuild. It scans all the binary files in /usr/bin and shows the broken ones (the ones linking non existent library) Nice work! Presumably it only catches those that binaries are directly dependent on. If there are any that only other libraries are dependent upon, they won't be caught. Regards Jeff ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: a script to find broken packages before they break you!
umm i didn't think to this issue.. anyway it should be simple, just add /usr/lib/* to the list of checked binaries.. i'll try it On Mon, Jul 27, 2009 at 9:44 PM, Jeffrey Ratcliffe jeffrey.ratcli...@gmail.com wrote: 2009/7/27 Previdi Roberto previdi.robe...@gmail.com: hello list. I wrote this little script taking inspiration from the powerful gentoo command revdep-rebuild. It scans all the binary files in /usr/bin and shows the broken ones (the ones linking non existent library) Nice work! Presumably it only catches those that binaries are directly dependent on. If there are any that only other libraries are dependent upon, they won't be caught. Regards Jeff ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community -- roby ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community