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

Re: `overriding' dpkg for a particular file



Raul Miller writes ("Re: `overriding' dpkg for a particular file"):
> Ian Jackson:
>    There is one thing I would like some comments on: what names should I
>    give to the particular aspects of this feature ?
>
> How about:
> "emergency override" for name of feature
> "debian name" for original name of file
> "local name" for the redirected name
> ?

That's not entirely accurate, because a Debian package might use this
feature (for example, if there were a colour-ls package, it would
probably have to use it), and then there would be no Debian/local
distinction.

In any case, saying `local name' for the redirected name implies that
that is where the local version of file goes, whereas in fact the
local version of the file goes in the `debian name' and the Debian
version gets put in what you're calling the `local name' !

It's also not just for use in emergencies.

Forgive me for being perhaps rather baseic, but here are two examples,
diagrammatically:

1. Administrator wants to replace a Debian-provided program with
   their own version, or wants to put a wrapper around it:
                                            ____________________
     smail.deb___________                  /                    \
     |  ...              |                |\____________________/|
     | /usr/sbin/smail --+----.           |                      |
     |  ...              |     \          | /                    |
     |___________________|      \         | /usr                 |
                                 \        | /usr/sbin            |
                                  `-------> /usr/sbin/smail.real |
                                  .-------> /usr/sbin/smail      |
      ~/stuff/smail/wrapper.c    /        |                      |
      ~/stuff/smail/wrapper ----'          \____________________/

     # dpkg-override --divert /usr/sbin/smail.real /usr/sbin/smail
     # cp ~fred/stuff/smail/wrapper /usr/sbin/smail

2. Package maintainer wants to provide an `improved' version of a
   file in another package.

     fileutils.deb_______                   ____________________
     |  ...              |                 /                    \
     | /bin/ls ----------+----.           |\____________________/|
     |  ...              |     \          |                      |
     |___________________|      \         | /                    |
                                 \        | /bin                 |
     colour-ls.deb_______         `-------> /bin/ls.mono         |
     |  ...              |       .--------> /bin/ls              |
     | /bin/ls ----------+------'         |                      |
     |  ...              |                 \____________________/
     |...................|
     |preinst:           |
     | dpkg-override --divert /bin/ls.mono \
     |   --package colour-ls /bin/ls
     |...................|
     |postrm:            |
     | dpkg-override --remove --divert /bin/ls.mono \
     |   --package colour-ls /bin/ls
     |___________________|

We need a name that applies to `/usr/sbin/smail.real' and
`/bin/ls.mono', the filenames, in both situations, and another name
to apply to `/usr/sbin/smail' and `/bin/ls'.

> Also, it would be nice to see either some documentation or some sort
> of warning about the case where the file is a directory.

If the file is a directory there will be no good effect.  This is
because the redirection would affect only the entry for the directory
itself in the packages whose instances if it were being redirected,
and would not affect any of the files in it.

The most likely result is that dpkg will fail to install the package
because one of the directories where it has files doesn't exist.  It
would probably create the `diverted' name of the directory, fail, and
then clean it up.

Ian.


Reply to: