Bug 59665 - rpm --whatprovides is broken
rpm --whatprovides is broken
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks: 60879 61590
  Show dependency treegraph
 
Reported: 2002-02-11 12:51 EST by Peter Bowen
Modified: 2008-05-01 11:38 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-03-27 12:20:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Peter Bowen 2002-02-11 12:51:50 EST
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 13:03:16 EST
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 13:21:22 EST
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 13:24:26 EST
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 13:39:12 EST
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 13:45:39 EST
Dunno yet, stay tuned.
Comment 6 Florian La Roche 2002-03-09 08:07:13 EST
Providing things starting with "/" is the right thing todo.

Thanks,

Florian La Roche
Comment 7 Peter Bowen 2002-03-09 08:54:26 EST
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 12:01:35 EST
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 15:12:44 EST
Still seeing this with sendmail-8.12.2-8.
Comment 10 Florian La Roche 2002-03-19 15:35:59 EST
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 15:51:00 EST
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 16:19:38 EST
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 14:36:21 EST
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.