On 09/05/2012 08:07 PM, Tom Callaway wrote:
On 09/05/2012 12:48 PM, Simone Caronni wrote:
This means that even for the EPEL branch the first %if block is
evaluated; so the fedpkg on my system (Fedora 17) sets %rhel to 6 but
does not unset %fedora and they are both present.

Confirmed. fedpkg is inheriting the value of "%fedora" from the base OS
on EPEL targets.

The reason why is because fedpkg determines the dist tag values from the
branch name, and then passes them to rpm via the "--define" flag, which
overrides those specific macros if present, but leaves all the other RPM
macros intact. RPM has no "--undefine" flag to disable a macro, so the
best thing we can do is to --define the unused dist tag target to 0
(%fedora for EL branches, %rhel for Fedora branches). There is some
legacy code in fedmsg handling now-obsolete OLPC branches, so in my
patch, I just told it to treat "rhel" as the unused dist tag for the
OLPC branch case.

This change might cause a slight change in evaluated behavior, if anyone
was doing something depending on %rhel or %fedora being unset, but the
common case of checking value like you do (and like we document):

%if 0%{rhel}

should evaluate to:

00, or 0. I've tested and confirmed this fix resolves your specific
conditionals such that only one resolves on each branch.

(If you want to see this in action on a Fedora box, check out a package
that has an EPEL branch, go to the EPEL branch, and add the following
under %setup:

echo "fedora is %{?fedora}"
echo "rhel is %{?rhel}"

Then, run fedpkg prep and note the output.)

Jesse, I'm not sure if you're still the correct upstream here, please
correct me if you're not, and I'll send the patch somewhere else.

~tom

==
Fedora Project




This helps me a lot as well building el srpms from master with "fedpkg --dist el6 srpm". +1 from me.


--
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder Office                  FAX: 303-415-9702
3380 Mitchell Lane                       or...@nwra.com
Boulder, CO 80301                   http://www.nwra.com
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Reply via email to