Hi,

On Tue, 20 Aug 2013, Bastien ROUCARIES wrote:
> Now that symlink to dir is implemented, how can we implement the
> reverse operation ?

Note that you still have to update man/dpkg-maintscript-helper.1 AFAIK.
We don't want to ship undocumented features.

> I suppose checking that the:
> - path is a directory,
> - if LAST version is lesser

We should clearly define the cases that we want to support (and have it
fail when the pre-requisites are not satisfied). You have mutiple
questions to answer:

1/ How do you want to handle non-packaged files present in the directory?
2/ How do you want to handle files from other packages in the directory?
3/ What do you do if the expected directory is not a directory? What if
   it's another symlink (probably setup by the admin)?

My first answers would be:
1/ and 2/ try to reinstall those files at their expected place in the
directory pointed by the symlink
3/ do nothing

A possible way to do this could be:
* Move the directory away in preinst (<dir>.dpkg-backup), put in place a symlink
  pointing to the renamed directory
* In postinst, move remaining files from the temporary directory to
  the directory pointed by the symlink (except if there's already a new
  file at the expected location, in that case warn about the conflict
  and leave the file). Note we expect the file unpack to have updated
  the symlink to a new directory. If it's still pointing to
  "<dir>.dpkg-backup" then we should probably update the symlink
  ourselves (assuming it's given as parameter to the
  dpkg-maintscript-helper).

> And what do you means by swap? Could you give some example ?

That feature description was written by Lionel Elie Mamane
<lio...@mamane.lu> (in copy). But swapping means something like this:

Changing: directory "foo", symlink "bar" (pointing to "foo")
Into: directory "bar", symlink "foo" (pointing to "bar")

I'm not sure that this is a frequent case and we should consider whether
2 simultaneous calls to dpkg-maintscript-helper would do the right thing
(one symlink2dir associated to one dir2symlink)

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to