globetrotterdk wrote:I get the following error when I run the script:
Code: Select all
# ./epson-inkjet-printer-nx420.SlackBuild
./epson-inkjet-printer-nx420.SlackBuild: line 48: rpm2cpio: command not found
cpio: premature end of archive
Any ideas? I can't find an rpm2cpio package anywhere in slapt-get or sourcery
Andyun wrote:Install the package "rpm" from Gslapt.
I know you have this all working now but FWIW I am pretty sure that libarchive is installed even on a fairly minimal Salix install and libarchive provides bsdtar and bsdcpio, both of which can open rpms directly. So you don't actually need the rpm package to extract the contents of an rpm.
Alternatively, you can write a
basic rpm2cpio that should work for most rpms, in less than 20 lines of shell script and far less if you are not overly concerned with supporting multiple compression formats. All of the rpm meta information is stored at the start of the file, then comes the compressed archive. So you just need to find where the compressed archive starts and break it off at that point. Most rpm2cpio implementations do this buy working out how big the meta information part of the file is by parsing it, but simply searching for first magic number match and other file characteristics of supported compression formats actually works surprisingly well.