Commit Graph

14 Commits

Author SHA1 Message Date
Justus Winter c2ef4dd2a7 Include rpmpgp.h only where it is actually needed
Include necessary headers that were previously transitively included
by including rpmpgp.h.
2021-11-17 14:21:06 +02:00
Florian Festi d8a169164c Add --nocompression option to rpm2archive
Also use popt for the command line handling. As we are using librpm
anyway there is no reason to keep the dependencies low (as with
rpm2cpio).

Resolves: #1530
2021-05-10 14:48:25 +02:00
Florian Festi 98565f9ed2 rpm2archive: Use last part of URL as file name
when getting a file from an URL. This prevents trying to write the file
at the location of the full URL which fails most of the time.

Related: #1091
2021-01-19 11:14:05 +02:00
Florian Festi f163425058 rpm2archive: Add more error handling
Cleanly error out if file can't be written instead of segfaulting

Resolves: #1091
2021-01-19 11:14:05 +02:00
Florian Festi ec3756c72a rpm2archive: Remove unneccesarity parameter 2021-01-19 11:14:05 +02:00
Panu Matilainen 57899bd3bf Fix recently introduced uninitialized variable warning in rpm2archive
Fixes "warning: ‘rc’ may be used uninitialized in this function"
introduced in commit c73b0f34e3.
2019-05-07 15:24:43 +02:00
Robbie Harwood c73b0f34e3 Fix rpm2archive behavior with multiple arguments
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>
2019-04-30 11:33:37 +02:00
Florian Festi ef422951ae rpm2archive: Fix file names for source rpms
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
2019-02-25 13:16:04 +01:00
Florian Festi c9cda9acde Use new RPMVSF_MASK_* constants 2018-06-05 11:16:36 +02:00
Peter Jones 034f1cc4fd rpm2cpio and rpm2archive: don't write archive data to a terminal.
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.
2017-01-26 14:53:01 +01:00
Florian Festi a6e662f6bd rpm2archive: return 0 on success instead of stop iteration
Solves: https://github.com/rpm-software-management/rpm/pull/94/files
Thanks to Neal Gompa (ニール・ゴンパ)<ngompa13@gmail.com> for spotting this
and proposing a solution!
2016-10-10 11:57:14 +02:00
Peter Eisentraut 0d74691d37 Additional fixes for getprogname()/setprogname() on BSD systems 2016-02-15 15:57:55 +01:00
Florian Festi 2e0e0a433a Use new xsetprogname() in rpm2archive 2016-02-11 14:09:26 +01:00
Florian Festi d24a1f8eec Add rpm2archive utility for converting rpm payload to tar archives.
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.
2014-03-11 10:49:55 +01:00