[Yum-devel] [PATCH] Use a tempfile instead of a pipe for scriplet errors, fixes BZ 465766

Tim Lauridsen tim.lauridsen at googlemail.com
Wed Dec 23 08:56:08 UTC 2009


On Tue, Dec 22, 2009 at 9:17 PM, <y at mail.and.org> wrote:

> From: James Antill <james at and.org>
>
> ---
>  yum/rpmtrans.py |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/yum/rpmtrans.py b/yum/rpmtrans.py
> index f20b1b8..cf0efeb 100644
> --- a/yum/rpmtrans.py
> +++ b/yum/rpmtrans.py
> @@ -26,6 +26,7 @@ import sys
>  from yum.constants import *
>  from yum import _
>  import misc
> +import tempfile
>
>  class NoOutputCallBack:
>     def __init__(self):
> @@ -205,11 +206,10 @@ class RPMTransaction:
>
>     def _setupOutputLogging(self):
>         # UGLY... set up the transaction to record output from scriptlets
> -        (r, w) = os.pipe()
> -        # need fd objects, and read should be non-blocking
> -        self._readpipe = os.fdopen(r, 'r')
> -        self._fdSetNonblock(self._readpipe.fileno())
> -        self._writepipe = os.fdopen(w, 'w')
> +        io_r = tempfile.TemporaryFile()
> +        w = os.dup(io_r.fileno())
> +        self._readpipe = io_r
> +        self._writepipe = os.fdopen(w, 'w+b')
>         self.base.ts.scriptFd = self._writepipe.fileno()
>         rpm.setVerbosity(rpm.RPMLOG_INFO)
>         rpm.setLogFile(self._writepipe)
> --
> 1.6.5.2
>
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum-devel
>

This is replaced by a later patch right ?

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20091223/7604e90c/attachment.htm>


More information about the Yum-devel mailing list