Bug 59665 - rpm --whatprovides is broken
Summary: rpm --whatprovides is broken
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 60879 61590
TreeView+ depends on / blocked
 
Reported: 2002-02-11 17:51 UTC by Peter Bowen
Modified: 2008-05-01 15:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-03-27 17:20:14 UTC
Embargoed:


Attachments (Terms of Use)

Description Peter Bowen 2002-02-11 17:51:50 UTC
Description of Problem:
rpm --dbpath /home/pzb/special/one/usr/lib/rpmdb/i386-redhat-linux/redhat -q
--whatprovides /usr/bin/sendmail

shows that /usr/bin/sendmail is not owned by any package, while sendmail
provides /usr/bin/sendmail  /home/pzb/special/one contains the extract
rpmdb-redhat package from Hampton beta 1

Version-Release number of selected component (if applicable):
rpm 4.0.3-1.03 and rpmdb-redhat-7.2.90-0.20020206.i386

How Reproducible:
always

Comment 1 Jeff Johnson 2002-02-11 18:03:16 UTC
sendmail package name-version-release, please, so I can verify
what's going on, as I also suspect that some packager may have done
	Provides: /usr/sbin/sendmail
without realizing that that is a packaging error.

Meanwhile, you are confusing Provides: with contains,
as in the statement
	The sendmail package contains /usr/bin/sendmail,
	but does not Provide: /usr/sbin/sendmail.
That's wired into the design of rpm.

So the designed syntax is
	rpm -qf  ... /usr/sbin/sendmail
not
	rpm -q --provides /usr/sbin/sendmail

And, yes, I'm deliberately blurring the implementation in rpm so that
down the road, file paths are gonna be just another form of
	Provides:
Nope, rpm is not there yet.


Comment 2 Peter Bowen 2002-02-11 18:21:22 UTC
sendmail-8.11.6-12
redhat-lsb-1.1.0-0.2

rpm -q --provides sendmail-8.11.6-12smtpdaemon  
/usr/sbin/sendmail  
/usr/bin/mailq  
/usr/bin/newaliases  
/usr/bin/rmail  
/usr/share/man/man1/mailq.1.gz  
/usr/share/man/man1/newaliases.1.gz  
/usr/share/man/man5/aliases.5.gz  
sendmail = 8.11.6-12



Comment 3 Jeff Johnson 2002-02-11 18:24:26 UTC
Broken packaging. This is a feature request disguised
as a bug report ATM. I get a lot of those.

Comment 4 Peter Bowen 2002-02-11 18:39:12 UTC
so I need to file bugs against the LPRng and sendmail packages because they
provide things starting with a '/'?

Comment 5 Jeff Johnson 2002-02-11 18:45:39 UTC
Dunno yet, stay tuned.

Comment 6 Florian La Roche 2002-03-09 13:07:13 UTC
Providing things starting with "/" is the right thing todo.

Thanks,

Florian La Roche


Comment 7 Peter Bowen 2002-03-09 13:54:26 UTC
While you may feel that providing things starting with / is the right thing to
do, it does not work correctly with any released version of RPM.  RPM does not
support providing things that start with a /, so it is a packaging problem.

This is still present in beta2, so I'm reopening, changing to beta2, and adding
jbj to the CC, as he was the one that said you can't have provides starting with /.

Comment 8 Jeff Johnson 2002-03-09 17:01:35 UTC
In fact, provided tokens with a '/' does "work"
correctly (i.e. dependencies will be resolved)
in rpm-4.0.3 but queries need to be taught to look in the
Providename index if not found as a file name.

Florian: while we agree that providing '/' tokens is
the Right Thing to Do, the open question is "When?"
and the answer AFAIK ATM is "Not now." That leads
to the answer of "Broken packaging.". Still.

Comment 9 Jay Turner 2002-03-19 20:12:44 UTC
Still seeing this with sendmail-8.12.2-8.

Comment 10 Florian La Roche 2002-03-19 20:35:59 UTC
This seems to be consistent within rawhide, so I'll close this bug now.

cu,

Florian La Roche


Comment 11 Peter Bowen 2002-03-19 20:51:00 UTC
This is _not_ fixed.  You CAN NOT provide things starting with a "/" and expect
it to work correctly.  Please see jbj's last comment.  This is still "broken
packaging" as of sendmail-8.12.2-8.  Please do not close this bug until sendmail
no longer has Provide tags that start with /.

Comment 12 Jeff Johnson 2002-03-19 21:19:38 UTC
So fix the problem with --whatprovides instead
of squawking and send me a patch.

The fix is gonna be in lib/query.c, all that's needed is
to check Providename if a token starting with '/'
is not found in Basenames:

    case RPMQV_WHATPROVIDES:
        if (arg[0] != '/') {
            mi = rpmdbInitIterator(rpmdb, RPMTAG_PROVIDENAME, arg, 0);
            if (mi == NULL) {
                rpmError(RPMERR_QUERYINFO, _("no package provides %s\n"), arg);
                retcode = 1;
            } else {
                retcode = showMatches(qva, mi, showPackage);
            }
            break;
        }
        /*@fallthrough@*/
    case RPMQV_PATH:


Comment 13 Jeff Johnson 2002-03-27 19:36:21 UTC
Fixed (by always looking in Providename, then Basenames
if arg starts with '/') in rpm-4.0.4-7x.9


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