Bug 237863 - rpm does not list all requiring packages
Summary: rpm does not list all requiring packages
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: createrepo
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: James Antill
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: bzcl34nup
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-25 19:05 UTC by Gijs Hollestelle
Modified: 2014-01-21 22:57 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-05-07 01:34:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Gijs Hollestelle 2007-04-25 19:05:48 UTC
Description of problem:
rpm (and rpm python bindings) do not correctly list all packages that require a
certain file (in this case /bin/sh)

Version-Release number of selected component (if applicable):
Was able to reproduce in fc5,fc6 and fc7 rawhide rpm-4.4.2-40.fc7

How reproducible:
[gijs@fc7-test3 gijs]% rpm -q --whatrequires '/bin/sh' | grep glibc-headers
Does not list anything, while
[gijs@fc7-test3 gijs]% rpm -q --requires glibc-headers
Does show that glibc-headers requires /bin/sh

Also rpm -e --test bash does not list glibc-headers as a conflict.

Actual results:
rpm -q --whatrequires '/bin/sh'  does not list glibc-headers

Expected results:
rpm -q --whatrequires '/bin/sh'  does list glibc-headers

Additional info:
This causes problems in yum as well which won't remove glibc-headers as a
dependency of the bash package.

Comment 1 Jeff Johnson 2007-04-25 20:55:29 UTC
glibc-headers needs /bin/sh only when installing, not when installed or erasing:

$ rpm -q --scripts glibc-headers
preinstall scriptlet (using /bin/sh):
# this used to be a link and it is causing nightmares now
if [ -L /usr/include/scsi ] ; then
    rm -f /usr/include/scsi
fi

So there is no dependency on /bin/sh by glibc-headers when installed or erasing, only while installing 
where %pre runs.

NOTABUG

Comment 2 Paul Nasrat 2007-05-17 13:43:05 UTC
Possibly yum needs to check the REQUIREFLAGS for interpreter requires if it is
rpm.RPMSENSE_INTERP and agaisnt RPMSENSE_SCRIPT_*.



Comment 3 Seth Vidal 2007-05-17 14:01:53 UTC
Paul,
 Whats the difference b/t those two and wouldn't we need that info in the
metadata? Moreover, it seems like what Gijs was reporting was that it's not
visible in rpm-python so how would we fix it in yum if rpm-python isn't seeing it?

Comment 4 Jeremy Katz 2007-06-13 18:24:09 UTC
Adding Paul to cc for Seth's last question.

Comment 5 Panu Matilainen 2007-06-14 08:09:56 UTC
I'm not Paul :) but...

Like Jeff said, rpm and yum are right to allow removal of /bin/sh without
removing glibc-headers because it only needs it on installation, not to run or
to remove. And yes the information is visible in rpm-python:

>>> h['name']'glibc-headers'
>>> h[rpm.RPMTAG_REQUIRENAME]
['/bin/sh', 'glibc', 'kernel-headers', 'kernel-headers',
'rpmlib(CompressedFileNames)', 'rpmlib(PayloadFilesHavePrefix)']
>>> h[rpm.RPMTAG_REQUIREFLAGS][0] & rpm.RPMSENSE_SCRIPT_PRE ==
rpm.RPMSENSE_SCRIPT_PRE
True

If there's a bug here, it's in the fact that the metadata is taking nasty
shortcuts: it (createrepo) doesn't know about pre/post etc dependency
differences, it just relies on the legacy RPMSENSE_PREREQ flag to be set for all
scriptlet dependencies instead of looking at RPMSENSE_SCRIPT_* flags like it
really should.

To Seth's question: RPMSENSE_INTERP flag is always set for scriptlet
dependencies (except for internal Lua scriptlets), RPMSENSE_SCRIPT_* tells what
type of scriptlet the dependency is for (pre, post etc)

Comment 6 Seth Vidal 2007-11-26 18:15:35 UTC
So the mods to createrepo would be to add a check to each dependency to see when
it is requiring it and append that to the dep information? I just want to make
sure that's what you're explaining here.



Comment 7 Bug Zapper 2008-04-04 00:16:37 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 8 Bug Zapper 2008-05-07 01:34:03 UTC
This bug has been in NEEDINFO for more than 30 days since feedback was
first requested. As a result we are closing it.

If you can reproduce this bug in the future against a maintained Fedora
version please feel free to reopen it against that version.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp


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