freebsd-ports/archivers/rpm2cpio/files/rpm2cpio
2015-12-23 10:57:49 +00:00

17 lines
284 B
Bash

#!/bin/sh
# NB! needs bsdtar/libarchive v2.8+
PATH=/bin:/usr/bin
if [ $# -eq 0 -a ! -t 0 ]; then
f=/dev/stdin
elif [ $# -eq 1 ]; then
f=$1
else
echo Usage: rpm2cpio [file.rpm]
echo dumps the contents to stdout as a GNU cpio archive
exit 0
fi
tar cf - --format=newc @- < ${f}