Bug 1028953

Summary: [RFE]: Better macros for inter-collection dependencies in scl-utils
Product: [Fedora] Fedora Reporter: Bohuslav "Slavek" Kabrda <bkabrda>
Component: scl-utilsAssignee: Jan Zeleny <jzeleny>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bkabrda, jzeleny
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: scl-utils-20140127-4.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1033566 1033568 (view as bug list) Environment:
Last Closed: 2014-04-24 07:29:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1033566, 1033568    

Description Bohuslav "Slavek" Kabrda 2013-11-11 10:29:43 UTC
Current state:
Intra- and inter- collection dependency macros are currently not consistent and the intercollection dependency macro isn't very useful. Consider this case:
Collection A has package "a", collection B has package "b" and "c". "c" requires "b" and "a". Currently, "c" specfile has this:

Requires: %{?scl_prefix}b
Requires: %{?scl:%scl_require_package A a}%{!?scl:a}

The first require (intrascl dep) is fine but the second one (interscl dep) is very inconvenient. I'd like to propose modification of %scl_prefix macro to something like this (maybe it can be written in a nicer way, but it works this way):

%scl_prefix() %(if [ "%1" = "%%1" ]; then echo "%{scl}-"; else echo "%1-"; fi)

In short, this makes %scl_prefix a macro function, which uses optional argument as the scl name, and defaults to %scl if no argument is provided. With this, we would be able to use it like this:

Requires: %{?scl_prefix}b
Requires: %{?scl:%scl_prefix A}a

The second Require is now more convenient and comprehensible.

Comment 1 Jan Zeleny 2013-11-15 11:36:25 UTC
How about the final result being something like

Requires: %{scl_requires_package mysql55 mysql}

It works well regardless if it's built for scl or not, I have just tried. Would this be acceptable for you? (note that I changed the name to keep the backwards compatibility of the original macros)

Comment 2 Bohuslav "Slavek" Kabrda 2013-11-15 11:54:53 UTC
(In reply to Jan Zeleny from comment #1)
> How about the final result being something like
> 
> Requires: %{scl_requires_package mysql55 mysql}
> 
> It works well regardless if it's built for scl or not, I have just tried.
> Would this be acceptable for you? (note that I changed the name to keep the
> backwards compatibility of the original macros)

No, because I still have to use the %{!?scl:a} part in

Requires: %{?scl:%scl_require_package A a}%{!?scl:a}

if I want to build the package in a buildroot without scl-utils-build.

Also, would this cover this use case?


%global mysql_collection mysql55
Requires: %{?scl:%scl_prefix %{?mysql_collection}}mysql # => mysql55-mysql

# now delete definition of mysql_collection macro
Requires: %{?scl:%scl_prefix %{?mysql_collection}}mysql # <current_scl>-mysql


My implementation does.

Comment 3 Jan Zeleny 2013-11-15 14:56:25 UTC
Ok, thanks for the information. I was just playing here with a few possibilities so I wanted to better understand your use case.

Comment 4 Fedora Update System 2014-04-11 15:27:04 UTC
scl-utils-20140127-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/scl-utils-20140127-4.fc19

Comment 5 Fedora Update System 2014-04-11 15:27:16 UTC
scl-utils-20140127-4.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/scl-utils-20140127-4.fc20

Comment 6 Fedora Update System 2014-04-15 15:33:07 UTC
Package scl-utils-20140127-4.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing scl-utils-20140127-4.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-5071/scl-utils-20140127-4.fc19
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2014-04-24 07:29:25 UTC
scl-utils-20140127-4.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2014-04-24 07:32:59 UTC
scl-utils-20140127-4.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.