Bug 1489315

Summary: Error: Invalid version flag: if
Product: [Fedora] Fedora Reporter: Lukas Slebodnik <lslebodn>
Component: yumAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bfinger, ignatenko, james.antill, jbowes, katzj, kdudka, michele, packaging-team-maint, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-04 14:57:04 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:

Description Lukas Slebodnik 2017-09-07 07:56:37 UTC
Description of problem:

I know it is a little bit corner case to still use yum-deprecated
but it is done for historical reasons. And I would appreciate if it still works.
At least in the same way as weak dependencies. IIUC weak dependencies are ignored by yum-deprecated.

Version-Release number of selected component (if applicable):

sh# rpm -q yum
yum-3.4.3-515.fc28.noarch


How reproducible:
Deterministic

Steps to Reproduce:
1. docker run -ti --rm docker.io/fedora:26 bash
// run rest of commands within in contianer 
2. dnf install -y --setopt=debuglevel=0 --setopt=errorlevel=0 --nogpgcheck yum fedora-repos-rawhide
3. yum-deprecated --disablerepo=* --enablerepo=rawhide update dnf

// previous "magic dancing" steps were required because I was not able to have
// older dnf with yum in the same time in rawhide container.

Actual results:
[root@3121dcf36c66 /]# yum-deprecated --disablerepo=* --enablerepo=rawhide update dnf
Yum command has been deprecated, use dnf instead.
See 'man dnf' and 'man yum2dnf' for more information.

Resolving Dependencies
--> Running transaction check
---> Package dnf.noarch 0:2.5.1-1.fc26 will be updated
--> Processing Dependency: dnf = 2.5.1-1.fc26 for package: dnf-yum-2.5.1-1.fc26.noarch
---> Package dnf.noarch 0:2.6.3-7.fc28 will be an update
Error: Invalid version flag: if

Expected results:

Package upgraded without any problem

Additional info:

//following outputis from rawhide machine and not for previous simpler reproducer.

[root@vm-122 ~]# yum-deprecated update --setopt=debuglevel=5 --setopt=errorlevel=2 dnf
Yum command has been deprecated, use dnf instead.
See 'man dnf' and 'man yum2dnf' for more information.

Config time: 0.011
Ignored option -q, -v, -d or -e (probably due to merging: -yq != -y -q)
Yum version: 3.4.3
rpmdb time: 0.000
Setting up Package Sacks
pkgsack time: 0.022
Building updates object
up:Obs Init time: 0.436
up:simple updates time: 0.013
up:obs time: 0.020
up:condense time: 0.000
updates time: 1.824
Not Updating Package that is already updated: dnf.noarch 0:2.6.3-4.fc28
Not Updating Package that is already updated: dnf.noarch 0:2.6.3-4.fc28
Resolving Dependencies
--> Running transaction check
---> Package dnf.noarch 0:2.6.3-4.fc28 will be updated
Checking deps for dnf.noarch 0:2.6.3-4.fc28 - ud
dnf-yum-2.6.3-4.fc28.noarch requires: dnf = 2.6.3-4.fc28
--> Processing Dependency: dnf = 2.6.3-4.fc28 for package: dnf-yum-2.6.3-4.fc28.noarch
Potential Provider: dnf.noarch 0:2.6.3-4.fc28
Mode is ud for provider of dnf = 2.6.3-4.fc28: dnf.noarch 0:2.6.3-4.fc28
Mode for pkg providing dnf = 2.6.3-4.fc28: ud
Trying to update dnf-yum-2.6.3-4.fc28.noarch to resolve dep
---> Package dnf.noarch 0:2.6.3-7.fc28 will be an update
Checking deps for dnf.noarch 0:2.6.3-7.fc28 - u
looking for ('python3-dnf', 'EQ', ('0', '2.6.3', '7.fc28')) as a requirement of dnf.noarch 0:2.6.3-7.fc28 - u
looking for ('(python3-dbus if NetworkManager)', None, (None, None, None)) as a requirement of dnf.noarch 0:2.6.3-7.fc28 - u
Error: Invalid version flag: if

Comment 1 Igor Gnatenko 2017-09-07 14:45:59 UTC
Yum doesn't work with rich dependencies and never will.... We are actually planning to retire it ;)

Comment 2 Lukas Slebodnik 2017-11-04 20:52:08 UTC
Have you consider ignoring/skipping rich dependencies in yum?

Comment 3 Igor Gnatenko 2017-11-05 07:39:52 UTC
(In reply to Lukas Slebodnik from comment #2)
> Have you consider ignoring/skipping rich dependencies in yum?

What's the point? In this case, use rpm --nodeps.

Comment 4 Lukas Slebodnik 2017-11-06 10:24:10 UTC
(In reply to Igor Gnatenko from comment #3)
> (In reply to Lukas Slebodnik from comment #2)
> > Have you consider ignoring/skipping rich dependencies in yum?
> 
> What's the point?

The point is to ignore rich dependencies the same as weak dependencies are ignored.

Comment 5 Igor Gnatenko 2017-11-06 10:26:12 UTC
(In reply to Lukas Slebodnik from comment #4)
> (In reply to Igor Gnatenko from comment #3)
> > (In reply to Lukas Slebodnik from comment #2)
> > > Have you consider ignoring/skipping rich dependencies in yum?
> > 
> > What's the point?
> 
> The point is to ignore rich dependencies the same as weak dependencies are
> ignored.

Weak dependencies are not ignored, they are installed same way as Requires. Probably you are talking about reverse weak dependencies, those are ignored yes. But ignoring dependencies in Requires is wrong. Also, even yum will ignore them RPM will not. And your transaction will fail anyway.

Comment 6 Michele Baldessari 2018-09-11 16:32:06 UTC
What would be grand is if we errored out with a nice error message explaining things (need to use/install dnf, etc.) as opposed to 'Error: Invalid version flag: if'