Debian Bug report logs - #583585
handle in dpkg-maintscript-helper dir to symlink

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg.

Reported by: Raphael Hertzog <hertzog@debian.org>

Date: Fri, 28 May 2010 13:27:13 UTC

Severity: wishlist

Found in version dpkg/1.16.10

Fixed in version dpkg/1.17.2

Done: Guillem Jover <guillem@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg-dev. (Fri, 28 May 2010 13:27:16 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
New Bug report received and forwarded. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 28 May 2010 13:27:16 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: submit@bugs.debian.org
Subject: dpkg-maintscript-helper: replace a dir with a symlink and vice-versa
Date: Fri, 28 May 2010 15:25:53 +0200
Package: dpkg-dev
Version: 1.15.7.2
Severity: wishlist

Here's a wishlist for dpkg-maintscript-helper:

----
 Date: Fri, 28 May 2010 15:17:25 +0200
 From: Lionel Elie Mamane <lionel@mamane.lu>
 To: Raphael Hertzog <hertzog@debian.org>

On Mon, May 24, 2010 at 11:05:44AM +0200, Raphael Hertzog wrote:
>   * The dpkg-maintscript-helper tool has been introduced in dpkg 1.15.7.2
>     to help packagers deal with renaming conffiles and removing obsolete
>     conffiles. Check its manual page dpkg-maintscript-helper(1) for more
>     details on how to use it. This shell script might be extended over
>     time to cover other common operations. Feel free to make suggestions
>     while it's not too late to make changes on this new interface.

Suggestion for another common operation: replacing a directory by a
symlink and vice-versa, including the case of swapping the
two. Keeping administrator's previous changes on that. That's rather
delicate to get right, and I've seen two cases I remember where it was
done wrong (in a buggy way).

--
Lionel
----


-- 
Raphaël Hertzog

Like what I do? Sponsor me: http://ouaza.com/wp/2010/01/05/5-years-of-freexian/
My Debian goals: http://ouaza.com/wp/2010/01/09/debian-related-goals-for-2010/




Bug reassigned from package 'dpkg-dev' to 'dpkg'. Request was from Raphaël Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Fri, 28 May 2010 13:33:06 GMT) Full text and rfc822 format available.

Bug No longer marked as found in versions dpkg/1.15.7.2. Request was from Raphaël Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Fri, 28 May 2010 13:33:07 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Sat, 01 Dec 2012 17:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gregor Jasny <gjasny@googlemail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 01 Dec 2012 17:45:03 GMT) Full text and rfc822 format available.

Message #14 received at 583585@bugs.debian.org (full text, mbox):

From: Gregor Jasny <gjasny@googlemail.com>
To: 583585@bugs.debian.org
Subject: dpkg-maintscript-helper: replace symlink with directory
Date: Sat, 01 Dec 2012 18:41:12 +0100
[Message part 1 (text/plain, inline)]
Hello,

In my v4l-utils package I want to replace a documentation symlink with a
directory. When I was searching for the proper solution I stumbled upon
this bug.

Attached you'll find my proposal how to implement the symlink_to_dir
function. (Please disregard any indention problems for now).

I'd like to call the new function the following way:
dpkg-maintscript-helper.sh symlink_to_dir /usr/share/doc/libv4l-dev
libv4l0 -- "$@"

The first parameter is the symlink that should be replaced, the second
is the target it pointed to when an old package installed it first.

Via the "original target" it should be possible to detect any changes by
the system administrator and leave the "symlink" as is.

There are some open questions on my side:
1) Do you see a demand to also require a LASTVERSION argument?
2) Shold I also check where $SYMLINK.dpkg-remove is pointing to in the
post* scripts?
3) Is there a testbed where I can add tests for this?
4) What about downgrading packages? Would that be an use case, too?

Thanks,
Gregor
[symlink-to-dir.diff (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Wed, 13 Feb 2013 20:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Wed, 13 Feb 2013 20:09:03 GMT) Full text and rfc822 format available.

Message #19 received at 583585@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Gregor Jasny <gjasny@googlemail.com>, 583585@bugs.debian.org
Subject: Re: Bug#583585: dpkg-maintscript-helper: replace symlink with directory
Date: Wed, 13 Feb 2013 21:06:22 +0100
Hi,

sorry for the big delay in my answer.

On Sat, 01 Dec 2012, Gregor Jasny wrote:
> There are some open questions on my side:
> 1) Do you see a demand to also require a LASTVERSION argument?

Yes. We always want to restrict such code to be only executed when really
needed. Think for example when you have an history where you switched
a path back and forth between a directory and a symlink. You don't want
to execute both commands for any upgrade...

> 2) Shold I also check where $SYMLINK.dpkg-remove is pointing to in the
> post* scripts?

I don't see the need for this.

> 3) Is there a testbed where I can add tests for this?

We have a pkg-tests.git repository, see explanations in
http://wiki.debian.org/Teams/Dpkg/Contribute

There are already some tests for dpkg-maintscript-helper in it.

> 4) What about downgrading packages? Would that be an use case, too?

Yes. I always try to take it into account in dpkg-maintscript-helper.
That said I would not make it a requirement to merge this new command.

But this alone justifies the LASTVERSION parameter, so that downgrade support
can at least be implemented...

> +		if [ "$1" = "install" -o "$1" = "upgrade" ] && [ -n "$2" ] && [ -L "$SYMLINK" ] && [ "$(readlink "$SYMLINK")" = "$SYMLINK_TARGET" ]; then
> +		    mv -f "$SYMLINK" "$SYMLINK.dpkg-remove"

Please do not use "-L" but "-h" (-L is non-standard).

Otherwise it looks like a good start. Thanks for trying to tackle this!

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

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



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Sat, 10 Aug 2013 20:18:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 10 Aug 2013 20:18:05 GMT) Full text and rfc822 format available.

Message #24 received at 583585@bugs.debian.org (full text, mbox):

From: bastien ROUCARIES <roucaries.bastien@gmail.com>
To: 583585@bugs.debian.org
Subject: [dpkg] Any news ?
Date: Sat, 10 Aug 2013 22:14:19 +0200
Package: dpkg
Version: 1.16.10

Any news of this bug ? I have been hit by it.

Bastien



Added indication that bug 583585 blocks 659044 Request was from Bastien ROUCARIES <roucaries.bastien@gmail.com> to 659044-submit@bugs.debian.org. (Sun, 11 Aug 2013 18:33:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Mon, 19 Aug 2013 11:57:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Mon, 19 Aug 2013 11:57:04 GMT) Full text and rfc822 format available.

Message #31 received at 583585@bugs.debian.org (full text, mbox):

From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: 583585@bugs.debian.org, Raphael Hertzog <hertzog@debian.org>
Subject: Re: [dpkg] Any news ?
Date: Mon, 19 Aug 2013 13:54:10 +0200
[Message part 1 (text/plain, inline)]
A new patch

On Sat, Aug 10, 2013 at 10:14 PM, bastien ROUCARIES
<roucaries.bastien@gmail.com> wrote:
> Package: dpkg
> Version: 1.16.10
>
> Any news of this bug ? I have been hit by it.
>
> Bastien
[0001-Add-a-symlink_to_dir-operation.patch (application/octet-stream, attachment)]

Added indication that bug 583585 blocks 720185 Request was from bastien ROUCARIES <roucaries.bastien@gmail.com> to submit@bugs.debian.org. (Mon, 19 Aug 2013 13:18:07 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Tue, 20 Aug 2013 01:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guillem Jover <guillem@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 20 Aug 2013 01:15:04 GMT) Full text and rfc822 format available.

Message #38 received at 583585@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>, 583585@bugs.debian.org
Subject: Re: Bug#583585: [dpkg] Any news ?
Date: Tue, 20 Aug 2013 03:13:14 +0200
Hi!

On Mon, 2013-08-19 at 13:54:10 +0200, Bastien ROUCARIES wrote:
> A new patch

Although, as I've said before, I consider dpkg-maintscript-helper a
dead-end and in a way a waste of time, I've also said I'd merge
patches for it if they look more or less ok.

So I've merged it locally now after fixing some style and shell syntax
issues (did you test it?), made last-version optional and added it to
the usage output, and I'll try to do some minimal testing tomorrow.
But functional tests for pkg-tests.git would be nicer, and if you could
prepare an update to the man page so that this can be merged for one
of the 1.17.x uploads that'd be even better.

Thanks,
Guillem



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Tue, 20 Aug 2013 06:09:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 20 Aug 2013 06:09:05 GMT) Full text and rfc822 format available.

Message #43 received at 583585@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Guillem Jover <guillem@debian.org>, 583585@bugs.debian.org
Cc: Bastien ROUCARIES <roucaries.bastien@gmail.com>
Subject: Re: Bug#583585: [dpkg] Any news ?
Date: Tue, 20 Aug 2013 08:05:38 +0200
Hi,

On Tue, 20 Aug 2013, Guillem Jover wrote:
> Although, as I've said before, I consider dpkg-maintscript-helper a
> dead-end and in a way a waste of time, I've also said I'd merge
> patches for it if they look more or less ok.

For reference, I'm happy to waste my time on dpkg-maintscript-helper so
that you can work on fixing those issues properly at the dpkg level.

> So I've merged it locally now after fixing some style and shell syntax
> issues (did you test it?), made last-version optional and added it to
> the usage output, and I'll try to do some minimal testing tomorrow.
> But functional tests for pkg-tests.git would be nicer, and if you could
> prepare an update to the man page so that this can be merged for one
> of the 1.17.x uploads that'd be even better.

I had a chat with Bastien on #debian-qa yesterday and I already asked him
to submit functional tests for pkg-tests.git.

Can you share your enhanced version so that we can finish the work?

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

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



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Tue, 20 Aug 2013 17:21:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 20 Aug 2013 17:21:04 GMT) Full text and rfc822 format available.

Message #48 received at 583585@bugs.debian.org (full text, mbox):

From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: Raphael Hertzog <hertzog@debian.org>
Cc: Guillem Jover <guillem@debian.org>, 583585@bugs.debian.org
Subject: Re: Bug#583585: [dpkg] Any news ?
Date: Tue, 20 Aug 2013 19:18:57 +0200
[Message part 1 (text/plain, inline)]
On Tue, Aug 20, 2013 at 8:05 AM, Raphael Hertzog <hertzog@debian.org> wrote:
> Hi,
>
> On Tue, 20 Aug 2013, Guillem Jover wrote:
>> Although, as I've said before, I consider dpkg-maintscript-helper a
>> dead-end and in a way a waste of time, I've also said I'd merge
>> patches for it if they look more or less ok.
>
> For reference, I'm happy to waste my time on dpkg-maintscript-helper so
> that you can work on fixing those issues properly at the dpkg level.
>
>> So I've merged it locally now after fixing some style and shell syntax
>> issues (did you test it?), made last-version optional and added it to
>> the usage output, and I'll try to do some minimal testing tomorrow.
>> But functional tests for pkg-tests.git would be nicer, and if you could
>> prepare an update to the man page so that this can be merged for one
>> of the 1.17.x uploads that'd be even better.
>
> I had a chat with Bastien on #debian-qa yesterday and I already asked him
> to submit functional tests for pkg-tests.git.

Somthing like this.
I could not test I get problem about
pkg-tests/t-normal/../dpkgdb/info/format-new running pkg-test could
not create file

Bastien

> Can you share your enhanced version so that we can finish the work?
>
> Cheers,
> --
> Raphaël Hertzog ◈ Debian Developer
>
> Discover the Debian Administrator's Handbook:
> → http://debian-handbook.info/get/
[0001-Add-test-suite-for-testing-dir-to-symlink-problem.patch (application/octet-stream, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Tue, 20 Aug 2013 18:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guillem Jover <guillem@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 20 Aug 2013 18:51:04 GMT) Full text and rfc822 format available.

Message #53 received at 583585@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>
Cc: Raphael Hertzog <hertzog@debian.org>, 583585@bugs.debian.org
Subject: Re: Bug#583585: [dpkg] Any news ?
Date: Tue, 20 Aug 2013 20:49:23 +0200
Hi!

On Tue, 2013-08-20 at 19:18:57 +0200, Bastien ROUCARIES wrote:
> Somthing like this.

Thanks, I've applied it locally, and extended it with some checks
between package installations. Also added the real directory to the
upgraded version.

> I could not test I get problem about
> pkg-tests/t-normal/../dpkgdb/info/format-new running pkg-test could
> not create file

If you could send the output and how you run it, I could take a look.

Thanks,
Guillem



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Tue, 20 Aug 2013 19:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 20 Aug 2013 19:30:04 GMT) Full text and rfc822 format available.

Message #58 received at 583585@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Guillem Jover <guillem@debian.org>, 583585@bugs.debian.org
Cc: Bastien ROUCARIES <roucaries.bastien@gmail.com>
Subject: Re: Bug#583585: [dpkg] Any news ?
Date: Tue, 20 Aug 2013 21:26:02 +0200
Hi,

On Tue, 20 Aug 2013, Guillem Jover wrote:
> > I could not test I get problem about
> > pkg-tests/t-normal/../dpkgdb/info/format-new running pkg-test could
> > not create file
> 
> If you could send the output and how you run it, I could take a look.

I have pushed a fix already. The issue is simply that a fresh clone is
missing dpkgdb/updates and dpkgdb/info.

Bastien, you can just mkdir those two directories and you'll be able to
run the tests (or you can pull my changes and they will be auto-created
by the Makefiles).

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

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



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Tue, 20 Aug 2013 19:54:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 20 Aug 2013 19:54:05 GMT) Full text and rfc822 format available.

Message #63 received at 583585@bugs.debian.org (full text, mbox):

From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: Raphael Hertzog <hertzog@debian.org>
Cc: Guillem Jover <guillem@debian.org>, 583585@bugs.debian.org
Subject: Re: Bug#583585: [dpkg] Any news ?
Date: Tue, 20 Aug 2013 21:50:59 +0200
On Tue, Aug 20, 2013 at 9:26 PM, Raphael Hertzog <hertzog@debian.org> wrote:
> Hi,
>
> On Tue, 20 Aug 2013, Guillem Jover wrote:
>> > I could not test I get problem about
>> > pkg-tests/t-normal/../dpkgdb/info/format-new running pkg-test could
>> > not create file
>>
>> If you could send the output and how you run it, I could take a look.
>
> I have pushed a fix already. The issue is simply that a fresh clone is
> missing dpkgdb/updates and dpkgdb/info.
>
> Bastien, you can just mkdir those two directories and you'll be able to
> run the tests (or you can pull my changes and they will be auto-created
> by the Makefiles).

Thanks, will try this week end.

Now that symlink to dir is implemented, how can we implement the
reverse operation ?

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

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

Bastien

>
> Cheers,
> --
> Raphaël Hertzog ◈ Debian Developer
>
> Discover the Debian Administrator's Handbook:
> → http://debian-handbook.info/get/



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Tue, 20 Aug 2013 20:54:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 20 Aug 2013 20:54:04 GMT) Full text and rfc822 format available.

Message #68 received at 583585@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>
Cc: 583585@bugs.debian.org, Lionel Elie Mamane <lionel@mamane.lu>
Subject: Re: Bug#583585: [dpkg] Any news ?
Date: Tue, 20 Aug 2013 22:50:11 +0200
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
<lionel@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/



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Tue, 20 Aug 2013 21:42:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 20 Aug 2013 21:42:04 GMT) Full text and rfc822 format available.

Message #73 received at 583585@bugs.debian.org (full text, mbox):

From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: 583585@bugs.debian.org
Subject: Fwd: Bug#583585: [dpkg] Any news ?
Date: Tue, 20 Aug 2013 23:38:57 +0200
[Message part 1 (text/plain, inline)]
---------- Forwarded message ----------
From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
Date: Tue, Aug 20, 2013 at 11:38 PM
Subject: Re: Bug#583585: [dpkg] Any news ?
To: Raphael Hertzog <hertzog@debian.org>


On Tue, Aug 20, 2013 at 10:50 PM, Raphael Hertzog <hertzog@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
> <lionel@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/
[manpatch.diff (application/octet-stream, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Tue, 20 Aug 2013 22:12:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guillem Jover <guillem@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 20 Aug 2013 22:12:04 GMT) Full text and rfc822 format available.

Message #78 received at 583585@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>, 583585@bugs.debian.org
Subject: Re: Bug#583585: Fwd: Bug#583585: [dpkg] Any news ?
Date: Wed, 21 Aug 2013 00:08:19 +0200
On Tue, 2013-08-20 at 23:38:57 +0200, Bastien ROUCARIES wrote:
> Joined here

Thanks, I've squashed the man page update to the local commit, and
fixed some issues, like typo and wording stuff, and references to
conffiles, and the non-existent package name.

Thanks,
Guillem



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Tue, 20 Aug 2013 23:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guillem Jover <guillem@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 20 Aug 2013 23:51:04 GMT) Full text and rfc822 format available.

Message #83 received at 583585@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>, 583585@bugs.debian.org
Subject: Re: Bug#583585: Fwd: Bug#583585: [dpkg] Any news ?
Date: Wed, 21 Aug 2013 01:49:04 +0200
On Wed, 2013-08-21 at 00:08:19 +0200, Guillem Jover wrote:
> On Tue, 2013-08-20 at 23:38:57 +0200, Bastien ROUCARIES wrote:
> > Joined here
> 
> Thanks, I've squashed the man page update to the local commit, and
> fixed some issues, like typo and wording stuff, and references to
> conffiles, and the non-existent package name.

Actually, I've fixed the missing package name argument by implementing
it on the command.

Thanks,
Guillem



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Wed, 21 Aug 2013 06:09:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Wed, 21 Aug 2013 06:09:04 GMT) Full text and rfc822 format available.

Message #88 received at 583585@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>, 583585@bugs.debian.org
Subject: Re: Bug#583585: Fwd: Bug#583585: [dpkg] Any news ?
Date: Wed, 21 Aug 2013 08:04:11 +0200
Hi,

On Tue, 20 Aug 2013, Bastien ROUCARIES wrote:
> > 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 ?

mymove() {
    local origin=$1
    local target=$2
    while read path; do
	# do the work for each file here
    done
}

find $origin | mymove $origin $target

You can use compute the relative path names by stripping $origin from the
stard and you can do whatever checks you want with "test".

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

I would not override but it's interesting to compare the files
yes. That way we can avoid complaining about a conflict when in fact
both files are identical. And we can silently drop our copy.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

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



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Fri, 23 Aug 2013 18:45:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 23 Aug 2013 18:45:10 GMT) Full text and rfc822 format available.

Message #93 received at 583585@bugs.debian.org (full text, mbox):

From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: Raphael Hertzog <hertzog@debian.org>
Cc: 583585@bugs.debian.org
Subject: Re: Bug#583585: Fwd: Bug#583585: [dpkg] Any news ?
Date: Fri, 23 Aug 2013 20:40:44 +0200
[Message part 1 (text/plain, inline)]
Le 21 août 2013 08:04, "Raphael Hertzog" <hertzog@debian.org> a écrit :
>
> Hi,
>
> On Tue, 20 Aug 2013, Bastien ROUCARIES wrote:
> > > 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 ?
>
> mymove() {
>     local origin=$1
>     local target=$2
>     while read path; do
>         # do the work for each file here
>     done
> }
Not safe if a filename include a new line...

Find -print0

And replacing read by read -r -d $'\0' is safer but I do not know if it is
portable.

Or xargs but we need to fork for each file and we get the portability
problem of find print0.

What do you prefer ?
> find $origin | mymove $origin $target
>
> You can use compute the relative path names by stripping $origin from the
> stard and you can do whatever checks you want with "test".
>
> > Should I check if md5sum are the same in case of conflicts and
> > override in this case ?
>
> I would not override but it's interesting to compare the files
> yes. That way we can avoid complaining about a conflict when in fact
> both files are identical. And we can silently drop our copy.
>
> Cheers,
> --
> Raphaël Hertzog ◈ Debian Developer
>
> Discover the Debian Administrator's Handbook:
> → http://debian-handbook.info/get/
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Fri, 23 Aug 2013 19:09:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 23 Aug 2013 19:09:05 GMT) Full text and rfc822 format available.

Message #98 received at 583585@bugs.debian.org (full text, mbox):

From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: Raphael Hertzog <hertzog@debian.org>
Cc: 583585@bugs.debian.org
Subject: Re: Bug#583585: Fwd: Bug#583585: [dpkg] Any news ?
Date: Fri, 23 Aug 2013 21:07:14 +0200
[Message part 1 (text/plain, inline)]
Le 23 août 2013 20:40, "Bastien ROUCARIES" <roucaries.bastien@gmail.com> a
écrit :
>
> Le 21 août 2013 08:04, "Raphael Hertzog" <hertzog@debian.org> a écrit :
>
> >
> > Hi,
> >
> > On Tue, 20 Aug 2013, Bastien ROUCARIES wrote:
> > > > 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 ?
> >
> > mymove() {
> >     local origin=$1
> >     local target=$2
> >     while read path; do
> >         # do the work for each file here
> >     done
> > }
> Not safe if a filename include a new line...
>
> Find -print0
>
> And replacing read by read -r -d $'\0' is safer but I do not know if it
is portable.
>
> Or xargs but we need to fork for each file and we get the portability
problem of find print0.
>
> What do you prefer ?

For find it is not a problem:
Find - exec printf %s\0 +

And I could test for portability problem of + if needed.

And for read I could use in case of problem dd in order to read byte by
byte.

Bastien

>
> > find $origin | mymove $origin $target
> >
> > You can use compute the relative path names by stripping $origin from
the
> > stard and you can do whatever checks you want with "test".
> >
> > > Should I check if md5sum are the same in case of conflicts and
> > > override in this case ?
> >
> > I would not override but it's interesting to compare the files
> > yes. That way we can avoid complaining about a conflict when in fact
> > both files are identical. And we can silently drop our copy.
> >
> > Cheers,
> > --
> > Raphaël Hertzog ◈ Debian Developer
> >
> > Discover the Debian Administrator's Handbook:
> > → http://debian-handbook.info/get/
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Sat, 24 Aug 2013 09:42:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 24 Aug 2013 09:42:04 GMT) Full text and rfc822 format available.

Message #103 received at 583585@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>, 583585@bugs.debian.org
Subject: Re: Bug#583585: Fwd: Bug#583585: [dpkg] Any news ?
Date: Sat, 24 Aug 2013 11:38:57 +0200
On Fri, 23 Aug 2013, Bastien ROUCARIES wrote:
> Find -print0
> 
> And replacing read by read -r -d $'\0' is safer but I do not know if it is
> portable.
> 
> Or xargs but we need to fork for each file and we get the portability
> problem of find print0.
> 
> What do you prefer ?

find -print0 is fine, dpkg-deb already uses it.
read -d is likely a problem however (I believe it's bash specific).

I don't think that I have any good answer if we want to support newlines
in filenames. But it's probably not an important use case as dpkg itself
doesn't cope very well with it. dpkg-deb builds it fine and it installs
fine but when you do "dpkg -L" you get this back (with a single
"hello\nworld" file):
$ dpkg -L foo
/.
/hello
/world

(This is because the /var/lib/dpkg/info/*.list files are line based)

So I would go ahead ignoring this specific problem. Otherwise you could
write that specific part in perl but it would be a regression to reintroduce
perl in dpkg itself.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

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



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Sat, 24 Aug 2013 10:39:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guillem Jover <guillem@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 24 Aug 2013 10:39:04 GMT) Full text and rfc822 format available.

Message #108 received at 583585@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>, 583585@bugs.debian.org
Subject: Re: Bug#583585: [dpkg] Any news ?
Date: Sat, 24 Aug 2013 12:37:28 +0200
Hi!

On Tue, 2013-08-20 at 21:50:59 +0200, Bastien ROUCARIES wrote:
> Now that symlink to dir is implemented, how can we implement the
> reverse operation ?
> 
> I suppose checking that the:
> - path is a directory,
> - if LAST version is lesser

Replacing a directory to a symlink is very problematic and has lots of
failure modes, replacing a symlink with a directory is trivial in
comparison. I'll comment further later today.

Thanks,
Guillem



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Sat, 24 Aug 2013 14:06:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 24 Aug 2013 14:06:04 GMT) Full text and rfc822 format available.

Message #113 received at 583585@bugs.debian.org (full text, mbox):

From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: Raphael Hertzog <hertzog@debian.org>
Cc: 583585@bugs.debian.org
Subject: Re: Bug#583585: Fwd: Bug#583585: [dpkg] Any news ?
Date: Sat, 24 Aug 2013 16:02:57 +0200
Too ugly for living (?) but portable:

writehex () { printf %b `printf \\\\%03o "$@"` ; }

readonebyteinhexzero() {
read dummy hex << EOF
$(dd bs=1 count=1 2> /dev/null | od -t x1)
EOF
if test x"$hex" = "x" ; then
    return 77;
fi
if test $(expr length "$hex") = "1" ; then
    hex="0$hex";
fi
if test x$hex = "x00"; then
    printf "\n";
else
    printf " 0x%s" $hex;
fi
return 0;
}

(while readonebyteinhexzero; do true; done;) | while IFS=: read path ;
do writehex $path; done;

On Sat, Aug 24, 2013 at 11:38 AM, Raphael Hertzog <hertzog@debian.org> wrote:
> On Fri, 23 Aug 2013, Bastien ROUCARIES wrote:
>> Find -print0
>>
>> And replacing read by read -r -d $'\0' is safer but I do not know if it is
>> portable.
>>
>> Or xargs but we need to fork for each file and we get the portability
>> problem of find print0.
>>
>> What do you prefer ?
>
> find -print0 is fine, dpkg-deb already uses it.
> read -d is likely a problem however (I believe it's bash specific).
>
> I don't think that I have any good answer if we want to support newlines
> in filenames. But it's probably not an important use case as dpkg itself
> doesn't cope very well with it. dpkg-deb builds it fine and it installs
> fine but when you do "dpkg -L" you get this back (with a single
> "hello\nworld" file):
> $ dpkg -L foo
> /.
> /hello
> /world
>
> (This is because the /var/lib/dpkg/info/*.list files are line based)
>
> So I would go ahead ignoring this specific problem. Otherwise you could
> write that specific part in perl but it would be a regression to reintroduce
> perl in dpkg itself.
>
> Cheers,
> --
> Raphaël Hertzog ◈ Debian Developer
>
> Discover the Debian Administrator's Handbook:
> → http://debian-handbook.info/get/



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Sat, 24 Aug 2013 17:39:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 24 Aug 2013 17:39:07 GMT) Full text and rfc822 format available.

Message #118 received at 583585@bugs.debian.org (full text, mbox):

From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: 583585@bugs.debian.org
Subject: Fwd: Bug#583585: [dpkg] Any news ?
Date: Sat, 24 Aug 2013 19:37:02 +0200
control: clone -1 -2
control: retitle -1 "Handle in dpkg-maintscript-helper symlink to dir
conversion"
control: retitle -2 "Handle in dpkg-maintscript-helper dir to symlink
conversion"
control: tags -1 - patch
control: tags -2 + patch
control: tags -2 + confirmed

On Sat, Aug 24, 2013 at 12:37 PM, Guillem Jover <guillem@debian.org> wrote:
> Hi!
>
> On Tue, 2013-08-20 at 21:50:59 +0200, Bastien ROUCARIES wrote:
>> Now that symlink to dir is implemented, how can we implement the
>> reverse operation ?
>>
>> I suppose checking that the:
>> - path is a directory,
>> - if LAST version is lesser
>
> Replacing a directory to a symlink is very problematic and has lots of
> failure modes, replacing a symlink with a directory is trivial in
> comparison. I'll comment further later today.

Could you publish your change to public git tree ?

I consider the dir to symlink case as finished so I have cloned the
bug, and we could fix it in changelog.

Bastien
>
> Thanks,
> Guillem



Bug 583585 cloned as bug 720712 Request was from Bastien ROUCARIES <roucaries.bastien@gmail.com> to 583585-submit@bugs.debian.org. (Sat, 24 Aug 2013 17:39:07 GMT) Full text and rfc822 format available.

Changed Bug title to '"Handle in dpkg-maintscript-helper symlink to dir' from 'dpkg-maintscript-helper: replace a dir with a symlink and vice-versa' Request was from Bastien ROUCARIES <roucaries.bastien@gmail.com> to 583585-submit@bugs.debian.org. (Sat, 24 Aug 2013 17:39:12 GMT) Full text and rfc822 format available.

Changed Bug title to 'handle in dpkg-maintscript-helper dir to symlink' from '"Handle in dpkg-maintscript-helper symlink to dir' Request was from bastien ROUCARIES <roucaries.bastien@gmail.com> to control@bugs.debian.org. (Sat, 24 Aug 2013 17:48:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Sat, 24 Aug 2013 20:57:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 24 Aug 2013 20:57:04 GMT) Full text and rfc822 format available.

Message #129 received at 583585@bugs.debian.org (full text, mbox):

From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: Raphael Hertzog <hertzog@debian.org>
Cc: 583585@bugs.debian.org
Subject: Re: Bug#583585: Fwd: Bug#583585: [dpkg] Any news ?
Date: Sat, 24 Aug 2013 22:54:25 +0200
On Sat, Aug 24, 2013 at 11:38 AM, Raphael Hertzog <hertzog@debian.org> wrote:
> On Fri, 23 Aug 2013, Bastien ROUCARIES wrote:
>> Find -print0
>>
>> And replacing read by read -r -d $'\0' is safer but I do not know if it is
>> portable.
>>
>> Or xargs but we need to fork for each file and we get the portability
>> problem of find print0.
>>
>> What do you prefer ?
>
> find -print0 is fine, dpkg-deb already uses it.
> read -d is likely a problem however (I believe it's bash specific).
>
> I don't think that I have any good answer if we want to support newlines
> in filenames. But it's probably not an important use case as dpkg itself
> doesn't cope very well with it. dpkg-deb builds it fine and it installs
> fine but when you do "dpkg -L" you get this back (with a single
> "hello\nworld" file):
> $ dpkg -L foo
> /.
> /hello
> /world
>
> (This is because the /var/lib/dpkg/info/*.list files are line based)
>
> So I would go ahead ignoring this specific problem. Otherwise you could
> write that specific part in perl but it would be a regression to reintroduce
> perl in dpkg itself.

Could we open a bug report about this ? I have an idea for improving
this kind of problem and it will help me.

Instead of begining the .list with /. we could begin with /./. and
thus encode a .list file version.

Bastien
>
> Cheers,
> --
> Raphaël Hertzog ◈ Debian Developer
>
> Discover the Debian Administrator's Handbook:
> → http://debian-handbook.info/get/



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Sat, 24 Aug 2013 23:30:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guillem Jover <guillem@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sat, 24 Aug 2013 23:30:04 GMT) Full text and rfc822 format available.

Message #134 received at 583585@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: Bastien ROUCARIES <roucaries.bastien@gmail.com>, 583585@bugs.debian.org
Subject: Re: Bug#583585: Fwd: Bug#583585: [dpkg] Any news ?
Date: Sun, 25 Aug 2013 01:27:00 +0200
On Sat, 2013-08-24 at 22:54:25 +0200, Bastien ROUCARIES wrote:
> Could we open a bug report about this ? I have an idea for improving
> this kind of problem and it will help me.

Not really, I'd most probably tag it wontfix and close it after a bit.

There's so many things in the Debian packaging toolchain that assume
no system files contain newlines, that correctly supporting them would
break tons of stuff. They could get octal escaped for example (as \NNN),
but other stuff might break if it does not unescape these. I think I'll
be changing dpkg to reject paths with newlines in them instead.

Why would you need system paths to contain newlines anyway?

> Instead of begining the .list with /. we could begin with /./. and
> thus encode a .list file version.

The infodb already contains a format version file. But I don't really
see the point in supporting this.

Thanks,
Guillem



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Sun, 25 Aug 2013 14:54:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Sun, 25 Aug 2013 14:54:09 GMT) Full text and rfc822 format available.

Message #139 received at 583585@bugs.debian.org (full text, mbox):

From: bastien ROUCARIES <roucaries.bastien@gmail.com>
To: 583585@bugs.debian.org
Subject: Something like the following code snippet ?
Date: Sun, 25 Aug 2013 16:50:50 +0200
ok so I have maybe found something workable in shell code, but it will be nice to have dpkg support for some operation:
- stat is not a portable posix command, i could emulate with some creative thinking with ls -1 -l but it will be not so portable
- cmp is posix but is part of diffutils does it means we need to push to essential ?


Bastien


##
## Functions to convert a dir to a symlink
##
dir_to_symlink() {
       local OLDDIR="$1"
       local SYMLINK_TARGET="$2"
       local LASTVERSION="$3"
       if [ "$LASTVERSION" = "--" ]; then
	        LASTVERSION=""
		PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
       fi
       if [ "$PACKAGE" = "--" -o -z "$PACKAGE" ]; then
		PACKAGE="$DPKG_MAINTSCRIPT_PACKAGE${DPKG_MAINTSCRIPT_ARCH:+:$DPKG_MAINTSCRIPT_ARCH}"
       fi
    
       # Skip remaining parameters up to --
       while [ "$1" != "--" -a $# -gt 0 ]; do shift; done
       [ $# -gt 0 ] || badusage
       shift

       [ -n "OLDDIR" ] || error "directory to be remplaced parameter is missing"
       [ -n "SYMLINK_TARGET" ] || "symlink target is missing"
       [ -n "LASTVERSION" ] || "Last version is missing"
       [ -n "$1" ] || error "maintainer script parameters are missing"
       [ -n "$DPKG_MAINTSCRIPT_NAME" ] || \
               error "environment variable DPKG_MAINTSCRIPT_NAME is required"

       debug "Executing $0 dir_to_symlink in $DPKG_MAINTSCRIPT_NAME" \
             "of $DPKG_MAINTSCRIPT_PACKAGE"
       debug "OLDDIR=$OLDDIR -> $SYMLINK_TARGET " \
             "LASTVERSION=$LASTVERSION ACTION=$1 PARAM=$2"

       case "$DPKG_MAINTSCRIPT_NAME" in
       preinst)
               if [ "$1" = "install" -o "$1" = "upgrade" ] && 
                   [ -n "$2" ] && [ -d "$OLDDIR" ] &&
                   dpkg --compare-versions "$2" le-nl "$LASTVERSION" ; then
                       mv -f "$OLDDIR" "$OLDDIR.dpkg-backup"
		       ln -s "$OLDDIR.dpkg-backup" "$OLDDIR" 
               fi
               ;;
       postinst)
               if [ "$1" = "configure" ] && [ -d "$OLDDIR.dpkg-backup" ] &&
                   dpkg --compare-versions "$2" le-nl "$LASTVERSION" ; then
                       # fast path try to remove the dir if empty
		       if rmdir "$OLDDIR.dpkg-backup" 2>/dev/null; then
			   debug "Removing empty $OLDDIR"
		       else
			   # XXXX: if find -print0 is supported xargs -0 is also supported
			   if find "$OLDDIR.dpkg-backup" -print0 | \
			       xargs -n2 -0 dpkg-maintscript-helper internal_dir_to_symlink_mv "$OLDDIR.dpkg-backup" "$SYMLINK"; then
			       # delete dpkg-backup save only if we have not found problems: this command line is portable to posix shell
			       find "$OLDDIR.dpkg-backup" -depth -print0 | xargs -0 -n 1 rm -f ;
			   fi
		       fi
		       
               fi
               ;;
       postrm)
               if [ "$1" = "purge" ] ; then 
		   if [ -d "$OLDDIR.dpkg-backup" ]; then
                       rm -rf "$OLDDIR.dpkg-backup"
		   fi
		   # XXXXX : not sure about this
		   if [ -h "$OLDDIR" ] ; then 
		       rm -f $OLDDIR
		   fi
               fi
	       # XXXXX: should read the link ? Any other condition ?
               if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] && 
                   [ -n "$2" ] && [ -d "$OLDDIR.dpkg-backup" ] &&
                   dpkg --compare-versions "$2" le-nl "$LASTVERSION"; then
                       echo "Reinstalling $OLDDIR that was moved away"
		       rm -rf $OLDDIR
                       mv "$OLDDIR.dpkg-backup" "$OLDDIR"
               fi
               ;;
       *)
               debug "$0 symlink_to_dir not required in $DPKG_MAINTSCRIPT_NAME"
               ;;
       esac
}

#
# internal ln then cp if it fail
# 
# NOTE: because we run command from find directory are always defined
# XXXX: what to do with xattr ????
ln_like() {
    local TARGET="$1"
    local NAME="$2"
    local MODE=''
    local UID=''
    local GID=''

    # hard link to symlink are implementation defined so cp
    if test -h "$TARGET"; then 
	# XXXX: what about xattr ?
	cp -P -p "$TARGET" "$NAME"
	return $?
    fi
    # XXXX: check failure
    if test -d "$TARGET"; then
	# XXXX: what about selinux context....
	mkdir -p "$NAME" 2> /dev/null > /dev/null;
	# change modification/atime
	touch -a -m -r "$TARGET" "$NAME" 2> /dev/null > /dev/null;
	# XXXX: stat is not portable 
	MODE=$(stat -c '0%a'"$TARGET")
	UID=$(stat -c '%U' "$TARGET")
	GID=$(stat -c '%G' "$TARGET")
	
	chmod "$MODE" "$TARGET"
	# note: according to posix user id and not number are prefered
	chown "$UID:$GID" "$TARGET"
	# XXXX: what about selinux context/xattr....
	# XXXX: return failure in case of failure
	return 0
    fi

    # normal file/fifo/bdev/cdev first link then copy
    if ln "$TARGET" "$NAME"; then
	return 0;
    else
	# XXXX: what about xattr ?
	if cp -P -p "$TARGET" "$NAME"; then 
	    return 0;
	else
	    return $?;
	fi
    fi
}

# check if file are sames
files_are_same() {
    local TARGET="$1"
    local NAME="$2"

    # XXXXX: stat is not portable
    if test $(stat -c '%A' "$NAME") != $(stat -c '%A' "$TARGET"); then
	warning "$NAME and $TARGET are not of same type or same mode";
	return 1;
    fi;
    
    if test $(stat -c '%U' "$NAME") != (stat -c '%U' "$TARGET"); then
	warning "$NAME and $TARGET have not the same ownner";
	return 2;
    fi;

    if test $(stat -c '%G' "$NAME") != (stat -c '%G' "$TARGET"); then
	warning "$NAME and $TARGET have not the group ownner";
	return 3;	
    fi;
   
    if test $(stat -c '%s' "$NAME") != (stat -c '%s' "$TARGET");
	warning "$NAME and $TARGET are differents: size are differents";
	return 4;
    fi;
    
    # XXXX: cmp is not portable
    if cmp -s "$NAME" "$TARGET";
	debug "file are identical do not override"
	return 0;
    else
	warning "$NAME and $TARGET are differents."
	return 5;
    fi;
}

##
## internal move of user file
##
internal_dir_to_symlink_mv() {
    local OLDDIR="$1"
    local SYMLINK="$2"
    local THIS="$3"
    local REL=''
    local SEDPREFIX=''
    local FULLSYMLINK=''

    # xargs could send empty args and -r is a gnu extension : if empty ok
    if test x"$THIS" = "x"; then
	return 0;
    fi

    # relative ./ is always ignored
    if test x"$THIS" = x"$OLDDIR"; then
	return 0;
    fi

    # According to autoconf manual "Limitations of Shell Builtins" ! is not always well supported
    if test -d "$3" ; then 
	:; 
    else 
	debug "error out if ..."
        # XXXX: here we should test if the file belong to another package and error out
    fi

    # escape dangerous path for sed
    SEDPREFIX=$(printf "%s" "$OLDDIR" | sed -e 's/[]\/()$*.^|[]/\\&/g')

    # note that we apply only to the first line in order to be safe in case of user path including \n
    # note that $OLDDIR is \n safe because dpkg forbid this kind of path
    # note EOF is order to not mangle trailing newline : I hate sh
    REL=$(printf '%sEOF' "$THIS" | sed -e "1 s/^$SEDPREFIX\/*//g")
    REL="${REL%EOF}"

    FULLSYMLINK="$SYMLINK/$REL"
    
    # test if we override file
    if test -e "$FULLSYMLINK"; then
	if files_are_same "$THIS" "$FULLSYMLINK"; then
	    return 0;
	else
	    return 1;
	fi;
    else
	# easy case files does not exist
 	if ln_like "$THIS" "$FULLSYMLINK"; then
	    return 0;
	else
	    local ERR="$?"
	    warning "fail to link/copy existing file $THIS"
	    return ERR;
	fi
    fi
}



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Mon, 26 Aug 2013 02:39:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guillem Jover <guillem@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Mon, 26 Aug 2013 02:39:04 GMT) Full text and rfc822 format available.

Message #144 received at 583585@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: bastien ROUCARIES <roucaries.bastien@gmail.com>, 583585@bugs.debian.org
Subject: Re: Bug#583585: Something like the following code snippet ?
Date: Mon, 26 Aug 2013 04:34:45 +0200
On Sun, 2013-08-25 at 16:50:50 +0200, bastien ROUCARIES wrote:
> ok so I have maybe found something workable in shell code, but it will
> be nice to have dpkg support for some operation:
> - stat is not a portable posix command, i could emulate with some
>   creative thinking with ls -1 -l but it will be not so portable
> - cmp is posix but is part of diffutils does it means we need to
>   push to essential ?

Hmm, the code is is overly complex, it has some of the same problems
as the other function and it does not really handle the switch correctly.

The files must not be moved from the old dir to the new symlink-to-dir,
otherwise dpkg will lose track of them wrt to their canonical path, and
because it does not know there might be several references to those same
files it might remove them at the wrong time. This avoids any need for
comparisons, stats and similar. We also need a temporary symlink to the
old dir so that dpkg can properly remove any old files after unpack.

I went ahead and implemented this command, because once having gone
over the failure modes, it was easier to just code it down. I'll be
doing some polishing and testing tomorrow, to be included in an
imminent push.

Thanks,
Guillem



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Mon, 26 Aug 2013 06:57:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Mon, 26 Aug 2013 06:57:04 GMT) Full text and rfc822 format available.

Message #149 received at 583585@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Guillem Jover <guillem@debian.org>, 583585@bugs.debian.org
Cc: bastien ROUCARIES <roucaries.bastien@gmail.com>
Subject: Re: Bug#583585: Something like the following code snippet ?
Date: Mon, 26 Aug 2013 08:56:09 +0200
Hi,

On Mon, 26 Aug 2013, Guillem Jover wrote:
> The files must not be moved from the old dir to the new symlink-to-dir,
> otherwise dpkg will lose track of them wrt to their canonical path, and

And what about files which are not managed by dpkg?
And files of other packages which are not upgraded at the same time?

I believe that the files which are left-over at the end (i.e. after dpkg
has cleaned up the tree due to the temporary symlink) should be put back
in place when there's no conflicting file (they could also have been
installed by other packages wich were not yet updated to not use the
symlinked directory).

> I went ahead and implemented this command, because once having gone
> over the failure modes, it was easier to just code it down. I'll be
> doing some polishing and testing tomorrow, to be included in an
> imminent push.

Usual practice would be to attach the patch so that others can review
too...

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

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



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#583585; Package dpkg. (Mon, 02 Sep 2013 10:21:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bastien ROUCARIES <roucaries.bastien@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Mon, 02 Sep 2013 10:21:05 GMT) Full text and rfc822 format available.

Message #154 received at 583585@bugs.debian.org (full text, mbox):

From: Bastien ROUCARIES <roucaries.bastien@gmail.com>
To: Raphael Hertzog <hertzog@debian.org>
Cc: Guillem Jover <guillem@debian.org>, 583585@bugs.debian.org
Subject: Re: Bug#583585: Something like the following code snippet ?
Date: Mon, 2 Sep 2013 12:16:24 +0200
On Mon, Aug 26, 2013 at 8:56 AM, Raphael Hertzog <hertzog@debian.org> wrote:
> Hi,
>
> On Mon, 26 Aug 2013, Guillem Jover wrote:
>> The files must not be moved from the old dir to the new symlink-to-dir,
>> otherwise dpkg will lose track of them wrt to their canonical path, and
>
> And what about files which are not managed by dpkg?
> And files of other packages which are not upgraded at the same time?
>
> I believe that the files which are left-over at the end (i.e. after dpkg
> has cleaned up the tree due to the temporary symlink) should be put back
> in place when there's no conflicting file (they could also have been
> installed by other packages wich were not yet updated to not use the
> symlinked directory).
>
>> I went ahead and implemented this command, because once having gone
>> over the failure modes, it was easier to just code it down. I'll be
>> doing some polishing and testing tomorrow, to be included in an
>> imminent push.
>
> Usual practice would be to attach the patch so that others can review
> too...
>
> Cheers,

Any news of this bug ?
> --
> Raphaël Hertzog ◈ Debian Developer
>
> Discover the Debian Administrator's Handbook:
> → http://debian-handbook.info/get/



Added tag(s) pending. Request was from Guillem Jover <guillem@debian.org> to control@bugs.debian.org. (Fri, 01 Nov 2013 05:57:11 GMT) Full text and rfc822 format available.

Message sent on to Raphael Hertzog <hertzog@debian.org>:
Bug#583585. (Fri, 01 Nov 2013 05:57:15 GMT) Full text and rfc822 format available.

Message #159 received at 583585-submitter@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: 583585-submitter@bugs.debian.org
Subject: Bug#583585 marked as pending
Date: Fri, 01 Nov 2013 05:55:30 +0000
tag 583585 pending
thanks

Hello,

Bug #583585 reported by you has been fixed in the Git repository. You can
see the changelog below, and you can check the diff of the fix at:

    http://git.debian.org/?p=dpkg/dpkg.git;a=commitdiff;h=4b870bc

---
commit 4b870bcc52bb1c4c8c1a333fadb31329d4794232
Author: Guillem Jover <guillem@debian.org>
Date:   Mon Aug 26 04:17:19 2013 +0200

    dpkg-maintscript-helper: Add new dir_to_symlink command
    
    Closes: #583585

diff --git a/debian/changelog b/debian/changelog
index 6b63587..b420e30 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -81,6 +81,7 @@ dpkg (1.17.2) UNRELEASED; urgency=low
     we might get us to read garbage from memory or segfault.
   * Add new symlink_to_dir command to dpkg-maintscript-helper. Closes: #720712
     Based on a patch by Bastien ROUCARIÈS <roucaries.bastien@gmail.com>.
+  * Add new dir_to_symlink command to dpkg-maintscript-helper. Closes: #583585
 
   [ Updated programs translations ]
   * German (Sven Joachim).



Reply sent to Guillem Jover <guillem@debian.org>:
You have taken responsibility. (Thu, 05 Dec 2013 06:06:19 GMT) Full text and rfc822 format available.

Notification sent to Raphael Hertzog <hertzog@debian.org>:
Bug acknowledged by developer. (Thu, 05 Dec 2013 06:06:19 GMT) Full text and rfc822 format available.

Message #164 received at 583585-close@bugs.debian.org (full text, mbox):

From: Guillem Jover <guillem@debian.org>
To: 583585-close@bugs.debian.org
Subject: Bug#583585: fixed in dpkg 1.17.2
Date: Thu, 05 Dec 2013 06:03:48 +0000
Source: dpkg
Source-Version: 1.17.2

We believe that the bug you reported is fixed in the latest version of
dpkg, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 583585@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guillem Jover <guillem@debian.org> (supplier of updated dpkg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 05 Dec 2013 04:56:31 +0100
Source: dpkg
Binary: libdpkg-dev dpkg dpkg-dev libdpkg-perl dselect
Architecture: source amd64 all
Version: 1.17.2
Distribution: unstable
Urgency: low
Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
Changed-By: Guillem Jover <guillem@debian.org>
Description: 
 dpkg       - Debian package management system
 dpkg-dev   - Debian package development tools
 dselect    - Debian package management front-end
 libdpkg-dev - Debian package management static library
 libdpkg-perl - Dpkg perl modules
Closes: 32427 71106 143307 187019 257505 583585 615813 661538 667008 681370 717983 718437 718541 718899 718945 719418 719746 719844 720712 725437 726112 726932 729874
Changes: 
 dpkg (1.17.2) unstable; urgency=low
 .
   [ Guillem Jover ]
   * Make Dpkg::Arch debwildcard_to_debtriplet() more robust by matching
     on exact 'any' strings, instead of substrings.
   * Add manpages-it Replaces to dselect and dpkg-dev. Closes: #717983
     Reported by Andreas Beckmann <anbe@debian.org>.
   * Document default dpkg-deb compressor change to xz in man page.
     Thanks to Salvatore Bonaccorso <carnil@debian.org>. Closes: #718437
   * Version manpages-it in Replaces with (<< 2.80-4), now that the package
     does not ship the overlapping paths any more.
   * Automatically prepend needed spaces for continuation --force-help lines.
   * Be more precise on deb format errors with data member in dpkg-deb.
   * Do not allow deb packages with control and data members swapped.
   * Clarify «dpkg-deb --extract» bad usage error message on missing arguments
     by printing all required arguments at once. Closes: #718899
   * Clarify the insertion order of _ members in deb(5) man page.
   * Fix use after free in alternative_parse_fileset() on update-alternatives.
     Reported by Pedro Ribeiro <pedrib@gmail.com>.
   * Fix use after free in dpkg_arch_load_list() on libdpkg.
     Reported by Pedro Ribeiro <pedrib@gmail.com>.
   * Fix theoretical stack buffer overflow in w_dependency() on libdpkg, not
     currently applicable. Reported by Pedro Ribeiro <pedrib@gmail.com>.
   * Add ppc64el support to cputable. Closes: #718945
     Thanks to Jeff Bailey <jeffbailey@google.com>.
   * Use dpkg-gencontrol -c argument as a fallback lock file in case
     debian/control does not exist. Closes: #667008
   * Pass the package reference count (i.e. number of present instances) to
     maintainer scripts via the new variable DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT.
     Closes: #681370
   * Fix field names on error messages in libdpkg, by either capitalizing them
     or by renaming them to match reality.
   * Do not capitalize error and warning messages.
   * When ignoring invalid remove requests in dpkg consider that progress,
     reset the loop detector and avoid the assert. Closes: #143307
   * Activate all path components for file triggers on removal.
     Regression introduced in 1.17.0. Closes: #725437
   * Activate file triggers on disappearance more accurately, only when we know
     we are inevitably removing things.
   * Fix «dpkg-query --list» output when using multibyte character strings,
     to avoid unaligned columns and mojibake. Closes: #257505, #718541
     Based on a patch by Changwoo Ryu <cwryu@debian.org>.
   * Use fully buffered output on non-tty stdout.
     Reported by Shawn Landden <shawnlandden@gmail.com>.
   * Recognize «start-stop-daemon -C» as documented. Closes: #719746
     Reported by Brian S. Julin <bri@abrij.org>.
   * When update-alternatives is told to change slave links, do not warn that
     the link group is broken, just print a notice that the alternative is
     being updated due to the changes.
   * Add a new «dpkg --verify» command to check the integrity of packages
     installed files. Add a --verify-format option to excplicitly select the
     output format, currently only rpm compatible output is supported, but
     the default might change in the future. Closes: #187019
   * Improve dpkg “Preparing to replace” and “Unpacking” progress messages.
     Closes: #32427, #71106
   * Print the package version on main dpkg progress messages.
   * Do not store timestamps in gzip headers when using the command, to try to
     mimic the zlib behavior. This does not affect Debian as it's been using
     zlib for a very long time. Closes: #719844
   * Reset environment variables affecting compressor commands when not using
     the shared library implementations. Namely XZ_DEFAULTS, XZ_OPT, BZIP and
     BZIP2.
   * Use a simple list to track packages owning a file, instead of using a
     list of arrays of pointers which waste 10 pointers per non-shared file,
     instead of 1. This significantly reduces dpkg memory usage.
   * Honor new DEB_SIGN_KEYID environment variable in dpkg-buildpackage.
     Suggested by Harald Dunkel <harri@afaics.de>. Closes: #615813, #719418
   * Always check subprocess exit codes in Dpkg::Source::Package modules.
     Reported by Ian Jackson <ijackson@chiark.greenend.org.uk>.
   * Add support for pie and stack-protector options to dpkg-buildflags FFLAGS,
     and update the man page to mention FFLAGS are a subset of CFLAGS.
     Closes: #726932
   * Improve and unify -O option handling in dpkg-genchanges, dpkg-gensymbols
     and dpkg-shlibdeps, by always taking an optional filename argument and
     describing in the man page the default output files.
   * Use “hyphen” instead of “dash” when we mean the ‘-’ character in the
     documentation and code comments.
   * Do not NULL-terminate the list in the compat scandir(), as this might
     cause a segfault in case the function returns 0 entries.
   * Always return from ensure_statoverrides() if file is NULL, otherwise
     we might get us to read garbage from memory or segfault.
   * Add new symlink_to_dir command to dpkg-maintscript-helper. Closes: #720712
     Based on a patch by Bastien ROUCARIÈS <roucaries.bastien@gmail.com>.
   * Add new dir_to_symlink command to dpkg-maintscript-helper. Closes: #583585
   * Distinguish dpkg error reports between errors while processing packages
     and archives.
   * Fix crashes in the first call to gettext() after fork() on Mac OS X, by
     forcing the initialization at program start of the CoreFoundation cached
     values in libintl.
   * Set a default gettext domain for libdpkg code, so that other programs
     using a different domain can still get correct translations, like dselect.
   * Cleanup libdpkg-perl API:
     - Dpkg::Compression: Deprecate $default_compression_level,
       $default_compression and $compression_re_file_ext package variables.
     - Dpkg::Exit: Deprecate @handlers package variable.
     - Dpkg::Source::Package: Deprecate $diff_ignore_default_regexp and
       @tar_ignore_default_pattern package variables.
     - Dpkg::Changelog::Entry::Debian: Deprecate $regex_header and
       $regex_trailer package variables.
   * Add GnuPG 2.x support. Add gnupg2 and gpgv2 as alternative Recommends to
     gnupg and gpgv (to not pull them by default), but prefer gpgv2 over gpgv,
     and gpg2 over gpg at run-time if they are available.
   * Switch dpkg conflictor tracking from a fixed-size array to a queue,
     fixing several related issues, due to conflictors not being removed from
     the array after processing them. dpkg could fill it due to additions in
     previous package processing producing very confusing error messages; and
     a theoretical problem where a package could get appended to be removed,
     then reinstalled as a new version, to get removed again when revisiting
     the array in a subsequent package processing. Closes: #726112
   * Do not accept empty field names in dpkg.
   * Do not accept an initial hyphen in field names.
   * Add experimental build profiles support:
     - Add support for <!profile.name> build-time restrictions in dependencies.
     - Add support for DEB_BUILD_PROFILES environment variable.
     - Add new option -P to dpkg-buildpackage and dpkg-checbuilddeps.
     - Add new Built-For-Profiles output field in .deb and .changes files.
     Based on a patch by Patrick "P. J." McDermott <pjm@nac.net>,
     Wookey <wookey@debian.org> and Johannes Schauer <j.schauer@email.de>.
     Closes: #661538
   * Bump Standards-Version to 3.9.5.
   * Document interactions of dpkg-source --extend-diff-ignore and -i in the
     man page. Closes: #729874
 .
   [ Updated programs translations ]
   * German (Sven Joachim).
   * Vietnamese (Trần Ngọc Quân).
 .
   [ Updated scripts translations ]
   * German (Helge Kreutzmann).
 .
   [ Updated manpages translations ]
   * French (Christian Perrier): fix incorrectly translated sentence,
     thanks to Fabien Givors.
   * German (Helge Kreutzmann).
Checksums-Sha1: 
 c4f7042c038c3174f6f170e359d59e167788fe03 2005 dpkg_1.17.2.dsc
 ef6d6e3dba5be41b86e1befe1cf86b51adaaaf36 3829700 dpkg_1.17.2.tar.xz
 df8f5ee146fad7af246f627e7f9a338e89e219f8 735532 libdpkg-dev_1.17.2_amd64.deb
 d66336876dd4aac3caa2d2f27a5742f40dc48d4c 2599582 dpkg_1.17.2_amd64.deb
 5391ca8e435ac4c9a9e5e3f4f599e6d0ddfa0ff2 995850 dselect_1.17.2_amd64.deb
 b2ba52087ebbac112b4a2c63700e79e5d91928cb 1376728 dpkg-dev_1.17.2_all.deb
 25356eba113913a90863be668cdf24f2625896a0 905766 libdpkg-perl_1.17.2_all.deb
Checksums-Sha256: 
 c99d474673f45a85156dcdc3173d899ef6decbfead599b87026000770538239f 2005 dpkg_1.17.2.dsc
 0a1c2b4d7a5a485b53263448c0a6f111ca4fe5d774cddf0abd7ce02758db8650 3829700 dpkg_1.17.2.tar.xz
 6812d5ea71c7ba237452589eb81a14ab10fd16e456ebc761063b20c71f61cd35 735532 libdpkg-dev_1.17.2_amd64.deb
 1f667dad1a22f215c762efaaf2d4dc2c3db0c5c61f1bc6982785a6a9b3edc4b9 2599582 dpkg_1.17.2_amd64.deb
 f5cd2208024a044b2c40f3e78ea592f0da312203524d282b79c6f0113ba4e103 995850 dselect_1.17.2_amd64.deb
 ba5198eec4b67ba616197493fc7a143c2a0781910436b49c13003350fae72788 1376728 dpkg-dev_1.17.2_all.deb
 b660b588f508c5a066dd6d995c805bf8896085bb182280343400bae5198b1f25 905766 libdpkg-perl_1.17.2_all.deb
Files: 
 c53e4ebc6dbcde14397a060c1357e569 2005 admin required dpkg_1.17.2.dsc
 35d42dac927d31152a22f50637994d51 3829700 admin required dpkg_1.17.2.tar.xz
 aa991c285663d59e84fa8642bd548ff3 735532 libdevel optional libdpkg-dev_1.17.2_amd64.deb
 3ed7cbafd833e43648984871bb090d05 2599582 admin required dpkg_1.17.2_amd64.deb
 411f6bda343a2df4e7d630b03b99140a 995850 admin optional dselect_1.17.2_amd64.deb
 6c36f5b1450d965afe038b5577730c44 1376728 utils optional dpkg-dev_1.17.2_all.deb
 28900795bce285bf30a5f2f917a271b9 905766 perl optional libdpkg-perl_1.17.2_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)

iQIcBAEBCAAGBQJSoAcoAAoJELlyvz6krlejSNwQAOSerUBsifpUSSPK0rc4YB4E
knkRqIcEEiWmjYKddLHS58fy7h6AXPz/OO55+iiN093eDSaDF1KSM4HT7k2Ev8sq
r7n4MNCLHyVajM/mnvIYnihbm/jJZmHkGmBMLmirsJTY7mpopLE+BRI8QFXb0fiJ
oawlPspvQcs5bFvZUiUxuSyWGhuYs+TIP+3+rMEX0Xe4+//N577lmO8GEUOnBMVf
7jqxn02yAvqE/pIv208WFWW+Go3B/7jhudOeDBPoHIf3JyxMQhSkFEccSYUM+yXB
mvNOi44hrhG9w7J1tQEuMHXqnPmSIp87bcoqTCFGjuDqRJNHM/fTCJuYsYSFbNDl
MlxLqN6Oq0AmWEiakrPYHBgJR5LZDhCMohOlbp4D7GW3wtjz4Z4uddXq4xL8aItE
o+rl44J86iOqwBCkZ/iQYFaIirjosl5souso3AOsg2igumrkdB0y1q1HeKUjtXma
k4byEj0FEpwh03HAbABQv3LDm4UKwL7QF9D8gDZ5emCGH9JbuHFeO+N/6yB9LS+A
rHa1bedUbfLoBiWtBx+eTGfSCLBj0U9mI2MuEusItvR9xsC+KuCnt4sIRwpwuymt
GF8yqMw0FMSDa6Aavcn0U9EPYS+vPtSiV23CKljP5kI8DHSVxUGbto3pkfbtGqtg
sw0ZOWT/NClNjVfpezTY
=5lAo
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 03 Jan 2014 07:31:30 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 03:12:27 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.