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
_______________________________________________
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en

Reply via email to