<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>8348</bug_id>
          
          <creation_ts>2015-09-21 00:56:26 +0000</creation_ts>
          <short_desc>opkg removes package provider on upgrade (old issue #121)</short_desc>
          <delta_ts>2016-05-05 16:17:20 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>opkg</product>
          <component>opkg</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.4.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alejandro del Castillo">alejandro.delcastillo</reporter>
          <assigned_to name="Alejandro del Castillo">alejandro.delcastillo</assigned_to>
          
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>54326</commentid>
    <comment_count>0</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2015-09-21 00:56:26 +0000</bug_when>
    <thetext>What steps will reproduce the problem?
1. Install package &quot;A&quot; version 2.0 that also provides &quot;B&quot;.
2. Create package &quot;B&quot; v1.0 in repository.
3. Create package &quot;A&quot; to v2.1 in repository that no longer provides &quot;B&quot;.
4. Do upgrade.

What is the expected output?
Packages &quot;A&quot; v2.1 and &quot;B&quot; v1.0 are installed.

What do you see instead?
Only package &quot;A&quot; v2.1 is installed. Thus provider of &quot;B&quot; is missing.

Originally reported by KirGeNe, Feb 6, 2014
-----------------------------------------------------------------------------

#1 paul.betafive (Feb 6, 2014)
I don&apos;t see how opkg can know when you install A that you need a provider of B. Does any other package manager (eg. rpm, dpkg) do what you&apos;re saying?

#2 KirGeNe (Feb 7, 2014)
Oh, I forgot to mention that other packages depends on &quot;B&quot;.

#3 paul.betafive (Feb 7, 2014)
So is A being explicitly installed or is it being brought in just to provide B? Do any other packages have a direct dependency on A?

I&apos;m trying to get this clear enough that we can write a minimal test case.

#4 KirGeNe (Feb 7, 2014)
OK, so there are many packages that depends on A and B from start.
Package A v2.0 is installed from start to provide A and B.

Later separate package B v1.0 is created.
Also updated package A v2.1 is created to provide only A (without B). Also for package A new dependency on B is created.

After that update process is started.
After upgrade package A will be upgraded but B won&apos;t be installed.
During this process I see following messages:
&quot;Multiple replacers for B, using first one (A).&quot;

#5 paul.betafive (Feb 16, 2014)
So, there are 2 problems which lead to this:

1) The function pkg_installed_and_constraint_satisfied() doesn&apos;t check pkg-&gt;state_want. When pkg-&gt;state_want == SW_DEINSTALL, the package is scheduled for uninstall and so shouldn&apos;t be treated as installed. This is easy to fix.

2) For an abstract_pkg, provided_by is a list of abstract packages, not a list of real packages. An abstract package is just a name with no version number. So if A 1.0 provides B, A is added to B-&gt;provided_by. There is no current mechanism to say that a particular version of A provides B but a different version of A doesn&apos;t provide B. This may be more difficult to fix.

I&apos;ve added &quot;tests/regress/issue121.py&quot; to master which checks this behaviour. It is currently expected to fail on the last check. If you could take a quick look at that and ensure it checks what you expect it to that&apos;d be helpful.

I&apos;ve listed this as Milestone-0.4 as it may be a complicated fix and it seems like a rare corner case. I may be wrong though so if you disagree please say so.

The only thing I can&apos;t reproduce is the message &quot;Multiple replacers for B, using first one (A).&quot;. Are any of your packages listed as</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61990</commentid>
    <comment_count>1</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2016-05-05 16:17:20 +0000</bug_when>
    <thetext>Test passes since v0.3.0.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>