Menu

#18 rpmrebuild 2.20: rpm2archive called with incorrect arguments

v1.0_(example)
closed
None
5
2025-07-13
2024-12-13
Blair Zajac
No

According to rpm2archive manual page:

   rpm2archive converts the .rpm  files  specified  as  arguments  to  tar
   files.  By  default  they  are  gzip  compressed and saved with postfix
   ".tgz".

   If '-' is given as argument, an rpm stream is read from standard in and
   written to standard out.

I think the call to rpm2archive ${RPMREBUILD_PAQUET} needs to be changed from passing the file on the command line to using - and reading and writing from stdin and stdout.

Otherwise, using rpmrebuild -p PACKAGE fails for me.

See the attached patch.

Also, a minor nit, can BuildRequires: make be added to the rpmrebuild.spcto ensure that make is present during the build?

1 Attachments

Discussion

  • eric gerbier

    eric gerbier - 2024-12-15
    • status: open --> pending
    • assigned_to: eric gerbier
     
  • eric gerbier

    eric gerbier - 2024-12-15

    The man page of rpm2archive gives several examples of use :
    rpm2archive glint-1.0-1.i386.rpm | tar -xvz
    cat glint-1.0-1.i386.rpm | rpm2archive - | tar -tvz
    the fist line is the way rpm2archive is used in rpmrebuild code, so the syntax should be ok
    and my regression tests ( in t/rpmrebuild_basic.t file) do not fail.

    could you send a full output of the failed command : rpmrebuild with args and output ?
    So I can try to reproduce, fix and add more regression tests

     
  • Anonymous

    Anonymous - 2024-12-15

    I'm using RHEL9 and the manual page gives these examples:

    EXAMPLES
    rpm2archive glint-1.0-1.i386.rpm ; tar -xvz glint-1.0-1.i386.rpm.tgz
    cat glint-1.0-1.i386.rpm | rpm2archive - | tar -tvz

    Here's my reproduction recipe:

    $ wget https://sourceforge.net/projects/rpmrebuild/files/rpmrebuild/2.20/rpmrebuild-2.20-1.noarch.rpm/download
    $ mv download rpmrebuild-2.20-1.noarch.rpm
    $ sudo dnf install rpmrebuild-2.20-1.noarch.rpm

    $ wget https://download.rockylinux.org/pub/rocky/9/BaseOS/aarch64/os/Packages/b/bash-5.1.8-9.el9.aarch64.rpm
    $ rpmrebuild -p bash-5.1.8-9.el9.aarch64.rpm
    bash-5.1.8-9.el9.aarch64
    (GenRpmQf) remove tag line ENHANCESFLAGS
    (GenRpmQf) remove tag line ENHANCESNAME
    (GenRpmQf) remove tag line ENHANCESVERSION
    (GenRpmQf) remove tag line SUGGESTSFLAGS
    (GenRpmQf) remove tag line SUGGESTSNAME
    (GenRpmQf) remove tag line SUGGESTSVERSION
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY
    warning: bash-5.1.8-9.el9.aarch64.rpm: Header V4 RSA/SHA256 Signature, key ID 350d275d: NOKEY

    gzip: stdin: unexpected end of file
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now
    /usr/lib/rpmrebuild/rpmrebuild.sh: ERROR: (RpmUnpack) rpm2archive
    /usr/lib/rpmrebuild/rpmrebuild.sh: ERROR: (CreateBuildRoot) RpmUnpack
    /usr/lib/rpmrebuild/rpmrebuild.sh: ERROR: CreateBuildRoot

    Thanks

     
  • eric gerbier

    eric gerbier - 2024-12-17

    I am developping rpmrebuild on fedora (currently 41) and I was not able to reproduce the problem - my arch is x84_64, so I can't rebuild bash-5.1.8-9.el9.aarch64.rpm
    - I have no problem with bash-5.1.8-9.el9.x86_64.rpm

    but your change is valid and pass my regression test, so it will be included in 2.21 release

     
    • Gregory Young

      Gregory Young - 2025-06-06

      Do you have an ETA on 2.21? I just encountered this bug on AlmaLinux 9 trying the rebuild RPMs built on a CentOS 7 machine (it builds a CentOS 7 component, packages it, then wraps it in an RPM to install on the AlmaLinux 9 server it is downloaded from). The issue is CentOS 7 cannot create the RPM with the proper SHA256 Header and Payload digests, and as a result will not install in FIPS mode... This project solves that problem for me, I just need to be able to tell my build containers to pull release 2.21 from EPEL after it is released... :)

       
      • eric gerbier

        eric gerbier - 2025-06-07

        the code is already fixed in the devel branch. Il will release th 2.21 in june

         
        ❤️
        1
  • Anonymous

    Anonymous - 2024-12-17

    Thanks for the quick fi! BTW, it appears that RHEL9 is based off of Fedora 34: https://docs.fedoraproject.org/en-US/quick-docs/fedora-and-red-hat-enterprise-linux/ which is quite a bit older than Fedora 41.

     
  • Anonymous

    Anonymous - 2025-07-04

    yes, it looks like older versions of rpm2archive does not support "rpm2archiv $Package | tar ..." and mention only cat $package |rpm2archive - | tar ...

    I just rewrite the line in the RpmUnpack function

     
  • eric gerbier

    eric gerbier - 2025-07-13
    • status: pending --> closed
     
  • eric gerbier

    eric gerbier - 2025-07-13

    the problem is fixed in 2.21 release

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB