Ticket #4 (closed defect: fixed)

Opened 1 year ago

Last modified 7 months ago

When using the same include=... line in a config multiple times only the first one is honored

Reported by: arogge Assigned to: skvidal
Priority: major Milestone:
Component: yum Version:
Keywords: config Cc:

Description

I have a repo-config that looks like the following:

[base]
name=Base Repository
...
include=/path/to/included/file

[updates]
name=Update Repository
...
include=/path/to/include.file

[alternaterepo]
name=Alternate Repository
...
include=/path/to/different.include.file

In /path/to/include.file I have

exclude=postfix

In /path/to/different.include.file I have

exclude=

Expected behavior is that postfix will only be installed and updates from alternaterepo, but actually a newer package in updates will override the one from alternaterepo. After a few minutes of trying around I actually found out that the second include=/path/to/include.file does not have any effect and doesn't throw a warning either.

Maybe this has something to do with the recursion prevention?

Attachments

yum-multiinclude.patch (2.7 kB) - added by arogge on 12/16/08 12:53:19.
Patch to allow multiple inclusion of the same file

Change History

12/16/08 12:48:23 changed by arogge

I tracked that issue down to ConfigPreProcessor?.

12/16/08 12:53:19 changed by arogge

  • attachment yum-multiinclude.patch added.

Patch to allow multiple inclusion of the same file

12/16/08 12:57:11 changed by arogge

I've attached a patch that allows you to include the same file multiple times when your include statements occur in different sections.

For that I modified ConfigPreProcessor? to keep track of the current section and changed _alreadyincluded to contain tuples of (section, url) instead of only the url.

Please review. Thanks!

12/16/08 15:54:21 changed by skvidal

Doesn't this patch mean that the following will NOT break: [myrepo] include=somefile.txt

and somefile.txt has

[thisrepo] include=somefile.txt

I'll test the patch in a few minutes and verify this. If it doesn't then I'll probably include it. Thanks

12/16/08 17:06:55 changed by arogge

AFAICT it should behave as follows:

At [myrepo] it should include somefile.txt and take note that somefile.txt was included for "myrepo". At [thisrepo] it should include somefile.txt and take note that somefile.txt was included for "thisrepo". And then it shoudln't include somefile.txt again, because it was already included for "thisrepo".

However, I only thought about it and didn't test that case :)

12/16/08 17:20:17 changed by arogge

I just tried to break my patched installation with no success :)

added /etc/yum.repos.d/breakme.repo with the following content:

[breakme]
include=/etc/yum.repos.d/breakme.repo
name=breakme
baseurl=http://dev.centos.org/centos/5/testing/x86_64/

Tried and verified that yum still works and that the breakme repository works.

12/16/08 20:34:01 changed by skvidal

  • status changed from new to closed.
  • resolution set to fixed.

Thank you, Merged. It'll be in the next yum release.