defoma-hints sends interactive output to stdout

Bug #7292 reported by Debian Bug Importer
4
Affects Status Importance Assigned to Milestone
defoma (Debian)
Fix Released
Unknown
defoma (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Automatically imported from Debian bug report #263270 http://bugs.debian.org/263270

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Automatically imported from Debian bug report #263270 http://bugs.debian.org/263270

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <20040803154023.F0ACBE393@tea>
Date: Tue, 03 Aug 2004 11:40:23 -0400
From: Ambrose Li <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: defoma-hints sends interactive output to stdout

Package: defoma
Version: 0.11.8
Severity: grave
Justification: renders package unusable

The defoma-hints in sid is for some reason sending its interactive output to
stdout instead of stderr. Since the normal usage for defoma-hints requires
its stdout to be redirected to the hints file, this causes defoma-hints to be
practically unusable:

 $ defoma-hints -c type1 foo.pfb > foo.hints
 Wait for second...
 <nothing happens after a really line time>

It is not possible to interrupt defoma-hints, and it is necessary to press the
Enter key blindly. If I look at the hints file, I find that the output contains
both the ncurses interface and the hints data, like this:

   category type1
   ESC[?1049hESC[1;28rESC[4lESC[?25lESC[mESC[37mESC[40mESC[1;28rESC[HESC[JESC[1;1HESC[1mESC[37mESC[44m
   [...more control codes skipped...]
             ESC[21;27HESC[34hESC[?25hESC[28;1HESC[mESC[37mESC[40mESC[mESC[39;49m^M
                                                                                                                         ^MESC[?1049
   lbegin /path/to/foo.pfb
     FontName = foo
     Charset = font-specific
     Family = foo
     GeneralFamily = Roman
     Weight = Medium
     Width = Variable
     Shape = Upright
     Priority = 20
     AFM = /path/to/foo.afm
   end

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.26-ow1
Locale: LANG=C, LC_CTYPE=C

Versions of packages defoma depends on:
ii dialog 1.0-20040721-1 Displays user-friendly dialog boxe
ii file 4.09-1 Determines file type using "magic"
ii perl 5.8.4-2 Larry Wall's Practical Extraction
ii whiptail 0.51.6-9 Displays user-friendly dialog boxe

-- no debconf information

Revision history for this message
Matt Zimmerman (mdz) wrote :

Anyone know about defoma? I've never had cause to use defoma-hints, so clearly
it doesn't make the package unusable. downgrading.

Revision history for this message
In , Jurij Smakov (jurij) wrote : Patch for defoma problem in sid

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 address hidden>
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC

Revision history for this message
In , Jurij Smakov (jurij) wrote : Tagging patch

tags 263270 patch
thanks

Jurij Smakov <email address hidden>
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <Pine.LNX.4.58.0408140049330.29125@bobcat>
Date: Sat, 14 Aug 2004 01:05:22 -0400 (EDT)
From: Jurij Smakov <email address hidden>
To: <email address hidden>
cc: Ambrose Li <email address hidden>
Subject: Patch for defoma problem in sid

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 address hidden>
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <Pine.LNX.4.58.0408140116480.29125@bobcat>
Date: Sat, 14 Aug 2004 01:17:34 -0400 (EDT)
From: Jurij Smakov <email address hidden>
To: <email address hidden>
Subject: Tagging patch

tags 263270 patch
thanks

Jurij Smakov <email address hidden>
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC

Revision history for this message
In , Frank Lichtenheld (djpig) wrote : Fixed in NMU of defoma 0.11.8-0.1

tag 263270 + fixed

quit

This message was generated automatically in response to a
non-maintainer upload. The .changes file follows.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 21 Aug 2004 19:27:43 +0200
Source: defoma
Binary: defoma dfontmgr defoma-doc psfontmgr
Architecture: source all
Version: 0.11.8-0.1
Distribution: unstable
Urgency: high
Maintainer: Angus Lees <email address hidden>
Changed-By: Frank Lichtenheld <email address hidden>
Description:
 defoma - Debian Font Manager -- automatic font configuration framework
 defoma-doc - Debian Font Manager documentation
 dfontmgr - GUI frontend for Defoma, DEbian FOnt MAnager
 psfontmgr - PostScript font manager -- part of Defoma, Debian Font Manager
Closes: 263270
Changes:
 defoma (0.11.8-0.1) unstable; urgency=high
 .
   * NMU
   * Apply patch by Jurij Smakov to fix redirecting the output
     streams (Closes: #263270)
Files:
 bd7b3c0d90160edc85c10ba70a4fb7e2 550 admin optional defoma_0.11.8-0.1.dsc
 16089981074efd690b3febc2968a9de6 325623 admin optional defoma_0.11.8-0.1.tar.gz
 d11d7b51189fd81e48d6ef9f317d7b1d 77922 admin optional defoma_0.11.8-0.1_all.deb
 2320d7cd7a2637e4bfe0f607511dda21 61046 doc optional defoma-doc_0.11.8-0.1_all.deb
 82d87f3940cc0270fdff58568ca3c5ee 21220 admin optional psfontmgr_0.11.8-0.1_all.deb
 15d1426217e3e5cffa60248b65471b4b 41180 admin optional dfontmgr_0.11.8-0.1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBJ5URQbn06FtxPfARAp7xAKDajgAjk+oZ7GQQoPJHU3c7OM+VxQCgqnCU
tXEfsdWdkYEoDRSZahsfIIE=
=O4fm
-----END PGP SIGNATURE-----

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Sat, 21 Aug 2004 14:47:15 -0400
From: Frank Lichtenheld <email address hidden>
To: <email address hidden>
Cc: Frank Lichtenheld <email address hidden>, Angus Lees <email address hidden>
Subject: Fixed in NMU of defoma 0.11.8-0.1

tag 263270 + fixed

quit

This message was generated automatically in response to a
non-maintainer upload. The .changes file follows.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 21 Aug 2004 19:27:43 +0200
Source: defoma
Binary: defoma dfontmgr defoma-doc psfontmgr
Architecture: source all
Version: 0.11.8-0.1
Distribution: unstable
Urgency: high
Maintainer: Angus Lees <email address hidden>
Changed-By: Frank Lichtenheld <email address hidden>
Description:
 defoma - Debian Font Manager -- automatic font configuration framework
 defoma-doc - Debian Font Manager documentation
 dfontmgr - GUI frontend for Defoma, DEbian FOnt MAnager
 psfontmgr - PostScript font manager -- part of Defoma, Debian Font Manager
Closes: 263270
Changes:
 defoma (0.11.8-0.1) unstable; urgency=high
 .
   * NMU
   * Apply patch by Jurij Smakov to fix redirecting the output
     streams (Closes: #263270)
Files:
 bd7b3c0d90160edc85c10ba70a4fb7e2 550 admin optional defoma_0.11.8-0.1.dsc
 16089981074efd690b3febc2968a9de6 325623 admin optional defoma_0.11.8-0.1.tar.gz
 d11d7b51189fd81e48d6ef9f317d7b1d 77922 admin optional defoma_0.11.8-0.1_all.deb
 2320d7cd7a2637e4bfe0f607511dda21 61046 doc optional defoma-doc_0.11.8-0.1_all.deb
 82d87f3940cc0270fdff58568ca3c5ee 21220 admin optional psfontmgr_0.11.8-0.1_all.deb
 15d1426217e3e5cffa60248b65471b4b 41180 admin optional dfontmgr_0.11.8-0.1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBJ5URQbn06FtxPfARAp7xAKDajgAjk+oZ7GQQoPJHU3c7OM+VxQCgqnCU
tXEfsdWdkYEoDRSZahsfIIE=
=O4fm
-----END PGP SIGNATURE-----

Revision history for this message
In , Frank Lichtenheld (djpig) wrote : Re: Bug#263270: Patch for defoma problem in sid

> 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 address hidden> 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);
+ 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);

Gruesse,
--
Frank Lichtenheld <email address hidden>
www: http://www.djpig.de/

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Sat, 21 Aug 2004 23:25:17 +0200
From: Frank Lichtenheld <email address hidden>
To: <email address hidden>, <email address hidden>
Cc: Ambrose Li <email address hidden>
Subject: Re: Bug#263270: Patch for defoma problem in sid

> 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 address hidden> 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);
+ 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);

Gruesse,
--
Frank Lichtenheld <email address hidden>
www: http://www.djpig.de/

Revision history for this message
Thom May (thombot) wrote :

 defoma (0.11.8ubuntu1) warty; urgency=low
 .
   * Apply patch by Jurij Smakov to fix redirecting the output
     streams (Closes Warty #532)

Revision history for this message
In , Angus Lees (gus) wrote : severity of 217652 is grave, merging 217652 263270

# Automatically generated email from bts, devscripts version 2.8.5
severity 217652 grave
merge 217652 263270

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Sun, 5 Dec 2004 10:08:09 +1100
From: Angus Lees <email address hidden>
To: <email address hidden>
Subject: severity of 217652 is grave, merging 217652 263270

# Automatically generated email from bts, devscripts version 2.8.5
severity 217652 grave
merge 217652 263270

Revision history for this message
In , Angus Lees (gus) wrote : Bug#263270: fixed in defoma 0.11.9
Download full text (4.1 KiB)

Source: defoma
Source-Version: 0.11.9

We believe that the bug you reported is fixed in the latest version of
defoma, which is due to be installed in the Debian FTP archive:

defoma-doc_0.11.9_all.deb
  to pool/main/d/defoma/defoma-doc_0.11.9_all.deb
defoma_0.11.9.dsc
  to pool/main/d/defoma/defoma_0.11.9.dsc
defoma_0.11.9.tar.gz
  to pool/main/d/defoma/defoma_0.11.9.tar.gz
defoma_0.11.9_all.deb
  to pool/main/d/defoma/defoma_0.11.9_all.deb
dfontmgr_0.11.9_all.deb
  to pool/main/d/defoma/dfontmgr_0.11.9_all.deb
psfontmgr_0.11.9_all.deb
  to pool/main/d/defoma/psfontmgr_0.11.9_all.deb

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to <email address hidden>,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Angus Lees <email address hidden> (supplier of updated defoma package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing <email address hidden>)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Thu, 22 Jun 2006 22:29:34 +0100
Source: defoma
Binary: defoma dfontmgr defoma-doc psfontmgr
Architecture: source all
Version: 0.11.9
Distribution: unstable
Urgency: low
Maintainer: Angus Lees <email address hidden>
Changed-By: Angus Lees <email address hidden>
Description:
 defoma - Debian Font Manager -- automatic font configuration framework
 defoma-doc - Debian Font Manager documentation
 dfontmgr - GUI frontend for Defoma, DEbian FOnt MAnager
 psfontmgr - PostScript font manager -- part of Defoma, Debian Font Manager
Closes: 257777 263270 269035 273502 274434 281722 290219 300278 307305 316138 325466 365954 368609 368611
Changes:
 defoma (0.11.9) unstable; urgency=low
 .
   * Use the word "License" instead of "Copyright" in
     debian/copyright (Closes: #290219).
   * Fix spelling errors in /etc/defoma/loc-cset.data, thanks to the good
     eyes of Andrew T. Young (Closes: #316138).
   * Acknowledge NMU, thanks (Closes: #263270).
     - FIXME: adapt it so it doesn't assume fd 3 is available
   * Improve a few defoma-doc.doc-base files, closes: #281722.
   * Bug fix: "defoma: formatting error in the Defoma::Common.3pm man
     page", thanks to Nicolas François (Closes: #274434).
   * Bug fix: "example in manual page for defoma-hints", thanks to Martin
     Kourim (Closes: #257777).
   * Use dh_installman to install mangpages, closes: #273502.
   * Move debhelper from Build-Depends-Indep to Build-Depends, since its
     used in the 'clean' target.
   * Rejig binary-{arch,indep} split, so binary-arch does nothing.
   * Update to Standards-Version 3.6.2.0.
   * Adjust debhelper files to only run defoma commands if they exist.
     This should allow packages to downgrade dependencies on defoma safely.
     Closes: #300278
   * Bug fix: "Hints generator default width initializer checks wrong
     variable", thanks to Tyson Whitehead (Closes: #368609).
   * Bug fix: "Type1 hints generator roman family does not default to
     serif", th...

Read more...

Changed in defoma:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.