Bug 452276

Summary: SQLite file provides fails to match
Product: [Fedora] Fedora Reporter: Darrell R. Kresge <bugs>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: ffesti, james.antill, katzj, pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.2.17-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-08-07 19:28:24 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:

Description Darrell R. Kresge 2008-06-20 17:21:00 UTC
Description of problem:

When depsolving for uninstalled providers based on filename, or executing 'yum provides 
/path/to/file', no matches are returned 


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

3.2.16

How reproducible:

Consistently with a new installation and no plugins enabled

Steps to Reproduce:

With the 'provides' subcommand:

# yum -d1 provides /etc/mime.types
# yum -d0 install mailcap -y
# yum -d1 provides /etc/mime.types
mailcap.noarch : Associates helper applications with particular file types.
# 

With the 'install' subcommand: (httpd requires /etc/mime.types)

# yum -d0 install httpd
httpd-2.2.3-5.x86_64 from leenux-fc-base has depsolving problems
  --> Missing Dependency: /etc/mime.types is needed by package httpd-2.2.3-5.x86_64 (leenux-fc-
base)
Error: Missing Dependency: /etc/mime.types is needed by package httpd-2.2.3-5.x86_64 (leenux-fc-
base)
# yum -d0 install mailcap -y
# yum -d0 install httpd
Is this ok [y/N]: 
Exiting on user Command
# 

Actual results:

mailcap is not found as a provider of /etc/mime.types

Additional info:

metadata is valid:

# gunzip -c filelists.xml.gz | grep -C3 /etc/mime.types
<package pkgid="337ea5ff5bfe228beb194aa45bcb1e618d702d2c" name="mailcap" arch="noarch">
  <version epoch="0" ver="2.1.23" rel="1.fc6"/>
  <file>/etc/mailcap</file>
  <file>/etc/mime.types</file>
  <file>/usr/share/man/man4/mailcap.4.gz</file>
</package>

sqlite> select P.name,P.version,P.pkgKey from packages P, files F where P.pkgKey=F.pkgKey and 
F.name='/etc/mime.types';
mailcap|2.1.23|1579

Possible remedy:

sqlitesack.py has a logic error in short circuiting file based provider lookup.  Globs and filenames 
should both proceed to search filelists.  The current test disallows file lookups which are not globs.

Index: sqlitesack.py
===============================================================
====
--- sqlitesack.py	(revision 47366)
+++ sqlitesack.py	(working copy)
@@ -761,7 +761,7 @@
         # If it's not a provides or a filename, we are done
         if prcotype != "provides":
             return results
-        if not glob or name[0] != '/':
+        if not glob and name[0] != '/':
             return results
 
         # If it is a filename, search the primary.xml file info

Comment 1 James Antill 2008-08-07 19:28:24 UTC
 This was fixed in an update, at least 3.2.17-2 will fix it (it was fixed before that but I can't remember which nevr exactly).