rpm autodeps for python
Paweł Zuzelski
z at xatka.net
Mon Jun 7 01:27:57 CEST 2010
Hello,
I'm using such a oneliner for finding python deps.
I know that it is a bit hackish, but maybe it is possible to
use it to write autodeps script for python libs?
find -name '*.py' | grep -v ^./test | grep -v ^./example | xargs grep -E '(^import|^from .* import )' | cut -d: -f2 | sort | uniq | while read I; do strace python -c "$I" 2>&1 | grep pyc | cut -d'"' -f2 | xargs rpm -qf 2>/dev/null; done | sort | uniq
It search for all "import foo" and "from foo import bar" directives,
then it tries to execute this directive using python -c under
strace, and greps output of strace for anything that looks like
loaded python library.
--
Pozdrawiam,
Paweł Zuzelski
More information about the pld-devel-en
mailing list