[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

added ucf support



teTeX CVS <jdg-tetex-cvs@debian.org> schrieb:

>
> Log message:
>     added ucf support. It's tested and works, but not all md5sums have been added so far

And this is how it works:
-------------------------

For each version of a configuration file that was once shipped with
tetex-bin, we have a line with the corresponding md5sum (and the
version, but that's just an arbitrary name, could be also something like
"potato") in the md5sums file. In postinst, we call ucf. This program
checks

- whether the configuration file is yet installed, if not it installs it
  and registers it in its database[1]

- if yes, it checks whether the installed file matches any of the
  md5sums it knows about. If yes, it assumes that this is an unchanged
  file from a previous version and overrides it with the new file, if
  no, it prompts the user. He has the usual choices that also dpkg
  offers. We could also provide the choice of a 3-way diff and merge,
  but I haven't had a look at this yet.[2]

And this is what maintainers should do:
---------------------------------------

- If you change a configuration file that is under ucf control, add the
  line to its md5sums file. This can be done with the command

debian/create-md5sums debian/md5susm/ucf.files.2.0.2 . 2.0.2-$newrevision

  (or just manually), assuming that the changed file is in its old
  place. (The disadvantage of the script ist that _all_ files get a new
  md5sums line, not only the changed one. Hackers welcome)

- If you move a configuration file around in our source tree, change the
  path in debian/md5sums/ucf.files.2.0.2

- If you want to change the directory (or name) of the installed file,
  do this in postinst

- If we change a configuration file that is not yet under ucf control,
  we will get the silly dpkg question also for this file, and should put
  it under ucf control concomitantly with the change. This should be
  done the following way:

  * Add the path to debian/md5sums/ucf.files.* (all versions!)

  * Change debian/rules so that the file and debian/md5sums/$file.md5sum
    are installed into /usr/share/tetex-bin instead of its location
    under /etc. Don't forget to check whether the directory needs to be
    added to debian/dirs.

  * Change postinst and postrm, adding a call along the lines of the
    texmf.d/*cnf installation.
  
  * Create debian/md5sums/$file.md5sum. The straigthforward way is to
    get the sources of previous versions of tetex-bin - either each of
    them or rather one for each version of the respective file - and run 

debian/create-md5sums debian/md5susm/ucf.files.$version ../path/to/old/unpacked/source $version

    It might be that the paths in debian/md5sums/ucf.files.$version
    have to be changed from version to version. The last $version in
    this call is an arbitrary name, in fact.


Have fun,
Frank

Footnotes:
----------

[1] It also installs $file.dpkg-dist. It should do this only when it had
to ask the user, and he/she answered to keep their changed file. But it
does it also upon a fresh install, which is bug #238730.

[2] If DEBIAN_FRONTEND is dialog and less is not installed, the diff is
displayed in the background. That's the next bug I filed against ucf,
but it doesn't yet have a number.
-- 
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie



Reply to: