<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>7410</bug_id>
          
          <creation_ts>2005-07-20 20:08:51 +0400</creation_ts>
          <short_desc>find-package loses virtual dependencies</short_desc>
          <delta_ts>2008-02-26 00:20:18 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>rpm-build</component>
          <version>unstable</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>LATER</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>2603</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="at@altlinux.org">at</reporter>
          <assigned_to name="placeholder@altlinux.org">placeholder</assigned_to>
          <cc>arseny</cc>
    
    <cc>glebfm</cc>
    
    <cc>imz</cc>
    
    <cc>ldv</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>27494</commentid>
    <comment_count>0</comment_count>
    <who name="at@altlinux.org">at</who>
    <bug_when>2005-07-20 20:08:54 +0400</bug_when>
    <thetext>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&apos;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&apos;s a problem with reverse lookup using contents_index:

$ awk &apos;&quot;/usr/bin/perl&quot;==$1&apos; ~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 &amp;&amp; RPM_BUILD_ROOT=/tmp
FindPackage /tmp/script /usr/bin/perl
Actual Results:  
perl-base

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

    </bug>

</bugzilla>