Le mardi 1 mars 2011 12:49:40 Michael Olbrich, vous avez écrit : > > [...] > > With the current ptxdist installing control files is already possible. Just > add rules/<pkg>.preinst etc. Where '<pkg>' is the package name used in > '$(call install_init, <pkg>)'. > We did not like this approach as it freezes the control files whatever the configuration. We have multiple configurations, given the same source tree, and with our approach, we can select by script the control files to be included.
> > # > > # install_conffile > > # > > # Flags a file as a configuration file in package > > # This enables updating a packet without overwriting existing > > # configuration > > # > > # > > # $1: packet label > > # $2: dest > > # > > install_conffile = > > \ > > > > PKG=$(strip $(1)); > > \ > > DST=$(strip $(2)); > > \ > > echo "install_conffile:"; > > \ > > echo " dst=$$DST"; > > \ > > grep $$DST $(IMAGEDIR)/$$PKG/ipkg/CONTROL/conffiles || > > \ > > echo $$DST >> $(IMAGEDIR)/$$PKG/ipkg/CONTROL/conffiles; > > \ > > if [ $$? -ne 0 ]; then > > \ > > > > echo "Error: install_conffile failed : " $$?; > > \ > > exit 1; > > \ > > > > fi; > > \ > > echo "done"; > > The handling of install_* macros has changed alot. This won't work anymore. > Hmmm, this means two install_* calls for each config file. I'd make > install_conffile a install_alternative + flagging. True, we did not want to modify or copy the existing codebase. > > What's the exact handling of config files? What happen on update > (with/without modified config files)? How are modifications detected? Looking at the source code of ipkg gave us some headaches... It should really be replaced by opkg (is it better anyway). The conffiles file just lists the files to be considered as conf. No modification of the conf files is tracked for a given version of a package. It is only at the installation of the new package that the conf files are compared between the new file to install and the already existing one. It seems a md5sum is computed on files. The behavior on updating a modified conf file is given by two ways : * interactively, by the user * forced by option --force-defaults to force retaining previous file. Regards, Jean-Noël Avila -- ptxdist mailing list [email protected]
