#111 centpkg prep does set %fedora
Closed 2 months ago by tdawson. Opened 2 months ago by churchyard.

Similar to https://git.centos.org/centos/centpkg/issue/71 and https://git.centos.org/centos/centpkg/issue/33 and https://git.centos.org/centos/centpkg/issue/111

Consider this:

%prep
echo %{fedora}
echo %{centos}
echo %{rhel}
echo %{epel}
exit 0

On centpkg --release c10s prep I get:

+ echo 39
39
+ echo '%{centos}'
%{centos}
+ echo 10
10
+ echo '%{epel}'
%{epel}

But %fedora should not be set.

centpkg-0.8.12-1.fc39


I just hit this today in a very confusing way when trying to push the c10s bind to c9s-sig-hyperscale (so I could backport it):

error: bare words are no longer supported, please use "...":  040 >= 41 && ! 09s
error:                                                                         ^
error: /tmp/tmpkojydc2p:37: bad %if condition:  040 >= 41 && ! 09s
Could not execute pre_push_check: Failed to execute command.

which I'm pretty sure comes from the %if 0%{?fedora} >= 41 && ! 0%{?rhel} in the spec

Thank you for the test, because that makes the investigation easier. Quite possibly the reason I was never able to see it was I was testing on a RHEL machine.

RHEL9:

+ echo '%{fedora}'
%{fedora}
+ echo '%{centos}'
%{centos}
+ echo 10
10
+ echo '%{epel}'
%{epel}

Fedora Rawhide:

+ echo 42
42
+ echo '%{centos}'
%{centos}
+ echo 10
10
+ echo '%{epel}'
%{epel}

I also tested this on fedpkg, but no bug there, it does it correctly.
Anyway, not saying I have a fix yet, just that I'm looking at it, and can reproduce the problem,

fedpkg has a whole regex matching if/elif chain that does several things. One of the things it does is set the "%undefine" variable that is passed to rpmbuild when it's running. Well, actually it is used in the load_rpmdefines function, that get's used in various ways.

centpkg uses a completely different set of ways to determine the settings in load_rpmdefines, so it's not going to be as easy as adding the extra setting. But certainly do-able.

Note: I'm putting this in this issue in-case I suddenly get pulled away to something else. I (or someone else) will be able to start up where I stopped.

The merge request has been merged.
This should be fixed in centpkg-0.8.13-1 which has been built on all supported distributions.
If this passes testing, I'll close this issue when it is pushed out to all supported distributions.

The fixed release of centpkg (0.8.13) has been released to all supported distributions.

Metadata Update from @tdawson:
- Issue status updated to: Closed (was: Open)

2 months ago

Log in to comment on this ticket.

Metadata