I download alot of srpms to rummage through, I used to go through a long winded approach,
root@server$ curl rpm -o file.rpm root@server$ rpm2cpio file.rpm | cpio -id
but that leaves behind an ugly file.rpm so I tried a single pipeline
root@server$ curl rpm | rpm2cpio - | cpio -id
According to the curl manpage curl outputs to stdout by default and the rpm2cpio man page says that if the only argument is '-' that it will read from stdin.
However I keep getting errors:
error: rpm2cpio: headerRead failed: hdr blob(23176): BAD, read returned 2696 error reading header from package cpio: premature end of archive 0 5468k 0 13257 0 0 21912 0 0:04:15 --:--:-- 0:04:15 29791 curl: (23) Failed writing body (379 != 1348)
if I try catting the downloaded file into the pipeline instead of using curl it works.
Now I am aware there are a number of ways around this, and when I can be bothered I'll probably script this. I was just curious as to why rpm doesn't like the rpm outputted by curl.