<?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>10358</bug_id>
          
          <creation_ts>2016-09-30 23:48:01 +0000</creation_ts>
          <short_desc>[libsolv] opkg leaves package in bad state if install fails due to file conflicts</short_desc>
          <delta_ts>2016-10-07 18:50:06 +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>0.3.3</version>
          <rep_platform>All</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.3.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Hansen">michael.j.hansen</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>66781</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Hansen">michael.j.hansen</who>
    <bug_when>2016-09-30 23:48:01 +0000</bug_when>
    <thetext>If packages a and b both provide the same file, the install appears to fail:

    $ opkg install b
    Collected errors:
     * check_data_file_clashes: Package b wants to install file /tmp/opkg/conflict_file
            But that file is already provided by package  * a
     * opkg_solver_install: Cannot install package b.

However, attempting to do further work after the conflict shows that &apos;b&apos; was left in a partially installed or otherwise broken state:

    $ (build new version of &apos;b&apos; without conflicts)
    $ opkg update
    $ opkg install b
    Collected errors:
     * pkg_get_installed_files: Failed to open /tmp/opkg///var/lib/opkg/info/b.list: No such file or directory.
     * pkg_get_installed_files: Failed to open /tmp/opkg///var/lib/opkg/info/b.list: No such file or directory.
    Installing b (1.0) on root   (Wrong: Should be 2.0)
    $ opkg list-installed b
    b - 1.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66782</commentid>
    <comment_count>1</comment_count>
      <attachid>3447</attachid>
    <who name="Michael Hansen">michael.j.hansen</who>
    <bug_when>2016-09-30 23:50:07 +0000</bug_when>
    <thetext>Created attachment 3447
Test case for issue 10358</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66813</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Hansen">michael.j.hansen</who>
    <bug_when>2016-10-03 16:42:52 +0000</bug_when>
    <thetext>Upon further investigation, it looks like the failed install leaves the package status as &quot;install ok half-installed&quot;.  The difference between libsolv and internalsolv here is that internalsolv installs the new version successfully (leaving the old version half-installed), whereas libsolv re-attempts the install of the old version, ignoring the new one.

Furthermore attempting to clean up the install with &quot;opkg remove b&quot; as suggested by the error message prints &quot;No packages removed.&quot; and does not change the status of b, with either solver.  I think that is the real bug here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67062</commentid>
    <comment_count>3</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2016-10-07 18:50:06 +0000</bug_when>
    <thetext>Fixed on commit 0813a16ad394c896e5ac9599f5dcd22aeabe2820</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3447</attachid>
            <date>2016-09-30 23:50:07 +0000</date>
            <delta_ts>2016-09-30 23:50:07 +0000</delta_ts>
            <desc>Test case for issue 10358</desc>
            <filename>issue10358.py</filename>
            <type>text/x-python</type>
            <size>819</size>
            <attacher name="Michael Hansen">michael.j.hansen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