Control: tags + moreinfo

Hi!

On Mon, 2016-01-18 at 03:04:55 +0100, Guillem Jover wrote:
> On Sun, 2016-01-17 at 18:37:50 +0100, Marc Haber wrote:
> > On Sun, Jan 17, 2016 at 05:27:06PM +0100, Guillem Jover wrote:
> > > Actually, in this case given how the filters work, ideally, the exclusion
> > > should be ignored. What you actually requested was:
> > > 
> > >   exclude /usr/share/zoneinfo
> > >   include /usr/share/zoneinfo/*
> > 
> > Why?
> 
> Because these filters have side effects in contrast to find filters
> for example, and they are used on "streamed data". In dpkg, the filters
> have no knowledge of what type of objects they are filtering, so you
> specify a pathname that might be a directory or a file or a symlink,
> etc. And once the file is being unpacked, it only knows about the
> current pathname, and not if subsequent entries will also need this one
> or not. At that point dpkg has to decide if it unpacks the pathname or
> not, w/o further visibility. Making dpkg aware of futher objects would
> imply that it needs to do a two-pass over the .deb package to know the
> full contents of it, instead of unpacking on the fly.

I've now tried to clarify this in my local tree, I'm attaching the patch.

> > However, excluding both leads to the second problem:
> > 
> > root@fan:/# dpkg --install --path-exclude='/usr/share/zoneinfo' 
> > --path-exclude='/usr/share/zoneinfo/*' 
> > /var/cache/apt/archives/tzdata_2015g-1_all.deb
> > (Reading database ... 9271 files and directories currently installed.)
> > Preparing to unpack .../tzdata_2015g-1_all.deb ...
> > Unpacking tzdata (2015g-1) over (2015g-1) ...
> > dpkg: error processing archive 
> > /var/cache/apt/archives/tzdata_2015g-1_all.deb (--install):
> >  error creating directory './usr/share/zoneinfo/right/Etc': No such file or 
> > directory
> > dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
> > Errors were encountered while processing:
> >  /var/cache/apt/archives/tzdata_2015g-1_all.deb
> > root@fan:/#
> > 
> > dpkg should not try to unpack files in a directory that was excluded.
> 
> Yes, it should, and that's what's supposed to happen. Here's a session
> on my system:
> 
> ,---
> # rm -rf /usr/share/zoneinfo
> # ls -la /usr/share/zoneinfo
> ls: cannot access /usr/share/zoneinfo: No such file or directory
> # dpkg --path-exclude='/usr/share/zoneinfo' 
> --path-exclude='/usr/share/zoneinfo/*' --install tzdata_2015g-1_all.deb
> (Reading database ... 264026 files and directories currently installed.)
> Preparing to unpack tzdata_2015g-1_all.deb ...
> Unpacking tzdata (2015g-1) over (2015g-1) ...
> Setting up tzdata (2015g-1) ...
> 
> User defined time zone, leaving /etc/localtime unchanged.
> Local time is now:      Mon Jan 18 02:56:22 CET 2016.
> Universal Time is now:  Mon Jan 18 01:56:22 UTC 2016.
> Run 'dpkg-reconfigure tzdata' if you wish to change it.
> 
> # ls -la /usr/share/zoneinfols: cannot access /usr/share/zoneinfo: No such 
> file or directory
> #
> `---
> 
> So there's something else going on here. Could you run the above but by
> passing «-D333» to dpkg, and send the log?

I'd still welcome this information, but if it does not come before the
next release, I'll assume user-error, and close this bug with the
aforementioned patch. Of course you should feel free to open a new
report if you can reproduce the potential problem later on.

> > > I can probably add a note about this kind of situations in the man
> > > page.
> > 
> > IMO, no need for that. My bad.
> 
> I think still some things can be clarified, to avoid further
> confusion. :)

I've ended up doing this anyway.

Thanks,
Guillem
From 866badd77625323a18c2d8e62bdb5da7261ba092 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Fri, 5 Feb 2016 18:22:08 +0100
Subject: [PATCH] man: Clarify pathname filters behavior

Closes: #811267
---
 man/dpkg.1 | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/man/dpkg.1 b/man/dpkg.1
index b46bc06..05f7b47 100644
--- a/man/dpkg.1
+++ b/man/dpkg.1
@@ -699,7 +699,7 @@ starts a character class, which can contain a list of characters, ranges
 and complementations. See \fBglob\fP(7) for detailed information about
 globbing. Note: the current implementation might re-include more directories
 and symlinks than needed, to be on the safe side and avoid possible unpack
-failures, future work might fix this.
+failures; future work might fix this.
 
 This can be used to remove all paths except some particular ones; a typical
 case is:
@@ -714,6 +714,16 @@ to remove all documentation files except the copyright files.
 These two options can be specified multiple times, and interleaved with
 each other. Both are processed in the given order, with the last rule that
 matches a file name making the decision.
+
+The filters are applied when unpacking the binary packages, and as such
+only have knowledge of the type of object currently being filtered
+(e.g. a normal file or a directory) and have not visibility of what
+objects will come next.
+Because these filters have side effects (in contrast to \fBfind\fP(1)
+filters), excluding an exact pathname that happens to be a directory object
+like \fI/usr/share/doc\fP will not have the desired result, and only that
+pathname will be excluded.
+Any subsequent files contained within that directory will fail to unpack.
 .TP
 .BI \-\-verify\-format " format-name"
 Sets the output format for the \fB\-\-verify\fP command (since dpkg 1.17.2).
-- 
2.7.0.79.gdc08a19

Reply via email to