<?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>8947</bug_id>
          
          <creation_ts>2016-01-19 18:28:03 +0000</creation_ts>
          <short_desc>opkg conffile resolution cannot detect unmodified conffiles modified in upgraded package</short_desc>
          <delta_ts>2021-03-22 16:44:17 +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>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>0.4.5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Tollerton">rich.tollerton</reporter>
          <assigned_to name="Alex Stewart">alex.stewart</assigned_to>
          
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>57963</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Tollerton">rich.tollerton</who>
    <bug_when>2016-01-19 18:28:03 +0000</bug_when>
    <thetext>On package upgrade, resolve_conffiles (opkg_install.c, http://git.yoctoproject.org/cgit/cgit.cgi/opkg/tree/libopkg/opkg_install.c?id=7885da3974de2df1baba220200d55920fb530e25#n770) checks whether or not the new conffile should be renamed to *-opkg by comparing the md5sum of the currently existing conffile with the md5sum of the *new* package version. The conffiles of the old package version are not queried. This means that it can&apos;t detect if a conffile has not been modified. If the conffile changed in the new version of the package, it still gets renamed to *-opkg, even if the file wasn&apos;t changed on disk.

To reproduce, AFAIK:
- Install a package containing a conffile
- Edit the source conffile
- Bump the version number
- Rebuild the package
- Upgrade to the new package version</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82568</commentid>
    <comment_count>1</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2018-12-20 23:55:26 +0000</bug_when>
    <thetext>Re-targeting in preparation for 0.4 release</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89662</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Stewart">alex.stewart</who>
    <bug_when>2021-03-19 13:45:52 +0000</bug_when>
    <thetext>I haven&apos;t been able to reproduce this issue. 

I&apos;ve pushed a regression test here[1] that I think should reproduce, using the steps that Rich has provided, but opkg seems to do the right thing. When the conffile contents changes in v2, the conffile is replaced wholesale. When you modify (&quot;locally&quot;) the conffile between upgrades, opkg prints the appropriate info and saves the v2 conffile as `issue8947-a.conf-opkg` instead of overwriting the local copy.

[1] https://gitlab.com/astewart.49c6/opkg/-/blob/b690d6dc4accfb05eb317b367d636038e4645333/tests/regress/issue8947.py

I know it&apos;s been a while, but do you have any more insights Rich?


&gt;On package upgrade, resolve_conffiles (opkg_install.c) checks whether or not the new conffile should be renamed to *-opkg by comparing the md5sum of the currently existing conffile with the md5sum of the *new* package version.

resolve_conffiles() is called *after* the new package&apos;s conffiles have been copied into place. The MD5SUM comparison to determine if there have been local modifications is done by backup_modified_conffiles() [2].

[2] https://git.yoctoproject.org/cgit/cgit.cgi/opkg/tree/libopkg/opkg_install.c?id=e544c04eeadec7ade2c58c7be506acafb011a4a9#n342</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89682</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Tollerton">rich.tollerton</who>
    <bug_when>2021-03-22 16:02:04 +0000</bug_when>
    <thetext>I only precisely recall that I filed this after talking with Alejandro about it. It was always a somewhat aspirational bug report. If the code disagrees, close this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89683</commentid>
    <comment_count>4</comment_count>
    <who name="Alex Stewart">alex.stewart</who>
    <bug_when>2021-03-22 16:44:17 +0000</bug_when>
    <thetext>OK. In that case, I&apos;ll close this as not-reproducible. If anyone runs into a similar issue, please file a new bug and (ideally) create a reproducing case in the regression tests.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>