If multiple arguments are passed to rpm2archive, convert them all to
tgz. (Previous behavior was to convert only the first one and
silently ignore the rest.)
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Co-authored-by: Florian Festi <ffesti@redhat.com>
rpm2archive previously just prepended a "." before the file name to get a local
path. This works fine for absolute paths but not for bare file names as used
in source rpms. Now we prepend "./" in these cases.
Also use the calculated file name for hard links to avoid running into this
issue twice.
Resolves: #637
rpm2cpio and rpm2archive happily write binary data to the output
terminal. This happens, for example, when I'm typing a command such as
"rpm2cpio foo.rpm | less" and I make a typo, hitting <Return> instead of
the pipe key. This often results in hilarious (if bewildering) font and
character encoding changes. On some systems, this can even result in
installation of relatively arbitrary rpms!
Nobody has ever meant to do this, and it's easy to prevent, so that's
what this patch does.
This is needed as the new payload format for large files is not compatible with
rpm2cpio which basically just dumps the payload which happened to be cpio.
Use configure parameter --without-archive to not build this tool and get rid of the libarchive requirement.