cat-in-136 / cargo-generate-rpm

Cargo helper command to generate a binary RPM package
MIT License
92 stars 19 forks source link

mc cannot read resulting rpm file #59

Closed troelsarvin closed 1 year ago

troelsarvin commented 1 year ago

The Midnight Commander (mc) tool is nice for inspecting RPM files. Unfortunately, for some reason, mc cannot open the RPM files resulting from "cargo generate-rpm". mc writes a number of error messages like "Cannot parse: -r--r--r-- 1 root root 495 e) HEADER", see attached screenshot: sshot_genrpm_error

Attached is also some code which can be used to reproduce the issue: genrpm.tar.gz

Perhaps generate-rpm is not be producing metadata which mc needs? Some may see this as an issue in mc, but there could be other RPM-related tools which will also trip over this, hence this ticket. The related mc code seems to be this script, but I don't see anything obviously wrong in it: https://github.com/MidnightCommander/mc/blob/master/src/vfs/extfs/helpers/rpm

cat-in-136 commented 1 year ago

Ah, Midnight Commander, the good old file manager I had long forgotten about.

The generated RPM file has the "Build Date" set to "(none)". the mc scripts do not take "(none)" into account. The e) is an improperly extracted string from "Build Date : (none)". This behavior can be observed by running sh -x /usr/libexec/mc/extfs.d/rpm list target/generate-rpm/genrpm-0.1.0-1.x86_64.rpm.

This can be attributed to an omission in the mightnight commander script, or to a lack of functionality in the rust rpm library (missing function to set the build date).

troelsarvin commented 1 year ago

OK, so I'l try to propose a code change (or at least raise a ticket about it) to the relevant RPM crate for adding bulid date. I'm trying to find out which RPM crate is the official one, and it's confusing. It seems there are at least two different codebases, and both have several forks:

:-(

cat-in-136 commented 1 year ago

https://github.com/Richterrettich/rpm-rs/ ( https://crates.io/crates/rpm-rs ) is original but no longer maintained. https://github.com/rpm-rs/rpm/ ( https://crates.io/crates/rpm ) is active now.

see also #51

troelsarvin commented 1 year ago

I've sent a pull request to rpm-rs. It's not relevant to keep this issue open any longer.