Bug 7410 - find-package loses virtual dependencies
Summary: find-package loses virtual dependencies
Status: RESOLVED LATER
Alias: None
Product: Sisyphus
Classification: Development
Component: rpm-build (show other bugs)
Version: unstable
Hardware: all Linux
: P2 normal
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks: 2603
  Show dependency tree
 
Reported: 2005-07-20 20:08 MSD by at@altlinux.org
Modified: 2008-02-26 00:20 MSK (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description at@altlinux.org 2005-07-20 20:08:54 MSD
FindPackage() should prefer virtual dependencies as they provide more
semantics.  E.g. /usr/bin/perl dependency exposes that perl interpeter
is in use, while dependency on perl-base is not that meaningful.

I think it's easy implement reverse lookup against rpm database:

$ rpm -q --whatprovides /usr/bin/perl
perl-base-5.8.7-alt2
perl-base-5.8.7-alt2
$ rpm -q --provides perl-base-5.8.7-alt2 |grep /usr/bin/perl
/usr/bin/perl
$

But there's a problem with reverse lookup using contents_index:

$ awk '"/usr/bin/perl"==$1' ~sisyphus/i586/base/contents_index
/usr/bin/perl   perl-base
$

Maybe we should alter how contents_index is generated so that it has both
/usr/bin/perl perl-base
/usr/bin/perl /usr/bin/perl
Steps to Reproduce:
$ rpm -q --whatprovides /usr/bin/perl
perl-base-5.8.7-alt2
perl-base-5.8.7-alt2
$ RPM_BUILD_ROOT=/tmp . /usr/lib/rpm/find-package && RPM_BUILD_ROOT=/tmp
FindPackage /tmp/script /usr/bin/perl
Actual Results:  
perl-base

Expected Results:  
/usr/bin/perl
Comment 1 Dmitry V. Levin 2005-09-05 00:14:04 MSD
The contents_index was defined to have one primary index - pathname (first
field).  Is it OK to leave only "/usr/bin/perl /usr/bin/perl" line there?
Comment 2 Dmitry V. Levin 2005-10-07 18:49:02 MSD
Anyway, when virtual dependence is provided by more than one alternative, it
will remain virtual.
Comment 3 Dmitry V. Levin 2006-01-10 02:36:24 MSK
This could be implemented by extending contents_index format.
But do we need this feature at all?  I'm doubt.
Comment 4 at@altlinux.org 2007-11-10 00:50:08 MSK
Тема выбора между виртуальными и реальными зависимостями довольно тонкая.
В общем, find-package недавно был переделан, и некоторый класс смежных/похожих
проблем там был обдуман/решён.  Возвращаться к этой теме я в ближайшее время не
собираюсь, поэтому пусть будет LATER.  А вообще надо переделывать contents_index
 подход потому что он не учитывает симлинков в путях.  Но симлинки в путях
учитывать вообще не так-то просто.