Control: severity -1 wishlist Hi!
On Sun, 2016-01-17 at 13:10:42 +0100, Marc Haber wrote: > Package: dpkg > Version: 1.18.4 > Severity: normal > I am trying to checkout the --path-exclude option of dpkg in a test > chroot by first removing /usr/share/zoneinfo and then trying to > install the tzdata package. I have found the following issues: Ok, let's see. :) > root@fan:/# dpkg --install --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): > unable to create '/usr/share/zoneinfo/leap-seconds.list.dpkg-new' (while > processing './usr/share/zoneinfo/leap-seconds.list'): 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:/# > > In this case, dpkg should not try to unpack leap-seconds.list since it > is in the excluded directory. 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/* But the filter code has no knowlegde that a specifically excluded path might be needed by some future entry (that has not been explicitly included back). If this needs fixing, it's probably in the documentation. I don't think changing the semantics (w/o much thought) would be wise at this point in time. > root@fan:/# dpkg --install --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:/# > > In this case, dpkg should not try to create the > /usr/share/zoneinfo/right/Etc directory since it is in the excluded > path. This works for me, and I cannot reproduce. Did you happen to try that with a (partially-)populated /usr/share/zoneinfo/? Try instead quoting the argument like «--path-exclude='/usr/share/zoneinfo/*'» to avoid the shell expanding the glob. > A third case needed a removed and excluded /usr/share/man: > > root@fan:/# dpkg --install --path-exclude=/usr/share/man/man1/sh.1.gz > var/cache/apt/archives/dash_0.5.7-4+b1_amd64.deb > (Reading database ... 6927 files and directories currently installed.) > Preparing to unpack .../dash_0.5.7-4+b1_amd64.deb ... > ln: failed to create symbolic link '/usr/share/man/man1/sh.1.gz.tmp': No such > file or directory > dpkg: error processing archive > var/cache/apt/archives/dash_0.5.7-4+b1_amd64.deb (--install): > subprocess new pre-installation script returned error exit status 1 > Errors were encountered while processing: > var/cache/apt/archives/dash_0.5.7-4+b1_amd64.deb > root@fan:/# > > The error message is the same regardless whether the excluded path is > /usr/share/man/man1/*, /usr/share/man/*/*, > /usr/share/man/* or /usr/share/man. In this case, dpkg should honor > excluded paths even for symlinks. That's not dpkg's fault, that's the maintainer script not coping with an excluded path. If this needs to be fixed it is in dash itself: $ dpkg-query --control-show dash preinst I can probably add a note about this kind of situations in the man page. > In any case, dpkg probably should not error out but try to create the > parent directories first. In the case of --path-exclude, dpkg should > handle excluded directories recursively, e.g. not try to create > /usr/share/zoneinfo/right/Etc if the excluded path is > /usr/share/zoneinfo/*. See above. Thanks, Guillem