Bug 1219867 - include option in repository should not effect the rest repos
include option in repository should not effect the rest repos
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
24
x86_64 Linux
urgent Severity urgent
: ---
: ---
Assigned To: Michael Mráka
Fedora Extras Quality Assurance
: Regression, Reopened, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-08 10:06 EDT by Marco Giunta
Modified: 2016-10-04 14:07 EDT (History)
19 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-21 10:09:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marco Giunta 2015-05-08 10:06:51 EDT
Description of problem:

after a fedup upgrade, from F21 Workstation to F22 beta, 'includepks' or the new 'include' options in my yum repository configuration do not work anymore 

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

dnf-1.0.0-1.fc22.noarch
dnf-plugins-core-0.1.7-1.fc22.noarch
dnf-yum-1.0.0-1.fc22.noarch
dnf-conf-1.0.0-1.fc22.noarch
yum-langpacks-0.4.5-1.fc22.noarch
yum-metadata-parser-1.1.4-14.fc22.x86_64
yum-3.4.3-505.fc22.noarch
yum-utils-1.1.31-505.fc22.noarch
libsolv-0.6.10-1.fc22.x86_64


How reproducible:

set an 'include' or an 'includepkgs' option in a yum repository section


Steps to Reproduce:

If I disable the repository, there is no rpm to upgrade:

$ sudo dnf update
Dependencies resolved.
Nothing to do.
Complete!

after enabling the repository, and set 'include' option, only to install a specific rpm from it, 'dnf' want to upgrade other rpms available from the repository just enabled:

$ cat /etc/yum.repos.d/russianfedora-nonfree-updates.repo
...
[russianfedora-nonfree-updates]
...
enabled=1
...
include=chromium-*
...
$ sudo dnf update
Last metadata expiration check performed 1:14:52 ago on Fri May  8 14:45:38 2015.
Dependencies resolved.
==========================================================================================================================
 Package                Arch             Version                            Repository                               Size
==========================================================================================================================
Installing:
 rar-docs               noarch           1:5.2.1-1.fc22.R                   russianfedora-nonfree-updates            47 k
Upgrading:
 flash-plugin           x86_64           7:11.2.202.451-1.fc22.R            russianfedora-nonfree-updates           5.5 M
 unrar                  x86_64           1:5.2.1-1.fc22.R                   russianfedora-nonfree-updates           134 k

Transaction Summary
==========================================================================================================================
Install  1 Package
Upgrade  2 Packages

Total download size: 5.7 M
Is this ok [y/N]: 



Same result if use the old option 'includepks=chromium-*'



Actual results:

'include' or 'includepks' options do not work


Expected results:

'dnf' must install only 'include' packages from repository, like 'yum' before the upgrade
Comment 1 Erik van Pienbroek 2015-05-09 15:16:40 EDT
I'm affected by this bug too.
Additionally I would like to mention that the configuration option 'include' (as it is called according to the dnf.conf man-page) breaks the old yum as it has a different meaning there (include external configuration file). My preference would be to stick with the old yum option name 'includepkgs' instead of 'include' as it allows backwards compatibility with the old yum and doesn't force old yum users to change their configuration.
Comment 2 Marco Giunta 2015-05-09 15:46:00 EDT
if I move the repository configuration from yum file to '/etc/dnf/dnf.conf', the result is the same: 'include' options does not work at all !!!

$ cat /etc/dnf/dnf.conf
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=true

[russianfedora-nonfree-updates-dnf]
name=Russian Fedora for Fedora $releasever - Nonfree - Updates
#baseurl=http://mirror.yandex.ru/fedora/russianfedora/russianfedora/nonfree/fedora/updates/$releasever/$basearch
mirrorlist=http://mirrors.rfremix.ru/mirrorlist?repo=nonfree-fedora-updates-released-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-russianfedora-nonfree-fedora
include=chromium-*
skip_if_unavailable=1

$ dnf update
Last metadata expiration check performed 0:03:53 ago on Sat May  9 21:40:07 2015.
Dependencies resolved.
==========================================================================================================================
 Package               Arch            Version                           Repository                                  Size
==========================================================================================================================
Installing:
 rar-docs              noarch          1:5.2.1-1.fc22.R                  russianfedora-nonfree-updates-dnf           47 k
Upgrading:
 flash-plugin          x86_64          7:11.2.202.451-1.fc22.R           russianfedora-nonfree-updates-dnf          5.5 M
 unrar                 x86_64          1:5.2.1-1.fc22.R                  russianfedora-nonfree-updates-dnf          134 k

Transaction Summary
==========================================================================================================================
Install  1 Package
Upgrade  2 Packages

Total download size: 5.7 M
Is this ok [y/N]:
Comment 3 Marco Giunta 2015-05-30 18:27:50 EDT
After other tests, I've found that if I have two or more repositories defined in '/etc/dnf/dnf.conf' with an 'include' options, only the last works; the previous ones are turned in 'exclude=*'.

If I have two or more repositories defined in '/etc/yum.repos.d' with an 'includepks' options, all the options 'includepks' are disabled (or turned in 'includepks=*')
Comment 4 Remi Collet 2015-06-22 13:56:51 EDT
Same issue, seems critical.
Comment 5 Mathieu Bridon 2015-06-22 14:08:47 EDT
Confirming as well.

Also, Erik is spot on in comment 1, the option shouldn't have been renamed in a way that breaks yum, at least as long as repo files are shared with yum in /etc/yum.repos.d/
Comment 6 Remi Collet 2015-08-25 04:23:56 EDT
Because of this bug, DNF is mostly unusable (for me).

So, for now:
alias yum="yum-deprecated"
alias dnf="echo DONT use this broken tools"
Comment 7 Paul Howarth 2015-09-23 05:59:21 EDT
I would like to add that yum has an "include" directive as well as an "includepkgs" directive and they do different things. The "include" directive in yum behaves as "#include" in C.

I have a use case that uses both "include" and "includepkgs" in the same repo file. My aim is to create a local mirror of a subset of the updates repository, and I populate this using reposync with a repo file along these lines:

[local-updates-mirror-x86_64]
name=Local Updates Mirror - x86_64
baseurl=http://example.com/path/to/repo
includepkgs=
include=file:///path/to/package-list-file
enabled=0

/path/to/package-list-file is a file listing the packages I'm interested in, one package per line, each line starting with a tab, so when it gets "include"d by yum, each line is treated as a continuation of the preceding "includepkgs=" line and hence yum sees the list of packages I want to sync. It's easy to generate a file in this format based on a list of packages on a machine or in another repository, but slightly less easy (and certainly less readable) to generate a .repo file that does the equivalent thing.

I am interested in opinions on the best way to handle my use case using dnf-based tooling.
Comment 8 guoxiao 2015-12-18 04:40:44 EST
 Installed: dnf-0:1.1.4-2.fc23.noarch at 2015-11-30 03:37
  Built    : Fedora Project at 2015-11-27 10:25

Still not fixed.
Comment 9 Tomas Hoger 2016-04-05 15:44:39 EDT
I'm currently seeing a different behaviour to what's described in the comments above, but more consistent with the current bug summary.  It seems include now sort-of works, but instead of being applied to single repository, it's applied to all repos.  E.g. with no include= in any repo file:

# dnf upgrade fedpkg
Last metadata expiration check performed 1:23:51 ago on Tue Apr  5 20:14:06 2016.
Dependencies resolved.
================================================================================
 Package         Arch            Version                 Repository        Size
================================================================================
Upgrading:
 fedpkg          noarch          1.22-3.fc22             updates           45 k

Transaction Summary
================================================================================
Upgrade  1 Package

Total download size: 45 k
Is this ok [y/N]:

After adding include=somepackage to repo file for some unrelated repository:

# dnf upgrade fedpkg
Last metadata expiration check performed 1:25:41 ago on Tue Apr  5 20:14:06 2016.
Package fedpkg not installed, cannot update it.
No match for argument: fedpkg
Error: No packages marked for upgrade.

Not only include= setting is applied to unrelated repo, dnf also produces completely bogus and misleading error message ("Package fedpkg not installed").  Running plain 'dnf upgrade' only shows update for the 'somepackage'.

Tested with:

dnf-1.1.6-2.fc22.noarch
dnf-conf-1.1.6-2.fc22.noarch
dnf-plugins-core-0.1.19-1.fc22.noarch
dnf-yum-1.1.6-2.fc22.noarch
hawkey-0.6.2-2.fc22.x86_64
libsolv-0.6.14-2.fc22.x86_64
Comment 10 Tomas Hoger 2016-04-05 15:58:25 EDT
Is this correct summary of this bug and related / duplicate bug 1055910?

- includepkgs is silently ignored by dnf

- include is meant to be dnf equivalent of includepkgs, with the problem that yum uses include directive for different purpose and hence repo files with include can not be used by both yum and dnf

- dnf include does not actually work

- exclude seems to work, but is not really a good replacement where includepkgs was previously used and needed

Despite several requests, neither of the bugs had any response from dnf maintainers since July to indicate how this problem is planned to be resolved.  Can you please provide that information?
Comment 11 Göran Uddeborg 2016-06-13 08:37:38 EDT
Yes, that is the behaviour I see using dnf-1.1.8-1.fc24.  (Well, it is hard to say if "includepkgs" is ignored, or if it just doesn't work in the same way "include" does not work.)
Comment 12 Tomas Hoger 2016-06-13 08:52:27 EDT
Request for information form package maintainer is still relevant and not answered by the previous comment, imo.
Comment 13 Göran Uddeborg 2016-06-13 08:58:07 EDT
Sorry!
Comment 14 Michael Mráka 2016-06-17 03:39:28 EDT
> Despite several requests, neither of the bugs had any response from dnf
> maintainers since July to indicate how this problem is planned to be
> resolved.  Can you please provide that information?

We're working to have it fixed in dnf 2.0 release (sometime this summer).
Comment 15 Tomas Hoger 2016-06-17 04:08:10 EDT
Any comment on how include vs. includepkgs inconsistency between yum and dnf is expected to be resolved?  Given that the two are expected to share configuration files, it sounds like a rather unfortunate design decision to re-use "include" keyword for a completely different purpose.  Even if "include" is fixed in dnf (where fixed meaning: work as includepkgs in yum), there's still problem that you can't make one repo file with include/includepkgs that can be used on systems using either yum or dnf.
Comment 16 Michael Mráka 2016-06-17 05:43:14 EDT
Dnf 2.0 will use yum compatible options:

includepkgs - for including packages from repo
excludepkgs - for excluding packages (to make the name consistent with previous)
exclude     - an alias for excludepkgs to make it compatible with yum (expected to be removed in next version)
includeconf - for including other configs
Comment 17 Paul Howarth 2016-06-19 04:31:52 EDT
(In reply to Michael Mráka from comment #16)
> Dnf 2.0 will use yum compatible options:
> 
> includepkgs - for including packages from repo
> excludepkgs - for excluding packages (to make the name consistent with
> previous)
> exclude     - an alias for excludepkgs to make it compatible with yum
> (expected to be removed in next version)
> includeconf - for including other configs

I don't see any mention of "includeconf" in yum.conf(5); yum used "include=" for this purpose, which is incompatible with the current dnf usage.
Comment 18 Michael Mráka 2016-06-20 08:22:44 EDT
> I don't see any mention of "includeconf" in yum.conf(5); yum used "include="
> for this purpose, which is incompatible with the current dnf usage.

Oops, I meant 
include - for including other configs
includeconf - an alias for include to keep compatibility with dnf v1.

I'm sorry for confusion.
Comment 19 Michael Mráka 2016-06-21 08:52:56 EDT
Fixed in
https://github.com/rpm-software-management/dnf/pull/518
Comment 20 Fedora End Of Life 2016-07-19 16:18:37 EDT
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 21 Igor Gnatenko 2016-07-21 10:09:36 EDT
Fixed as part of DNF 2.0.

Note You need to log in before you can comment on or make changes to this bug.