zhengzkkai / opkg

Automatically exported from code.google.com/p/opkg
0 stars 0 forks source link

Opkg does not handle configuration files correctly #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install a package with a configuration file
2. Change the configuration file
3. Install a new version of that package (or the same version) 
Now even if the configuration file in the package has not changed, opkg
requests the user to resolve the clash. This should not happen.

I'm attaching a patch to fix this issue.
Please note that this patch changes the format of /usr/lib/opkg/info/PKG.list 
from 
Filename
to
Filename|md5sum

I couldn't find where opkg writes or reads the PKG.conffiles from. This of
course could be a better place to store the md5sum and changing it to
store/read from there is quite trivial.

Please contact me if you know where opkg accesses this file from. :)

Original issue reported on code.google.com by TTA...@gmail.com on 17 Jul 2009 at 5:28

Attachments:

GoogleCodeExporter commented 9 years ago
I cannot reproduce the problem you are experiencing. Perhaps it has been 
fixed...

Backups of the conf files are made if they already exist at install time. Once 
the new conf files are installed, an md5sum of 
each of the backup conf files and new conf files is made. These are compared to 
determine if a conf file has changed.

Opkg conffile handling is a mess (like everything else :)). The PKG.conffiles 
are not used. It looks like they are just 
implicitly installed from extracting the control.tar.gz file info 
/usr/lib/opkg/info/ - this is done via opkg_install.c: 
install_maintainer_scripts().

The conffile information itself is read from the file "conffile" within the 
control.tar.gz. The conffile_list data structure is 
populated in opkg_install.c: unpack_pkg_control_files().

Conffile md5sums are actually written out by opkg, into the status file. 
Unfortunately, the format they are written out in is 
not accepted by the parser. I can fix this - but I'm not really sure whether 
its worth it, as the info is unused anyway...

Original comment by graham.g...@gmail.com on 12 Nov 2009 at 3:35