Bug 826096 - tmprepo does not work with --disablerepo=*
tmprepo does not work with --disablerepo=*
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum-utils (Show other bugs)
7.0
All Linux
medium Severity medium
: beta
: ---
Assigned To: James Antill
Karel Srot
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-29 11:14 EDT by Patrik Kis
Modified: 2014-06-13 08:48 EDT (History)
2 users (show)

See Also:
Fixed In Version: yum-3.4.3-96
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 08:48:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Patrik Kis 2012-05-29 11:14:13 EDT
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 09:52:19 EDT
Ordering issue.  checkEnabledRepo() runs before prereposetup_hook.

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

    checkEnabledRepo: run prereposetup if necessary. BZ 826096
Comment 6 James Antill 2013-06-18 16:09:31 EDT
 Workaround should now be in f19/RHEL-7.
Comment 8 Karel Srot 2013-07-12 09:56:02 EDT
# 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 09:28:08 EDT
"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 09:52:55 EDT
(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 10:09:34 EDT
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 08:48:51 EDT
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.

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