Skip to content

SRPM should not be recorded in RPMDB #4061

@voxik

Description

@voxik

In my mock environment, I have accidentally installed SRPMs like this:

$ mock -r fedora-rawhide-x86_64 -i /var/lib/mock/fedora-rawhide-x86_64/result/rubygem-cucumber-gherkin-22.0.0-11.fc44.noarch.rpm /var/lib/mock/fedora-rawhide-x86_64/result/rubygem-cucumber-core-10.1.0-12.fc44.src.rpm /var/lib/mock/fedora-rawhide-x86_64/result/rubygem-cucumber-messages-31.0.0-1.fc44.src.rpm 
INFO: mock.py version 6.5 starting (python version = 3.14.0, NVR = mock-6.5-1.fc44), args: /usr/libexec/mock/mock -r fedora-rawhide-x86_64 -i /var/lib/mock/fedora-rawhide-x86_64/result/rubygem-cucumber-gherkin-22.0.0-11.fc44.noarch.rpm /var/lib/mock/fedora-rawhide-x86_64/result/rubygem-cucumber-core-10.1.0-12.fc44.src.rpm /var/lib/mock/fedora-rawhide-x86_64/result/rubygem-cucumber-messages-31.0.0-1.fc44.src.rpm
Start: init plugins
INFO: selinux enabled
Finish: init plugins
INFO: Signal handler active
Start: run
Mock Version: 6.5
INFO: Mock Version: 6.5
Start: chroot init
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled package manager cache
Start: cleaning package manager metadata
Finish: cleaning package manager metadata
INFO: enabled HW Info plugin
INFO: Package manager dnf5 detected and used (fallback)
Finish: chroot init
INFO: installing package(s): /var/lib/mock/fedora-rawhide-x86_64/result/rubygem-cucumber-gherkin-22.0.0-11.fc44.noarch.rpm /var/lib/mock/fedora-rawhide-x86_64/result/rubygem-cucumber-core-10.1.0-12.fc44.src.rpm /var/lib/mock/fedora-rawhide-x86_64/result/rubygem-cucumber-messages-31.0.0-1.fc44.src.rpm
Updating and loading repositories:
 fedora                                 100% |  19.3 KiB/s |  10.7 KiB |  00m01s
Repositories loaded.
Package                    Arch   Version          Repository        Size
Installing:
 rubygem-cucumber-core     src    0:10.1.0-12.fc44 @commandline  53.8 KiB
 rubygem-cucumber-messages src    0:31.0.0-1.fc44  @commandline  25.0 KiB

Transaction Summary:
 Installing:         2 packages

Package "rubygem-cucumber-gherkin-22.0.0-11.fc44.noarch" is already installed.

Total size of inbound packages is 93 KiB. Need to download 0 B.
After this operation, 79 KiB extra will be used (install 79 KiB, remove 0 B).
Running transaction
[1/4] Verify package files              100% |   1.0 KiB/s |   2.0   B |  00m00s
[2/4] Prepare transaction               100% | 666.0   B/s |   2.0   B |  00m00s
[3/4] Installing rubygem-cucumber-messa 100% |   1.4 MiB/s |  25.4 KiB |  00m00s
[4/4] Installing rubygem-cucumber-core- 100% | 869.4 KiB/s |  54.8 KiB |  00m00s
Warning: skipped OpenPGP checks for 2 packages from repository: @commandline
Complete!
INFO: enabled unbreq plugin (postyum)
INFO: 
Finish: run

Having mock unbreq plugin installed and enabled, I have subsequently hit error like this:

... snip ...

  File "/usr/lib64/python3.14/subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/rpm', '--root', '/var/lib/mock/fedora-rawhide-x86_64/root', '-q', '--qf', '[%{FILENAMES}\\n]', 'ruby-0:3.4.7-28.fc44.x86_64', 'ruby-libs-0:3.4.7-28.fc44.x86_64', 'rubygem-cucumber-messages-0:17.1.0-10.fc43.noarch', 'rubygem-rspec-0:3.13.2-1.fc44.noarch', 'rubygem-sys-uname-0:1.2.2-11.fc44.noarch', 'rubygems-devel-0:3.6.9-28.fc44.noarch', 'rubygem-bigdecimal-0:3.1.8-28.fc44.x86_64', 'rubygem-bundler-0:2.6.9-28.fc44.noarch', 'rubygem-childprocess-0:4.1.0-12.fc44.noarch', 'rubygem-contracts-0:0.17.2-4.fc43.noarch', 'rubygem-cucumber-0:7.1.0-14.fc43.noarch', 'rubygem-cucumber-core-0:10.1.0-11.fc44.noarch', 'rubygem-cucumber-core-0:10.1.0-12.fc44.src', 'rubygem-cucumber-gherkin-0:22.0.0-11.fc44.noarch', 'rubygem-cucumber-messages-0:31.0.0-1.fc44.src', 'rubygem-cucumber-tag-expressions-0:4.0.2-10.fc43.noarch', 'rubygem-json-0:2.15.1-1.fc44.x86_64', 'rubygem-kramdown-parser-gfm-0:1.1.0-16.fc43.noarch', 'rubygem-minitest-0:5.26.2-1.fc44.noarch', 'rubygem-rspec-core-0:3.13.6-2.fc44.noarch', 'rubygem-thor-0:1.3.2-3.fc44.noarch', 'libyaml-0:0.2.5-17.fc43.x86_64', 'ruby-bundled-gems-0:3.4.7-28.fc44.x86_64', 'ruby-default-gems-0:3.4.7-28.fc44.noarch', 'rubygem-builder-0:3.3.0-3.fc43.noarch', 'rubygem-cucumber-create-meta-0:6.0.1-10.fc43.noarch', 'rubygem-cucumber-cucumber-expressions-0:17.1.0-4.fc43.noarch', 'rubygem-cucumber-wire-0:6.2.1-5.fc43.noarch', 'rubygem-diff-lcs-0:1.5.0-9.fc44.noarch', 'rubygem-ffi-0:1.17.0-5.fc44.x86_64', 'rubygem-io-console-0:0.8.1-28.fc44.x86_64', 'rubygem-irb-0:1.14.3-28.fc44.noarch', 'rubygem-kramdown-0:2.5.1-3.fc43.noarch', 'rubygem-mime-types-0:3.4.1-8.fc44.noarch', 'rubygem-mime-types-data-0:3.2023.0218.1-6.fc43.noarch', 'rubygem-multi_test-0:0.1.2-20.fc43.noarch', 'rubygem-psych-0:5.2.2-28.fc44.x86_64', 'rubygem-rbs-0:3.8.0-28.fc44.x86_64', 'rubygem-rdoc-0:6.14.2-201.fc44.noarch', 'rubygem-rexml-0:3.4.4-28.fc44.noarch', 'rubygem-rspec-expectations-0:3.13.5-3.fc44.noarch', 'rubygem-rspec-mocks-0:3.13.7-2.fc44.noarch', 'rubygem-rspec-support-0:3.13.6-1.fc44.noarch', 'rubygems-0:3.6.9-28.fc44.noarch', 'rubypick-0:1.1.1-23.fc43.noarch']' returned non-zero exit status 2.

This was surprising, but after analysis, this can be reduced to:

$ rpm  --root /var/lib/mock/fedora-rawhide-x86_64/root -q rubygem-cucumber-core-0:10.1.0-12.fc44.src rubygem-cucumber-messages-0:31.0.0-1.fc44.src
package rubygem-cucumber-core-0:10.1.0-12.fc44.src is not installed
package rubygem-cucumber-messages-0:31.0.0-1.fc44.src is not installed

Now if I ask RPM generically, it knows about installed RPM as well as SRPM:

$ rpm  --root /var/lib/mock/fedora-rawhide-x86_64/root -qa rubygem-cucumber-core
rubygem-cucumber-core-10.1.0-11.fc44.noarch
rubygem-cucumber-core-10.1.0-12.fc44.src

So far so good, but the latter command from the following example is surprising to me:

$ rpm  --root /var/lib/mock/fedora-rawhide-x86_64/root -q rubygem-cucumber-core-10.1.0-11.fc44.noarch
rubygem-cucumber-core-10.1.0-11.fc44.noarch

$ rpm  --root /var/lib/mock/fedora-rawhide-x86_64/root -q rubygem-cucumber-core-10.1.0-12.fc44.src
package rubygem-cucumber-core-10.1.0-12.fc44.src is not installed

Why RPM claims the SRPM is not installed? Previously, it knew about that ....

Testing with:

$ rpm -q rpm
rpm-6.0.0-1.fc44.x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions