Tuesday, June 16, 2009

FileBelong

Hi!
for the Slackware users I've made just for fun a small script with the purpose to find to what package belongs a file.
Providing the full path of a file like
/bin/ls
it returns
/var/log/packages/coreutils-7.4-x86_64-1
standing for coreutils-7.4-x86_64-1.txz package

here is an example of execution
giovanni@darkstar:~/findbasepkg$ python filebelong.py /usr/lib64/libglib.a
/var/log/packages/glib-1.2.10-x86_64-3

giovanni@darkstar:~/findbasepkg$ python filebelong.py /usr/bin/lshal
/var/log/packages/hal-0.5.11-x86_64-5

giovanni@darkstar:~/findbasepkg$ python filebelong.py /bin/ls
/var/log/packages/coreutils-7.4-x86_64-1

giovanni@darkstar:~/findbasepkg$ python filebelong.py /bin/cat
/var/log/packages/coreutils-7.4-x86_64-1

giovanni@darkstar:~/findbasepkg$ python filebelong.py /usr/lib64/kde4/amarok_service_jamendo.so
/var/log/packages/amarok-2.1-x86_64-2

giovanni@darkstar:~/findbasepkg$ python filebelong.py /usr/lib64/vattelapesca.so
File /usr/lib64/vattelapesca.so not belongs to any package

You can download the script here: DOWNLOAD

Enjoy!
Gio

No comments: