Bug 826096

Summary: tmprepo does not work with --disablerepo=*
Product: Red Hat Enterprise Linux 7 Reporter: Patrik Kis <pkis>
Component: yum-utilsAssignee: James Antill <james.antill>
Status: CLOSED CURRENTRELEASE QA Contact: Karel Srot <ksrot>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: jzeleny, ksrot
Target Milestone: betaKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.4.3-96 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:48:51 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:
Embargoed:

Description Patrik Kis 2012-05-29 15:14:13 UTC
Description of the problem:


Version-Release number of selected component (if applicable):
RHEL-7.0-20120521.n.2
# rpm -qa | grep yum
yum-utils-1.1.31-5.el7.noarch
yum-plugin-tmprepo-1.1.31-5.el7.noarch
yum-metadata-parser-1.1.4-6.el7.x86_64
yum-3.4.3-24.el7.noarch

Steps to Reproduce: 
# pwd
/root/tmprepo
# wget http://liver.englab.brq.redhat.com/repo/qa-tools-3.0-1.x86_64.rpm
--2012-05-29 17:07:04--  http://liver.englab.brq.redhat.com/repo/qa-tools-3.0-1.x86_64.rpm
Resolving liver.englab.brq.redhat.com... 10.34.32.26
Connecting to liver.englab.brq.redhat.com|10.34.32.26|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 46834 (46K) [application/x-rpm]
Saving to: `qa-tools-3.0-1.x86_64.rpm'

100%[=============================================================>] 46,834      --.-K/s   in 0.001s  

2012-05-29 17:07:04 (71.2 MB/s) - `qa-tools-3.0-1.x86_64.rpm' saved [46834/46834]

# ll
total 48
-rw-r--r--. 1 root root 46834 Apr  2 15:10 qa-tools-3.0-1.x86_64.rpm
# createrepo .
Spawning worker 0 with 1 pkgs
Workers Finished
Gathering worker results

Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
# cd ..
# 
# cat >tmp.repo
[tmprepo]
name=tmprepo
enabled=1
baseurl=file:///root/tmprepo
# 
# yum repolist all
Loaded plugins: product-id, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
repo id                                     repo name                                    status
rhel70                                      rhel70                                       enabled: 3,057
rhel70-opt                                  rhel70-opt                                   enabled: 6,058
repolist: 9,115
# yum search qa-tools
Loaded plugins: product-id, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
Warning: No matches found for: qa-tools
No Matches found
# 
# yum --tmprepo=/root/tmp.repo search qa-tools
Loaded plugins: product-id, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
tmprepo                                                                         | 2.9 kB     00:00 ... 
tmprepo/primary_db                                                              | 2.5 kB     00:00 ... 
======================================== N/S Matched: qa-tools ========================================
qa-tools.x86_64 : Set of basic qa helper tools

  Name and summary matches only, use "search all" for everything.
# yum --tmprepo=/root/tmp.repo install qa-tools
Loaded plugins: product-id, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
Resolving Dependencies
--> Running transaction check
---> Package qa-tools.x86_64 0:3.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================
 Package                  Arch                   Version                 Repository               Size
=======================================================================================================
Installing:
 qa-tools                 x86_64                 3.0-1                   tmprepo                  46 k

Transaction Summary
=======================================================================================================
Install  1 Package

Total download size: 46 k
Installed size: 63 k
Is this ok [y/N]: n
Exiting on user Command
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2012-05-29.17-08.pbTBUE.yumtx
# 
# yum --disablerepo=* --tmprepo=/root/tmp.repo repolist all
Loaded plugins: product-id, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
repo id                                       repo name                                      status
rhel70                                        rhel70                                         disabled
rhel70-opt                                    rhel70-opt                                     disabled
tmprepo                                       tmprepo                                        enabled: 1
repolist: 1
# yum --disablerepo=* --tmprepo=/root/tmp.repo search qa-tools
Loaded plugins: product-id, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
======================================== N/S Matched: qa-tools ========================================
qa-tools.x86_64 : Set of basic qa helper tools

  Name and summary matches only, use "search all" for everything.
# yum --disablerepo=* --tmprepo=/root/tmp.repo install qa-tools
Loaded plugins: product-id, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 You can enable repos with yum-config-manager --enable <repo>
# 
# yum --disablerepo=rhel70 --disablerepo=rhel70-opt --tmprepo=/root/tmp.repo install qa-tools
Loaded plugins: product-id, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 You can enable repos with yum-config-manager --enable <repo>
# yum --disablerepo=rhel70 --disablerepo=rhel70-opt --tmprepo=/root/tmp.repo search qa-tools
Loaded plugins: product-id, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
======================================== N/S Matched: qa-tools ========================================
qa-tools.x86_64 : Set of basic qa helper tools

  Name and summary matches only, use "search all" for everything.
# yum --disablerepo=rhel70 --disablerepo=rhel70-opt --tmprepo=/root/tmp.repo repolist all
Loaded plugins: product-id, subscription-manager, tmprepo
Updating certificate-based repositories.
Unable to read consumer identity
repo id                                       repo name                                      status
rhel70                                        rhel70                                         disabled
rhel70-opt                                    rhel70-opt                                     disabled
tmprepo                                       tmprepo                                        enabled: 1
repolist: 1
# 


Actual results: 
yum --disablerepo=* --tmprepo=/root/tmp.repo install <pkg>
fail to install the <pkg>

Expected results:
installation succeed
This works on RHEL6. I also have a feeling that it worked on earlier builds of RHEL, but I have not verified this.

Comment 5 Zdeněk Pavlas 2013-06-05 13:52:19 UTC
Ordering issue.  checkEnabledRepo() runs before prereposetup_hook.

commit 60953ca6769a6dfda09d698ed26d7624dc7264a4
Author: Zdenek Pavlas <zpavlas>
Date:   Wed Jun 5 15:47:22 2013 +0200

    checkEnabledRepo: run prereposetup if necessary. BZ 826096

Comment 6 James Antill 2013-06-18 20:09:31 UTC
 Workaround should now be in f19/RHEL-7.

Comment 8 Karel Srot 2013-07-12 13:56:02 UTC
# rpm -q yum
yum-3.4.3-100.el7.noarch

# yum --disablerepo=\* --tmprepo=/etc/yum.repos.d/update-to-test.repo install update-to-test-pkg
Loaded plugins: langpacks, product-id, subscription-manager, tmprepo
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'dyninst' is missing name in configuration, using id
Repository 'rhel7' is missing name in configuration, using id
Repository 'rhel7-optional' is missing name in configuration, using id
Repo update-to-test tried to set gpgcheck=false
There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 You can enable repos with yum-config-manager --enable <repo>

# yum --disablerepo=\* --enablerepo=update-to-test install update-to-test-pkg
Loaded plugins: langpacks, product-id, subscription-manager, tmprepo
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'dyninst' is missing name in configuration, using id
Repository 'rhel7' is missing name in configuration, using id
Repository 'rhel7-optional' is missing name in configuration, using id
Resolving Dependencies
--> Running transaction check
---> Package update-to-test-pkg.noarch 0:1.0-5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                                 Arch                        Version                      Repository                           Size
================================================================================
Installing:
 update-to-test-pkg                      noarch                      1.0-5                        update-to-test                      1.5 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 1.5 k
Installed size: 0  
Is this ok [y/d/N]: 
Exiting on user command
Your transaction was saved, rerun it with:
 yum load-transaction /tmp/yum_save_tx.2013-07-12.15-54.QmKX0e.yumtx

Comment 9 Zdeněk Pavlas 2013-08-01 13:28:08 UTC
"yum repolist" does not need to have enabled repos.. Does it list the update-to-test repo?

# yum --disablerepo=\* --tmprepo=/etc/yum.repos.d/update-to-test.repo repolist

> Repo update-to-test tried to set gpgcheck=false

Oh, I've missed this.. that might be the root reason, why tmprepo does not enable it.. Please add gpgcheck=true to /etc/yum.repos.d/update-to-test.repo and test again, thanks!

Comment 10 Karel Srot 2013-08-01 13:52:55 UTC
(In reply to Zdeněk Pavlas from comment #9)
> > Repo update-to-test tried to set gpgcheck=false
> 
> Oh, I've missed this.. that might be the root reason, why tmprepo does not
> enable it.. Please add gpgcheck=true to /etc/yum.repos.d/update-to-test.repo
> and test again, thanks!

It works fine with  gpgcheck=true. Not with  gpgcheck=false.

> Status: ASSIGNED → ON_QA
Why?

Comment 11 Zdeněk Pavlas 2013-08-01 14:09:34 UTC
When you pass a .repo file to the --tmprepo option, the plugin checks that this repo does not disable gpgcheck.  If it does, the repo is not enabled, and hence install fails (no enabled repos).

I don't know the exact reason, but it's intentional.  If you *dont* want this beahvioir, it can be disabled in tmprepo.conf (pkgs_gpgcheck=False).

IMO, if the test case works with tmprepo.conf:pkgs_gpgcheck=False OR with update-to-test.repo:gpgcheck=True, the bugfix is verified.

Comment 13 Ludek Smid 2014-06-13 12:48:51 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.