[packagekit] [PATCH] Fix aptcc backend behaviour on Ubuntu Natty

Matthias Klumpp matthias at nlinux.org
Mon Jan 24 10:54:49 PST 2011


Hi!
Patch 0001 and 0003 look sane to me. If Daniel or Julian don't have
objections, we can apply them. (Tested here, works)
I'll apply them to the Debian packaging, as well as 0002, but I don't know
why the current LC_ALL approach is wrong...
Thanks!
  Matthias


On Mon, 24 Jan 2011 17:43:07 +0000, Colin Watson <cjwatson at ubuntu.com>
wrote:
> PackageKit's aptcc backend is quite broken on current Ubuntu Natty, and
> is resulting in lots of mysterious bug reports showing that some
> package's postinst exited non-zero, with an empty apt terminal log.
> 
>   https://bugs.launchpad.net/bugs/680328
> 
> I investigated this with strace, and it turns out that the aptcc backend
> is running apt code with no stdout - not merely duped to /dev/null, but
> closed.  This is of course bound to go wrong somewhere.  If it worked
> before, it was probably merely by chance (e.g. apt opened something
> else, which happened to land on fd 1, and didn't care what was written
> to it).  The first attached patch corrects this, and generally sanitises
> file descriptor handling.
> 
> There was also a problem with locale handling, which broke certain
> postinst scripts (the one that broke for me was python-gmenu) in any
> environment where the various locale categories are not all set to the
> same value.  There might be a few different ways to solve this (e.g.
> marshalling lots of different locale categories across to the backend);
> in the second attached patch, I opted for just using LC_MESSAGES, which
> seems to match up reasonably well with how PK is actually using the
> client locale, and is nice and simple.
> 
> Finally, the apt backend creates a pseudo-terminal so that apt can
> produce a useful /var/log/apt/term.log, but the aptcc backend doesn't.
> The third attached patch converts the input pipe to a pty.  I've
> confirmed that conffile prompt handling works to the same extent it did
> before (i.e. no useful prompt via PackageKit, but it notices the prompt
> and successfully writes "N\n" to apt).
> 
> Thanks,




More information about the PackageKit mailing list