---------- Forwarded message ----------
From: Bastien ROUCARIES <roucaries.bast...@gmail.com>
Date: Tue, Aug 20, 2013 at 11:38 PM
Subject: Re: Bug#583585: [dpkg] Any news ?
To: Raphael Hertzog <hert...@debian.org>


On Tue, Aug 20, 2013 at 10:50 PM, Raphael Hertzog <hert...@debian.org> wrote:
> 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.

Joined here
>
>> 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
ok this is easy
> * 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).

How can I do this ? mv -n is not portable, and if I use find how to
handle symlink ?

Should I check if md5sum are the same in case of conflicts and
override in this case ?


> 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).

ok

>> 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/

Attachment: manpatch.diff
Description: Binary data

Reply via email to