From 48498443e74b2a7e089709b954c50b7df374684b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Aug 2013 18:18:15 +0200 Subject: allow Pre-Install-Pkgs hooks to get info over an FD != stdin This adds ::InfoFD option alongside the ::Version one to request sending the information to the specified FD, by default it is STDIN as it was the case before. The environment variable APT_HOOK_INFO_FD contains the FD the data is on as a confirmation that the APT version used understood the request. Allowing the hook to choose the FD is needed/helpful e.g. for shellscripts which have a hard time accessing FDs above 9 (as >= 10 are usually used internally by them) Closes: #671728 --- doc/apt.conf.5.xml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'doc/apt.conf.5.xml') diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index f5e1f966d..42119baa5 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -688,7 +688,8 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; options this must be specified in list notation. The commands are invoked in order using /bin/sh; should any fail APT will abort. APT will pass the filenames of all .deb files it is going to - install to the commands, one per line on standard input. + install to the commands, one per line on the requested file descriptor, defaulting + to standard input. Version 2 of this protocol dumps more information, including the protocol version, the APT configuration space and the packages, files @@ -700,7 +701,15 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; DPkg::Tools::options::cmd::Version accordingly, the default being version 1. If APT isn't supporting the requested version it will send the information in the highest version it has support for instead. - + + + The file descriptor to be used to send the information can be requested with + DPkg::Tools::options::cmd::InfoFD + which defaults to 0 for standard input and is available since + version 0.9.11. Support for the option can be detected by looking for the environment + variable APT_HOOK_INFO_FD which contains the number of the used + file descriptor as a confirmation. + -- cgit v1.2.3