rpm-software-management / tito

A tool for managing rpm based git projects.
GNU General Public License v2.0
379 stars 128 forks source link

The `tito build --{s,}rpm --test` should have higher NVR than the system wide package #460

Closed praiskup closed 2 days ago

praiskup commented 1 year ago

The typical problem I have:

  1. Package Foo with Version: 1.1 and Release: 1 is tagged to upstream git, and released (to Fedora)

  2. Then tito build --test ... works fine because the generated release looks like 1.git.3548.f7f3934. This is fine, because:

    $ rpmdev-vercmp 1.1-1.git.3548.f7f3934 1.1-1
    1.1-1.git.3548.f7f3934 > 1.1-1

    IOW, the package with --test has a higher NVR than the one in Fedora.

  3. After some time, the Fedora package gets an asynchronous update by Fedora community, bumping Release: 2 (rebuild for GCC bump, e.g.)

  4. The --test package still provides the same NVR with 1.1-1.git.3548.f7f3934 which is though:

    $ rpmdev-vercmp 1.1-1.git.3548.f7f3934 1.1-2
    1.1-1.git.3548.f7f3934 < 1.1-2

If the --test package is e.g. built n Copr, or locally, it doesn't easily update the one installed on the system which complicates testing.

I'm not saying now how to resolve this, or whether we should do it by default. But it would be nice to have a way to provide a higher NVR than the one in Fedora somehow. E.g. by bumping the Version? Bumping Release to 666? I don't know.

praiskup commented 9 months ago

FWIW, tito project itself has the problem now:

$ sudo dnf copr enable @rpm-software-management/tito
$ sudo dnf update tito
...nothing happens...

the version in Copr is 0.6.24-1.fc39 compared to system default 0.6.24-2.fc39

FrostyX commented 8 months ago

Thinking out loud ... so, can we simply automatize the same thing that #480 did? When using --test, tito would add the .post1 suffix for the version? The suffix could be optional (opt-out probably) and configurable.

praiskup commented 8 months ago

For me, this is hard to predict. Can we simply try that? Seems like a nice experiment.

praiskup commented 1 week ago

Just tried to chain build the client Copr packages from git-head:

mock --chain \
/tmp/tito/python-copr-1.132-1.git.75.658230d.fc41.src.rpm \
/tmp/tito/copr-cli-1.112-1.git.78.658230d.fc41.src.rpm

But for the copr-cli package it always installs:

python3-copr                         noarch 1.132-3.fc41           fedora     241.8 KiB