Wednesday, January 30, 2008

making things easy - single command for any archive

Since we are on the topic of commands (previous post), I have been using this simple utility (called "e") that makes it possible to extract almost _any_ type of archive. I have been able to use it successfully for .zip, .tar, .tar.gz,, .deb and (wait for it.....) .rpm.

It is written in Ruby and recognizes the type of source from its content and not by extension.

It's I will never need to remember the "-" options for any of the individual commands. But thats the least impressive benefit according to me. The fact that it allows me to extract an RPM package is the best. Check this post out about using rpm2cpio to extract an RPM (of course without installing it) since there is no option with the 'rpm' command itself.

rutul@rutul-laptop:~/tmp$ e php-5.1.4-1.esp1.x86_64.rpm

19188 blocks
rutul@rutul-laptop:~/tmp$ ls
etc php-5.1.4-1.esp1.x86_64.rpm usr var

However, not much success with this experiment. A few days ago, after I compiled a kernel RPM, installed it and created the initrd image, I had trouble booting because it was missing some modules. So, I had to dig into it to check if everything I had wanted did get compiled/build in.

So, this is what I had to do:
mv initrd-2.6.21-1.3194.fc7.img initrd-2.6.21-1.3194.fc7.gz
gunzip <>

Now I tried to do:
rutul@rutul-laptop:/boot/tmp$ sudo e initrd.img-2.6.20-16-generic
gzip: initrd.img-2.6.20-16-generic: unknown suffix -- ignored

ERROR extraction not successful with these files:
initrd.img-2.6.20-16-generic: gzip compressed data, from Unix, last modified: Tue Jan 29 02:03:36 2008, max compression

As you can see, no luck there.

No comments: