Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpm2cpio broken? [requires unzstd installed] #3

Open
saltedcoffii opened this issue Feb 23, 2021 · 2 comments
Open

rpm2cpio broken? [requires unzstd installed] #3

saltedcoffii opened this issue Feb 23, 2021 · 2 comments

Comments

@saltedcoffii
Copy link

saltedcoffii commented Feb 23, 2021

When running this command:

$ python3.9 rpm2cpio.py xclip-0.13-10.fc33.x86_64.rpm  | cpio -it

I got this output:

Traceback (most recent call last):
  File "/usr/local/build/rpm2cpio/rpm2cpio-2017/./rpm2cpio.py", line 96, in <module>
    rpm2cpio(fin)
  File "/usr/local/build/rpm2cpio/rpm2cpio-2017/./rpm2cpio.py", line 88, in rpm2cpio
    data = decompress(data[pos:])
  File "/usr/local/build/rpm2cpio/rpm2cpio-2017/./rpm2cpio.py", line 48, in gzip_decompress
    gzstream = StringIO(data)
TypeError: initial_value must be str or None, not bytes
cpio: premature end of archive

After running

$ python2.7 rpm2cpio.py xclip-0.13-10.fc33.x86_64.rpm  | cpio -it

I got:

cpio: premature end of archive

Here's the rpm file I was using:
https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/33/Everything/x86_64/os/Packages/x/xclip-0.13-10.fc33.x86_64.rpm

@ruda
Copy link
Owner

ruda commented Jun 4, 2021

Looks like a bug:

$ python3 rpm2cpio.py xclip-0.13-10.fc33.x86_64.rpm 
Error: xclip-0.13-10.fc33.x86_64.rpm [Errno 2] No such file or directory: 'unzstd'

The payload in the RPM was compressed with zstd so you'll need to install unzstd command line to uncompress it.

There isn't any zstd module in Python standard library, so this is an external requirement.

@ruda ruda changed the title rpm2cpio broken? rpm2cpio broken? [requires unzstd installed] Jun 4, 2021
@ruda
Copy link
Owner

ruda commented Jul 22, 2021

Fedora switching RPMs to zstd compression, «Binary RPMs are currently compressed with xz level 2. Switching to zstd would increase decompression speed significantly.»

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants