Re: Issues with Multi-Arch:same packages on purge
On Mon, 2013-04-22 at 19:06:52 +0200, Michael Biebl wrote:
> Am 22.04.2013 17:24, schrieb Guillem Jover:
> > Other problems might be when maintainer scripts use the running dpkg
> > architecture instead of the package architecture (DPKG_MAINTSCRIPT_ARCH)
> > to decide when to do stuff, for example in libglib2.0-0.postrm.
> I do think we handle all cases correctly now. If you see any issues,
> please let us know.
The following snippet seems suspect, although not a big issue anyway
as it's just removing a cache file, although it might leave files
behind on remove/purge:
,---
if [ -d /usr/lib/gio/modules ]; then
# Purge the cache
if [ $(dpkg --print-architecture) = amd64 ]; then
rm -f /usr/lib/gio/modules/giomodule.cache
rmdir -p --ignore-fail-on-non-empty /usr/lib/gio/modules
fi
fi
`---
The running architecture of dpkg is irrelevant, you want to check
against the package architecture set by dpkg as the environment
variable DPKG_MAINTSCRIPT_ARCH. Because you could have installed
libglib2.0-0:arm64 and libglib2.0-0:i386 on a native amd64 and the
architecture will never match.
But then, in that case, the whole check would be unnecessary, because
DPKG_MAINTSCRIPT_ARCH should always match the package architecture
replaced at build time; instead the package should only remove these
when there's no other package instances left, regardless of the package
architecture. Either that or I misunderstood the purpose of that code. :)
(Unrelated but, why are those cache files not under /var/cache/ instead?)
Thanks,
Guillem
Reply to: