Bug 79024

Summary: BROKEN: rpm --redhatprovides <package>
Product: [Retired] Red Hat Linux Reporter: Fred Richardson <frichard>
Component: rpmdb-redhatAssignee: Tim Powers <timp>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: jbj, mitr
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-28 20:30:07 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 Fred Richardson 2002-12-04 17:17:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
On my system, running:
    rpm --redhatprovides <package>
Never produces a correct result.  For example:
    rpm --redhatprovides gcc
produces
    no package provides gcc

The problem is caused by the macro expansion for "redhatprovides" in the file
/usr/lib/rpm/rpmpopt-4.1 to specify the search path for the redhat rpmdb.

The macro specifies the use of:
    /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat

Which on my system expands to (using "rpm -E ..."):
    /usr/lib/rpmdb/i686-redhat-linux/redhat

Which does not exist.  The package "rpmdb-redhat" is installed instead under the
path:
    /usr/lib/rpmdb/i386-redhat-linux/redhat

So I can attain the correct results by using the following command:
    rpm --dbpath /usr/lib/rpmdb/i386-redhat-linux/redhat/ -q --whatprovides gcc
which produces the expected result:
    gcc-3.2-7

One simple "work-around" for the problem is to create a symbolic link under
/usr/lib/rpmdb.  The "rpmdb-redhat" package could be updated to create this link
during installation using the same macro.

Version-Release number of selected component (if applicable):
rpmdb-redhat-8.0-0.20020910


How reproducible:
Always

Steps to Reproduce:
1.rpm --redhatprovides rpm
2.
3.
	

Actual Results:  # rpm --redhatprovides rpm
no package provides rpm
#

Expected Results:  # rpm --redhatprovides rpm
rpm-4.1-1.06
#

Additional info:

Comment 1 Tim Powers 2002-12-04 17:23:01 UTC
Hmm. Workd for me on my athlon box without incident. Jeff, do you know what's
going on here?



Comment 2 Tim Powers 2003-01-28 19:58:39 UTC
Jeff, second call. Any idea what the problem may be? I haven't been able to
reproduce this at all without changing the defaults.

Tim

Comment 3 Jeff Johnson 2003-01-28 20:17:52 UTC
Yes, the _arch macro was borked if redhat-rpm-config
not installed with rpm-4.1-1.06.

No longer a problem afaik.

There is gonna be a new problem with __db*
files in rpmdb-redhat.

Adding
    %post
    rm -f /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat/__db*
 should fix
     

Comment 4 Tim Powers 2003-01-28 20:30:07 UTC
OK. This is in the current rpmdb-rebhat package which is in the latest Phoebe beta:

%post
rm -f %{rpmdbpath}/__db* > /dev/null 2>&1 || :
                                                                                
%preun
rm -f %{rpmdbpath}/__db* > /dev/null 2>&1 || :

So that should do it for future releases.

I'm closing this with the resolution as "rawhide" since Jeff provided the
information for how to work around the problem (re-install the rpmdb-redhat
package after rpm-4.1-1.06 is intalled), and since we're removing the lock files
after we install, and before we uninstall.