Bug 230851

Summary: yum does not accept --disablerepo option
Product: [Fedora] Fedora Reporter: Mamoru TASAKA <mtasaka>
Component: yumAssignee: Jeremy Katz <katzj>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: bkearney, jarod, lmacken, sertacyildiz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-25 22:06:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 150226, 230870    

Description Mamoru TASAKA 2007-03-03 18:34:40 UTC
Description of problem:
With yum-3.1.3-2.fc7 even I try to exclude some repo
by --excluderepo option, yum still try to use the repo


Version-Release number of selected component (if applicable):
yum-3.1.3-2.fc7

How reproducible:
100%

Steps to Reproduce:
1. Create some repo with URL pointing to some wrong URL
2. Try to use yum with --excluderepo=<the_wrong_repo>
3.
  
Actual results:
[root@localhost i386]# yum check-update --disablerepo=extras-development-debuginfo
Loading "installonlyn" plugin


Cannot find a valid baseurl for repo: extras-development-debuginfo

Expected results:
yum should skip the repo

Additional info:
yum 3.1.2 does not seem to have this issue.

Comment 1 Jeremy Katz 2007-03-05 20:09:34 UTC
Hrmm... this is being caused because we do the repo setup now when we access
YumBase.repos.  Which we do for the first time on the --disablerepo.  

repo setup probably needs to be separated from getting the repos object.  But
how to do that while still not making it so that we don't have to explicitly set
up repos might be a little ugly :-/

Comment 2 Mamoru TASAKA 2007-03-06 03:50:10 UTC
I just noticed that --excluderepo is the typo.
I meant "--disablerepo", sorry...

Comment 3 Mamoru TASAKA 2007-03-08 16:29:51 UTC
yum-3.1.4-1.fc7 does not seem to be okay.

Comment 4 Seth Vidal 2007-04-03 04:44:09 UTC
I've just tested this command and --enablerepo on cvs head and I can't get the
problem to occur. Can anyone else replicate it on what's in cvs right now?

Comment 5 Mamoru TASAKA 2007-04-03 04:51:41 UTC
What do you mean by "cvs version"?

At least, 3.1.5-1 is still not okay.

Comment 6 Mamoru TASAKA 2007-04-05 14:12:27 UTC
3.1.6-1 is still not okay.

Comment 7 Seth Vidal 2007-04-05 14:18:53 UTC
Then I need you to define 'not okay' b/c I can't make it fail.

Comment 8 Mamoru TASAKA 2007-04-05 14:48:17 UTC
100% reproducible as below.

* Well, Currently "extras-development-debuginfo" repository (in
  fedora-extras-development.repo in fedora-release-6.92-1) cannot be
  enabled because 
  http://mirrors.fedoraproject.org/mirrorlist?repo=extras-devel-debug&arch=i386'
  returns "# no repository available for repo extras-devel-debug"
* Then intentionally enable this repository with writing "enabled=1"
  on extras-development-debuginfo repo in 
  fedora-extras-development.repo file
* Try # yum --disablerepo=extras-development-debuginfo check-update

Then:
Cannot find a valid baseurl for repo: extras-development-debuginfo

Still happens on 3.1.6-1. 3.1.0-2 does not have this problem.

Comment 9 Jeremy Katz 2007-04-17 23:19:57 UTC
Aha, it's related to the mirror list.  The same thing doesn't happen if you have
a non-existent baseurl.

James -- does the patch you sent to yum-devel over the weekend help with this case?

Comment 10 Jeremy Katz 2007-04-19 20:51:48 UTC
*** Bug 237168 has been marked as a duplicate of this bug. ***

Comment 11 James Bowes 2007-04-19 22:55:25 UTC
(In reply to comment #9)
> Aha, it's related to the mirror list.  The same thing doesn't happen if you have
> a non-existent baseurl.
> 
> James -- does the patch you sent to yum-devel over the weekend help with this
case?

Nope :(

I did some hunting, and the root cause is the change to use properties rather
than calling doFooSetup().

specifically, in cli.py:
elif opt == "--disablerepo"
    self.base.repos.disableRepo(repoexp)

that referencing of self.base.repos will end up running doRepoSetup() before
disableRepo is called.


Comment 12 Jeremy Katz 2007-04-25 22:06:47 UTC
Okay, got something that looks like it's working and sent it to the upstream
list for comments.  Should hopefully get into 3.1.7

Comment 13 Mamoru TASAKA 2007-04-28 14:36:53 UTC
yum-3.1.7-1 erased this problem.
Thank you!!