<?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>8354</bug_id>
          
          <creation_ts>2015-09-21 01:10:08 +0000</creation_ts>
          <short_desc>[libsolv] conflicts+replaces+provides causes untracked files (old issue #156)</short_desc>
          <delta_ts>2016-03-29 21:32:33 +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.2.4</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.3.2</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>54332</commentid>
    <comment_count>0</comment_count>
      <attachid>2751</attachid>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2015-09-21 01:10:08 +0000</bug_when>
    <thetext>Created attachment 2751
test package (A)

What steps will reproduce the problem?
1.Create package A that have files /x1 /x2
  install it.
2.Create package B that have files /x2 /x3
  Replaces:  A
  Provides:  A
  Conflicts: A
install it

What do you see? What is the expected output? 
A is removed, B is installed as expected, BUT
opkg files B shows only file /x3 and /x2 stays in filesystem untracked

I expect that package B must own file /x2.

What version of the product are you using? On what operating system?
opkg v0.2.4
it maybe important that I use opkg in offline root mode

Originally reported by alexeytech, Dec 26, 2014
-----------------------------------------------------------------------------

#1 paul.betafive (Mar 9, 2015)
Could you retry this and pass the &apos;-V4&apos; argument to opkg during the install of package B to print debugging info at the highest verbosity level and post the output here? That should help to track down the cause of the error.

Sorry for the late response to this issue, I&apos;ve had to step back from maintainership of opkg due to other commitments but I&apos;ll see what I can do to get this resolved.

I think this issue can be fixed in a bugfix release after v0.3.0 if necessary.

#2 alexeytech (Mar 10, 2015)
I am glad to recieve your repost. I&apos;will post debug A.S.A.P.

#3 alexeytech (Mar 10, 2015)
~/test/opkg-test$ cat opkg.conf 
dest root /
arch all 1


~/test/opkg-test$ ./opkg -o ~/test/opkg-test/root -f opkg.conf -V4 -v
opkg version 0.2.4


~/test/opkg-test$ ./opkg -o ~/test/opkg-test/root -f opkg.conf --force-postinstall -V4 install a_1_all.ipk 
opkg_conf_parse_file: Loading conf file opkg.conf.
opkg_conf_parse_file: Supported arch all priority (1)
pkg_hash_load_feeds: 
pkg_hash_load_status_files: 
opkg_install_cmd: a_1_all.ipk
opkg_prepare_url_for_install: Package a provided by hand (a_1_all.ipk).
pkg_vec_insert_merge: Adding new pkg=a version=1 arch=all.
pkg_info_preinstall_check: Updating file owner list.
pkg_hash_fetch_best_installation_candidate: Best installation candidate for a:
pkg_hash_fetch_best_installation_candidate: Adding a to providers.
pkg_hash_fetch_best_installation_candidate: a arch=all arch_priority=1 version=1.
pkg_hash_fetch_best_installation_candidate: Candidate: a 1.
opkg_prepare_install_by_name: Versions from pkg_hash_fetch: new 1
opkg_install_by_name: Calling opkg_install_pkg for a 1.
opkg_install_pkg: Calling pkg_arch_supported.
pkg_arch_supported: Arch all (priority 1) supported for pkg a.
Installing a (1) on root.
update_file_ownership: update_file_ownership: new_pkg=a wants file /home/tech/test/opkg-test/root/, from owner=&lt;NULL&gt;
update_file_ownership: update_file_ownership: new_pkg=a wants file /home/tech/test/opkg-test/root/x2, from owner=&lt;NULL&gt;
update_file_ownership: update_file_ownership: new_pkg=a wants file /home/tech/test/opkg-test/root/x1, from owner=&lt;NULL&gt;
pkg_hash_fetch_unsatisfied_dependencies: Checking dependencies for &apos;a&apos;.
pkg_run_script: Running script /tmp/opkg-cjBRZ4/a-oQJzRp/preinst.
opkg_install_pkg: Installing maintainer scripts.
opkg_install_pkg: Installing data files for a.
install_data_files: Extracting data files to /home/tech/test/opkg-test/root/.
install_data_files: Calling pkg_write_filelist.
pkg_write_filelist: Creating /home/tech/test/opkg-test/root//usr/lib/opkg/info/a.list file for pkg a.
opkg_install_pkg: Resolving conf files for a
opkg_install_pkg: pkg=a old_state_flag=110 state_flag=100
opkg_configure_packages: Configuring unpacked packages.
opkg_configure_packages: Reordering packages before configuring them...
opkg_recurse_pkgs_in_order: pkg a.
Configuring a.
pkg_run_script: Running script /home/tech/test/opkg-test/root//usr/lib/opkg/info/a.postinst.
write_status_files_if_changed: Writing status file.
pkg_write_changed_filelists: Saving changed filelists.
hash_table: pkg-hash, 12288 bytes
        n_buckets=1024, n_elements=1, n_collisions=0
        max_bucket_len=0, n_used_buckets=1, ave_bucket_len=1.00
        n_hits=3, n_misses=1
hash_table: file-hash, 12288 bytes
        n_buckets=1024, n_elements=3, n_collisions=0
        max_bucket_len=0, n_used_buckets=3, ave_bucket_len=1.00
        n_hits=0, n_misses=6
hash_table: obs-file-hash, 768 bytes
        n_buckets=64, n_elements=0, n_collisions=0
        max_bucket_len=0, n_used_buckets=0, ave_bucket_len=0.00
        n_hits=0, n_misses=3


~/test/opkg-test$ ./opkg -o ~/test/opkg-test/root -f opkg.conf --force-postinstall -V4 files a
opkg_conf_parse_file: Loading conf file opkg.conf.
opkg_conf_parse_file: Supported arch all priority (1)
pkg_hash_load_status_files: 
pkg_vec_insert_merge: Adding new pkg=a version=1 arch=all.
Package a (1) is installed on root and has the following files:
/home/tech/test/opkg-test/root/
/home/tech/test/opkg-test/root/x1
/home/tech/test/opkg-test/root/x2
hash_table: pkg-hash, 12288 bytes
        n_buckets=1024, n_elements=1, n_collisions=0
        max_bucket_len=0, n_used_buckets=1, ave_bucket_len=1.00
        n_hits=1, n_misses=1
hash_table: file-hash, 12288 bytes
        n_buckets=1024, n_elements=0, n_collisions=0
        max_bucket_len=0, n_used_buckets=0, ave_bucket_len=0.00
        n_hits=0, n_misses=0
hash_table: obs-file-hash, 768 bytes
        n_buckets=64, n_elements=0, n_collisions=0
        max_bucket_len=0, n_used_buckets=0, ave_bucket_len=0.00
        n_hits=0, n_misses=0


~/test/opkg-test$ ./opkg -o ~/test/opkg-test/root -f opkg.conf --force-postinstall -V4 install b_1_all.ipk 
opkg_conf_parse_file: Loading conf file opkg.conf.
opkg_conf_parse_file: Supported arch all priority (1)
pkg_hash_load_feeds: 
pkg_hash_load_status_files: 
pkg_vec_insert_merge: Adding new pkg=a version=1 arch=all.
opkg_install_cmd: b_1_all.ipk
opkg_prepare_url_for_install: Package b provided by hand (b_1_all.ipk).
pkg_vec_insert_merge: Adding new pkg=b version=1 arch=all.
pkg_info_preinstall_check: Updating file owner list.
pkg_hash_fetch_best_installation_candidate: Best installation candidate for b:
pkg_hash_fetch_best_installation_candidate: Adding b to providers.
pkg_hash_fetch_best_installation_candidate: b arch=all arch_priority=1 version=1.
pkg_hash_fetch_best_installation_candidate: Candidate: b 1.
opkg_prepare_install_by_name: Versions from pkg_hash_fetch: new 1
opkg_install_by_name: Calling opkg_install_pkg for b 1.
opkg_install_pkg: Calling pkg_arch_supported.
pkg_arch_supported: Arch all (priority 1) supported for pkg b.
Installing b (1) on root.
is_pkg_a_replaces: Seems I&apos;ve found a replace a a
update_file_ownership: update_file_ownership: new_pkg=b wants file /home/tech/test/opkg-test/root/, from owner=a
update_file_ownership: update_file_ownership: new_pkg=b wants file /home/tech/test/opkg-test/root/x2, from owner=a
update_file_ownership: update_file_ownership: new_pkg=b wants file /home/tech/test/opkg-test/root/x3, from owner=&lt;NULL&gt;
pkg_hash_fetch_unsatisfied_dependencies: Checking dependencies for &apos;b&apos;.
Removing package a from root...
pkg_run_script: Running script /home/tech/test/opkg-test/root//usr/lib/opkg/info/a.prerm.
remove_data_files_and_list: Deleting /home/tech/test/opkg-test/root/x1.
remove_data_files_and_list: Deleting /home/tech/test/opkg-test/root/x2.
pkg_run_script: Running script /home/tech/test/opkg-test/root//usr/lib/opkg/info/a.postrm.
remove_maintainer_scripts: Deleting /home/tech/test/opkg-test/root//usr/lib/opkg/info/a.control.
pkg_run_script: Running script /tmp/opkg-1wOu4T/b-XzCcSb/preinst.
opkg_install_pkg: Installing maintainer scripts.
opkg_install_pkg: Installing data files for b.
install_data_files: Extracting data files to /home/tech/test/opkg-test/root/.
install_data_files: Calling pkg_write_filelist.
pkg_write_filelist: Creating /home/tech/test/opkg-test/root//usr/lib/opkg/info/b.list file for pkg b.
opkg_install_pkg: Resolving conf files for b
opkg_install_pkg: pkg=b old_state_flag=110 state_flag=100
opkg_configure_packages: Configuring unpacked packages.
opkg_configure_packages: Reordering packages before configuring them...
opkg_recurse_pkgs_in_order: pkg b.
Configuring b.
pkg_run_script: Running script /home/tech/test/opkg-test/root//usr/lib/opkg/info/b.postinst.
write_status_files_if_changed: Writing status file.
pkg_write_changed_filelists: Saving changed filelists.
hash_table: pkg-hash, 12288 bytes
        n_buckets=1024, n_elements=2, n_collisions=0
        max_bucket_len=0, n_used_buckets=2, ave_bucket_len=1.00
        n_hits=6, n_misses=2
hash_table: file-hash, 12288 bytes
        n_buckets=1024, n_elements=4, n_collisions=0
        max_bucket_len=0, n_used_buckets=4, ave_bucket_len=1.00
        n_hits=6, n_misses=5
hash_table: obs-file-hash, 768 bytes
        n_buckets=64, n_elements=0, n_collisions=0
        max_bucket_len=0, n_used_buckets=0, ave_bucket_len=0.00
        n_hits=0, n_misses=3


~/test/opkg-test$ ./opkg -o ~/test/opkg-test/root -f opkg.conf --force-postinstall -V4 files b
opkg_conf_parse_file: Loading conf file opkg.conf.
opkg_conf_parse_file: Supported arch all priority (1)
pkg_hash_load_status_files: 
pkg_vec_insert_merge: Adding new pkg=b version=1 arch=all.
Package b (1) is installed on root and has the following files:
/home/tech/test/opkg-test/root/x3
hash_table: pkg-hash, 12288 bytes
        n_buckets=1024, n_elements=2, n_collisions=0
        max_bucket_len=0, n_used_buckets=2, ave_bucket_len=1.00
        n_hits=3, n_misses=2
hash_table: file-hash, 12288 bytes
        n_buckets=1024, n_elements=0, n_collisions=0
        max_bucket_len=0, n_used_buckets=0, ave_bucket_len=0.00
        n_hits=0, n_misses=0
hash_table: obs-file-hash, 768 bytes
        n_buckets=64, n_elements=0, n_collisions=0
        max_bucket_len=0, n_used_buckets=0, ave_bucket_len=0.00
        n_hits=0, n_misses=0


~/test/opkg-test$ find root/
root/
root/x2
root/x3
root/usr
root/usr/lib
root/usr/lib/opkg
root/usr/lib/opkg/lists
root/usr/lib/opkg/info
root/usr/lib/opkg/info/b.list
root/usr/lib/opkg/info/b.control
root/usr/lib/opkg/status</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54333</commentid>
    <comment_count>1</comment_count>
      <attachid>2752</attachid>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2015-09-21 01:10:50 +0000</bug_when>
    <thetext>Created attachment 2752
test package (B)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57935</commentid>
    <comment_count>2</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2016-01-19 00:00:17 +0000</bug_when>
    <thetext>On the libsolv backed, this test exposed a bug on the transaction steps ordering libsolv algorithm (https://github.com/openSUSE/libsolv/issues/120). Instead of ordering the operations as 1) remove A, 2) install B, the order is reversed.

Other than fixing libsolv, an alternate solution is to use the flags SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE | SOLVER_TRANSACTION_SHOW_OBSOLETES, which would treat the operation as an upgrade from A to B. This will require additional work as upgrade operations are not currently design to work across packages.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60509</commentid>
    <comment_count>3</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2016-03-29 21:32:33 +0000</bug_when>
    <thetext>commit 9f02bbe5e3ccaeca7e30a38557733126acd96010

Fix duplicated offline root in in path in function check_data_file_clashes_change</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2751</attachid>
            <date>2015-09-21 01:10:08 +0000</date>
            <delta_ts>2015-09-21 01:10:08 +0000</delta_ts>
            <desc>test package (A)</desc>
            <filename>a_1_all.ipk</filename>
            <type>application/octet-stream</type>
            <size>628</size>
            <attacher name="Alejandro del Castillo">alejandro.delcastillo</attacher>
            
              <data encoding="base64">ITxhcmNoPgpkZWJpYW4tYmluYXJ5LyAgMTQyNTk5MTg4MSAgMTAwMCAgMTAwMCAgMTAwNjQ0ICA0
ICAgICAgICAgYAoyLjAKZGF0YS50YXIuZ3ovICAgIDE0MjU5OTE4ODEgIDEwMDAgIDEwMDAgIDEw
MDY0NCAgMTQ4ICAgICAgIGAKH4sIAMno/lQAA+3SQQoCMQyF4RylJ5hJxiY5j4jgWkfw+LYDgitH
F10I/7cJTQsJvE6zDKdNuvdq6fpeX8SWmulx8K2fESbFx68mcr+tx2spsp5Pl0/v9u7/1DQ/ltEz
esBR63f5W/snpu0oRUcv1pG/jZ7xU/5qW/4W5A8AAAAAAAAAAAAAAADseQLKB8yyACgAAGNvbnRy
b2wudGFyLmd6LyAxNDI1OTkxODgxICAxMDAwICAxMDAwICAxMDA2NDQgIDI4NyAgICAgICBgCh+L
CADJ6P5UAAPt0c1OAyEQB3DOPAVP0HbXZUn21tiDB00am3inOFpShA2wUd9edk2NHtTTpjH+fwnh
M8zALJZsdqtCSTn2lZKrz/0Jq+pGKdk2tboo66ptGybk/KkxNqSsoxAskzn8dO63/T9qsTTB5xjc
jDHGArdN8239a6W+1r+qaiWZWM2Y04d/Xv+tNkf9SJ3Q/I5issF3ouLraA62vDgPcdxyjm+oJ3+f
OsFvqXfa0Di8DP7BWZPH8YaSibbP0w2ZUhZ7vis3TPO9TsS30YZo82snwnRMO36jrc+lUezE2tEL
v7aGfCoxB3/04dnzq/BE/ZTgaWUXhmjoPQY/9/cBAAAAAAAAAAAAAAAAAAAAAJzVG+HJWcQAKAAA
Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2752</attachid>
            <date>2015-09-21 01:10:50 +0000</date>
            <delta_ts>2015-09-21 01:10:50 +0000</delta_ts>
            <desc>test package (B)</desc>
            <filename>b_1_all.ipk</filename>
            <type>application/octet-stream</type>
            <size>628</size>
            <attacher name="Alejandro del Castillo">alejandro.delcastillo</attacher>
            
              <data encoding="base64">ITxhcmNoPgpkZWJpYW4tYmluYXJ5LyAgMTQyNTk5MzM0MyAgMTAwMCAgMTAwMCAgMTAwNjQ0ICA0
ICAgICAgICAgYAoyLjAKZGF0YS50YXIuZ3ovICAgIDE0MjU5OTMzNDMgIDEwMDAgIDEwMDAgIDEw
MDY0NCAgMTQ0ICAgICAgIGAKH4sIAH/u/lQAA+3RMQrDMAyFYR3FJ0gs25LOU0ohc5tAjt94KHRq
SsFD4f8WgSSQ4E2zDJcPYdarhuX3+iJaWoR5Ne/9cC+SbPxrIttjvdxTkvV2XT7tnc3/1DTvZfSN
HrC39l3+euxp1lIl5dGPdeRfR9/4Kf9G/gAAAAAAAAAAAAAAAMCZJ+SmlNgAKAAAY29udHJvbC50
YXIuZ3ovIDE0MjU5OTMzNDMgIDEwMDAgIDEwMDAgIDEwMDY0NCAgMjkyICAgICAgIGAKH4sIAH/u
/lQAA+3R3U7DIBQHcK55Cp5gg05K0rtFL7zQZHGJ9wzRkSE0QP14e1mXGm/Uq2Yx/n9JQw8f59Ce
xZLMjldKyuMolORfxwkRzYVSslVCijqv2rYhTM5/NUKGXHRijBRr9j/t+239j1osTQwlRT9jjWOD
W86/7f+Kr6b+t4orwoVopCKMz3inT/+8/xttDvrJdmxH723KLoaOCbpOZu/qF5ch1SXtPb2zvdfG
5hrRTYov7uH0fhnDo3emjMGVzSa5voxZis2lZt3WLGO809nWoy4mV947Fsdt2tNb7UKpj00dW3v7
Rm+csSHXukM4hPga6HV8tv14yWlmG4dk7KkGPfcvBAAAAAAAAAAAAAAAAAAAAAA4mw82omc4ACgA
AA==
</data>

          </attachment>
      

    </bug>

</bugzilla>