Debian Bug report logs - #476863
source-highlight: Does not default to stdout, despite --help text

version graph

Package: source-highlight; Maintainer for source-highlight is Peter Eisentraut <petere@debian.org>; Source for source-highlight is src:source-highlight.

Reported by: Adam Sjøgren <asjo@koldfront.dk>

Date: Sat, 19 Apr 2008 16:36:02 UTC

Severity: normal

Tags: confirmed, upstream

Found in version source-highlight/2.4-5.2

Forwarded to http://savannah.gnu.org/support/index.php?106347

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Ola Lundqvist <opal@debian.org>:
Bug#476863; Package source-highlight. Full text and rfc822 format available.

Acknowledgement sent to Adam Sjøgren <asjo@koldfront.dk>:
New Bug report received and forwarded. Copy sent to Ola Lundqvist <opal@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Adam Sjøgren <asjo@koldfront.dk>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: source-highlight: Does not default to stdout, despite --help text
Date: Sat, 19 Apr 2008 18:28:46 +0200
Package: source-highlight
Version: 2.4-5.2
Severity: normal

The --help text says that the default is to send output to stdout, but
the default seems to be to create a new file with .html extension:

 $ source-highlight --help | grep -A2 'output=filename'
   -o, --output=filename         output file. default std output. If STDOUT is 
                                   specified, the output is directed to standard 
                                   output
 $ ls
 hello
 $ source-highlight --src-lang perl hello
 Processed hello
 $ ls
 hello  hello.html
 $ 

Specifying --output STDOUT does work:

 $ source-highlight --src-lang perl --output STDOUT hello
 <!-- Generator: GNU source-highlight 2.4
 by Lorenzo Bettini
 http://www.lorenzobettini.it
 http://www.gnu.org/software/src-highlite -->
 <pre><tt><i><font color="#9A1900">#!/usr/bin/perl</font></i>

 <b><font color="#0000FF">use</font></b> strict<font color="#990000">;</font>
 <b><font color="#0000FF">use</font></b> warnings<font color="#990000">;</font>

 <b><font color="#0000FF">print</font></b> <font color="#FF0000">"Hello world\n"</font><font color="#990000">;</font>
 </tt></pre>
 Processed hello
 $ 

So it looks like it is just the default (or, maybe, but I hope not,
the --help text) that is wrong.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.25-asjo-powerpc
Locale: LANG=C, LC_CTYPE=da_DK (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages source-highlight depends on:
ii  libboost-regex1.34.1          1.34.1-11  regular expression library for C++
ii  libc6                         2.7-10     GNU C Library: Shared libraries
ii  libgcc1                       1:4.3.0-2  GCC support library
ii  libstdc++6                    4.3.0-2    The GNU Standard C++ Library v3

source-highlight recommends no packages.

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Ola Lundqvist <opal@debian.org>:
Bug#476863; Package source-highlight. Full text and rfc822 format available.

Acknowledgement sent to Kresten Kjeldgaard <gathond@gathond.dk>:
Extra info received and forwarded to list. Copy sent to Ola Lundqvist <opal@debian.org>. Full text and rfc822 format available.

Message #10 received at 476863@bugs.debian.org (full text, mbox):

From: Kresten Kjeldgaard <gathond@gathond.dk>
To: Debian Bug Tracking System <476863@bugs.debian.org>
Subject: source-highlight: Patch which makes stdout the default as well as adds "-" to enable stdout
Date: Sat, 19 Apr 2008 19:38:43 +0200
[Message part 1 (text/plain, inline)]
Package: source-highlight
Version: 2.4-5.2
Followup-For: Bug #476863

The attached patch fixes the broken default as well as adds "-" along with
"STDOUT" as special filenames. 

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.ISO-8859-15, LC_CTYPE=da_DK.ISO-8859-15 (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages source-highlight depends on:
ii  libboost-regex1.34.1          1.34.1-11  regular expression library for C++
ii  libc6                         2.7-10     GNU C Library: Shared libraries
ii  libgcc1                       1:4.3.0-3  GCC support library
ii  libstdc++6                    4.3.0-3    The GNU Standard C++ Library v3

source-highlight recommends no packages.

-- no debconf information
[default_output.patch (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Ola Lundqvist <opal@debian.org>:
Bug#476863; Package source-highlight. Full text and rfc822 format available.

Acknowledgement sent to opal@debian.org:
Extra info received and forwarded to list. Copy sent to Ola Lundqvist <opal@debian.org>. Full text and rfc822 format available.

Message #15 received at 476863@bugs.debian.org (full text, mbox):

From: Ola Lundqvist <opal@debian.org>
To: Kresten Kjeldgaard <gathond@gathond.dk>, 476863@bugs.debian.org
Subject: Re: Bug#476863: source-highlight: Patch which makes stdout the default as well as adds "-" to enable stdout
Date: Sun, 20 Apr 2008 16:53:28 +0200
Hi

Thanks a lot for the patch. I'm not sure I want to change the default compared to
"upstream". I would actually prefer to change the documentation in that case.

Do you have an other opinion about this?

Best regards,

// Ola

On Sat, Apr 19, 2008 at 07:38:43PM +0200, Kresten Kjeldgaard wrote:
> Package: source-highlight
> Version: 2.4-5.2
> Followup-For: Bug #476863
> 
> The attached patch fixes the broken default as well as adds "-" along with
> "STDOUT" as special filenames. 
> 
> -- System Information:
> Debian Release: lenny/sid
>   APT prefers unstable
>   APT policy: (500, 'unstable')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 2.6.24-1-amd64 (SMP w/2 CPU cores)
> Locale: LANG=en_GB.ISO-8859-15, LC_CTYPE=da_DK.ISO-8859-15 (charmap=ISO-8859-15)
> Shell: /bin/sh linked to /bin/bash
> 
> Versions of packages source-highlight depends on:
> ii  libboost-regex1.34.1          1.34.1-11  regular expression library for C++
> ii  libc6                         2.7-10     GNU C Library: Shared libraries
> ii  libgcc1                       1:4.3.0-3  GCC support library
> ii  libstdc++6                    4.3.0-3    The GNU Standard C++ Library v3
> 
> source-highlight recommends no packages.
> 
> -- no debconf information

> --- source-highlight-2.4/src/startapp.cc	2006-05-07 15:00:32.000000000 +0200
> +++ source-highlight-2.4-fixed/src/startapp.cc	2008-04-19 19:06:03.529843322 +0200
> @@ -181,9 +181,10 @@
>    if ( inputFileName.size() && ! is_cgi && args_info.output_given)
>      outputFileName = args_info.output_arg ;
>  
> -  bool generate_to_stdout =
> +  bool generate_to_stdout = (!args_info.output_arg || 
>      (args_info.output_arg &&
> -     strcmp (args_info.output_arg, "STDOUT") == 0);
> +		 (strcmp (args_info.output_arg, "STDOUT") == 0 || 
> +		 strcmp (args_info.output_arg, "-") == 0)));
>  
>    if ( verbose )
>      setMessager( new DefaultMessages ) ;


-- 
 --------------------- Ola Lundqvist ---------------------------
/  opal@debian.org                     Annebergsslingan 37      \
|  ola@inguza.com                      654 65 KARLSTAD          |
|  http://inguza.com/                  +46 (0)70-332 1551       |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9 /
 ---------------------------------------------------------------




Information forwarded to debian-bugs-dist@lists.debian.org, Ola Lundqvist <opal@debian.org>:
Bug#476863; Package source-highlight. Full text and rfc822 format available.

Acknowledgement sent to Kresten Kjeldgaard <gathond@gathond.dk>:
Extra info received and forwarded to list. Copy sent to Ola Lundqvist <opal@debian.org>. Full text and rfc822 format available.

Message #20 received at 476863@bugs.debian.org (full text, mbox):

From: Kresten Kjeldgaard <gathond@gathond.dk>
To: Ola Lundqvist <opal@debian.org>
Cc: 476863@bugs.debian.org
Subject: Re: Bug#476863: source-highlight: Patch which makes stdout the default as well as adds "-" to enable stdout
Date: Sun, 20 Apr 2008 17:31:57 +0200
[Message part 1 (text/plain, inline)]
On Sun, Apr 20, 2008 at 04:53:28PM +0200, Ola Lundqvist wrote:
> Hi
> 
> Thanks a lot for the patch. I'm not sure I want to change the default compared to
> "upstream". I would actually prefer to change the documentation in that case.
>
> Do you have an other opinion about this?

First of, I'm not personally using this software I just happened to be
on the same IRC channel as the original submitter and had nothing better
to do at the time so I started looking at it.

Personally I agree with the original submitter that having a default
which consists of writing $inputfilename.html overwriting anything
happening to be there already in the process seems wrong on some level. 
So I went with the assumption that the built in help function described
the intended way, and the code somehow went wrong along the way. 

I have since determined the upstream 2.9 has the same behaviour as the
debian package, as well as the same broken --help description. Actually
the whole -o/--output scheme seems to be broken upstream, I never
managed to make it do anything but STDOUT and $filename.html, no matter
what I specified.

Perhaps the best thing is to simply report this issue to upstream and
check what their oppinion is on what should be the correct behaviour and
then take it from there?

Then we can at some point send them a patch which at least makes the
behaviour and the --help text consistent.

Please let me know your thoughts about the above.

-- 
Med venlig hilsen / Kind regards
Kresten Kjeldgaard aka Gathond
For every complex problem, there is a solution that is simple, neat, and wrong.
-- H. L. Mencken
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Ola Lundqvist <opal@debian.org>:
Bug#476863; Package source-highlight. Full text and rfc822 format available.

Acknowledgement sent to opal@debian.org:
Extra info received and forwarded to list. Copy sent to Ola Lundqvist <opal@debian.org>. Full text and rfc822 format available.

Message #25 received at 476863@bugs.debian.org (full text, mbox):

From: Ola Lundqvist <opal@debian.org>
To: Kresten Kjeldgaard <gathond@gathond.dk>, 476863@bugs.debian.org
Subject: Re: Bug#476863: source-highlight: Patch which makes stdout the default as well as adds "-" to enable stdout
Date: Sun, 20 Apr 2008 20:21:54 +0200
Hi

Thanks for the information. I have report this upstream and the report is
available in http://savannah.gnu.org/support/index.php?106347

I'll see if I can get any good answer from there.

Best regards,

// Ola

On Sun, Apr 20, 2008 at 05:31:57PM +0200, Kresten Kjeldgaard wrote:
> On Sun, Apr 20, 2008 at 04:53:28PM +0200, Ola Lundqvist wrote:
> > Hi
> > 
> > Thanks a lot for the patch. I'm not sure I want to change the default compared to
> > "upstream". I would actually prefer to change the documentation in that case.
> >
> > Do you have an other opinion about this?
> 
> First of, I'm not personally using this software I just happened to be
> on the same IRC channel as the original submitter and had nothing better
> to do at the time so I started looking at it.
> 
> Personally I agree with the original submitter that having a default
> which consists of writing $inputfilename.html overwriting anything
> happening to be there already in the process seems wrong on some level. 
> So I went with the assumption that the built in help function described
> the intended way, and the code somehow went wrong along the way. 
> 
> I have since determined the upstream 2.9 has the same behaviour as the
> debian package, as well as the same broken --help description. Actually
> the whole -o/--output scheme seems to be broken upstream, I never
> managed to make it do anything but STDOUT and $filename.html, no matter
> what I specified.
> 
> Perhaps the best thing is to simply report this issue to upstream and
> check what their oppinion is on what should be the correct behaviour and
> then take it from there?
> 
> Then we can at some point send them a patch which at least makes the
> behaviour and the --help text consistent.
> 
> Please let me know your thoughts about the above.
> 
> -- 
> Med venlig hilsen / Kind regards
> Kresten Kjeldgaard aka Gathond
> For every complex problem, there is a solution that is simple, neat, and wrong.
> -- H. L. Mencken



-- 
 --------------------- Ola Lundqvist ---------------------------
/  opal@debian.org                     Annebergsslingan 37      \
|  ola@inguza.com                      654 65 KARLSTAD          |
|  http://inguza.com/                  +46 (0)70-332 1551       |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9 /
 ---------------------------------------------------------------




Added tag(s) upstream and confirmed. Request was from Peter Eisentraut <petere@debian.org> to control@bugs.debian.org. (Wed, 09 Sep 2009 22:00:03 GMT) Full text and rfc822 format available.

Set Bug forwarded-to-address to 'http://savannah.gnu.org/support/index.php?106347'. Request was from Peter Eisentraut <petere@debian.org> to control@bugs.debian.org. (Wed, 09 Sep 2009 22:00:04 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 05:55:41 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.