• Bug#263270: Patch for defoma problem in sid

    From Frank Lichtenheld@1:229/2 to All on Sat Aug 21 23:50:06 2004
    From: [email protected]

    child's stout and stderr get discarded. With the patch it appears to work
    as expected.

    I verified the patch and uploaded a NMU with the following final
    patch.

    diff -Naur defoma-0.11.8.bak/debian/changelog defoma-0.11.8/debian/changelog --- defoma-0.11.8.bak/debian/changelog 2004-05-25 13:54:25.000000000 +0200
    +++ defoma-0.11.8/debian/changelog 2004-08-21 19:27:45.000000000 +0200
    @@ -1,3 +1,11 @@
    +defoma (0.11.8-0.1) unstable; urgency=high
    +
    + * NMU
    + * Apply patch by Jurij Smakov to fix redirecting the output
    + streams (Closes: #263270)
    +
    + -- Frank Lichtenheld <[email protected]> Sat, 21 Aug 2004 19:27:43 +0200
    +
    defoma (0.11.8) unstable; urgency=low

    * Fix some typos and engrish in dfontmgr.1, closes: #234329.
    diff -Naur defoma-0.11.8.bak/libs/libconsole.pl defoma-0.11.8/libs/libconsole.pl
    --- defoma-0.11.8.bak/libs/libconsole.pl 2004-01-01 19:47:02.000000000 +0100
    +++ defoma-0.11.8/libs/libconsole.pl 2004-08-21 19:24:33.000000000 +0200
    @@ -1,3 +1,5 @@
    +use POSIX;
    +
    my $dialog = '/usr/bin/whiptail';
    $dialog = '/usr/bin/dialog' unless (-x $dialog);

    @@ -7,7 +9,8 @@
    my $pid = fork();
    if ($pid == 0) {
    close(PARENT_READER);
    - open(STDERR, ">&CHILD_WRITER");
    + dup2(fileno(CHILD_WRITER),3);
    +
  • From Jurij Smakov@1:229/2 to All on Sat Aug 14 07:30:08 2004
    From: [email protected]

    tags 263270 + patch
    thanks

    Hello,

    The patch below takes care of the defoma-hints problem. Whiptail/dialog
    output their GUI to stdout, so the only way to prevent GUI from ending
    up in the hints file is to redirect it to stderr. However stderr is used
    by default to output the user's choice. The patch forces the user's choice output to go to fd 3 (using --output-fd 3 option to whiptail), which is
    dup2'ed to the child's pipe end and gets returned to the parent, while
    child's stout and stderr get discarded. With the patch it appears to work
    as expected.

    -----------------------------------cut here------------------------------
    --- defoma-0.11.8_orig/libs/libconsole.pl 2004-01-01 13:47:02.000000000 -0500
    +++ defoma-0.11.8/libs/libconsole.pl 2004-08-14 00:38:20.000000000 -0400
    @@ -1,3 +1,5 @@
    +use POSIX;
    +
    my $dialog = '/usr/bin/whiptail';
    $dialog = '/usr/bin/dialog' unless (-x $dialog);

    @@ -7,7 +9,8 @@
    my $pid = fork();
    if ($pid == 0) {
    close(PARENT_READER);
    - open(STDERR, ">&CHILD_WRITER");
    + dup2(fileno(CHILD_WRITER),3);
    + open(STDOUT, ">&STDERR");
    exec(@_);
    die("exec failure: $_[0]");
    }
    @@ -83,7 +86,7 @@
    # my $item=$output;
    # chomp $item; # For gdialog, which returns strings with newlines.

    - my $item = safe_redirect($dialog, '--clear', '--title',
    + my $item = safe_redirect($dialog, '--output-fd', '3', '--clear', '--title',
    $title, @options, $type, $text, $height, 80, @vars);

    $result = ($result >> 8);
    -----------------------------------cut here------------------------------

    Best regards,

    Jurij Smakov [email protected]
    K