Bug#433988: ChangeLogReader: failed to generate... ... ...divided by 0
In [EMAIL PROTECTED] A. Costa [EMAIL PROTECTED] wrote: 1) docs a) vague SYNOPSIS --help b) examples (wishlist) 2) needlessly obscure error message 3) exit code 0 Okay. I uploaded treil-1.3 which probably fixes 1.a (--help), 2, and 3. In addition, I added a new option -v and if it is not specified, treil doesn't display detailed information so that users don't come up with unexpected usage. Regards, -- Daiki Ueno -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#433988: ChangeLogReader: failed to generate... ... ...divided by 0
On Sat, 21 Jul 2007 16:52:59 +0900 Daiki Ueno [EMAIL PROTECTED] wrote: Let's throw a changelog at 'treil': % gunzip /usr/share/doc/treil/changelog.Debian.gz /tmp/chl % treil -R ChangeLogReader /tmp/chl /tmp/chl.png ; echo $? Reader: ChangeLogReader Writer: CairoPNGWriter failed to generate `/tmp/chl.png': divided by 0 /usr/lib/ruby/1.8/treil/reader.rb:107:in `/' /usr/lib/ruby/1.8/treil/reader.rb:107:in `set_background_by_timestamp' /usr/lib/ruby/1.8/treil/reader.rb:323:in `read' /usr/bin/treil:111 0 This is not a bug. ^ One might argue that the above output shows not _A_ (single) bug, but several distinct bugs. Your usage is wrong. ChangeLogReader (and other readers) takes directories rather than files. Thanks, I didn't know that. Still, wrong is a somewhat relative term here -- we bug reporters tend to deliberately do things wrong in order to break programs. Often bad usages reveal additional bugs in the error messages themselves. For example, poor documentation: % treil 21 | head -n 2 Usage: /usr/bin/treil [OPTIONS] INPUT OUTPUT Readers: CVSReader SVNReader GitReader HgReader ChangeLogReader DirReader % man treil | grep -A 1 SYN SYNOPSIS treil [OPTIONS] Those should say that 'INPUT' has to be a directory, e.g.: cd: cd [-L|-P] [dir] Therefore: Usage: /usr/bin/treil [OPTIONS] DIRECTORY OUTPUTFILE treil [OPTIONS] DIRECTORY Error messages should be more instructive. divided by 0 implies that a subprogram or library was called with bad syntax -- that's virtually never the user's fault. The code should check for bad syntax _before_ calling a fragile subroutine. Since 'INPUT' should be a directory, it's trivial to check for, e.g. in shell script: [ ! -d $inp ] { echo $inp is not a directory ; exit 2 ; } i.e. it is a fallback reader in case they are not version controlled. I don't know what it does. It'd be better if the docs had some sample usages that require only files already on the average Debian system. Add an example directory to '/usr/share/doc/treil' if need be. In any event the exit code of '0' seems inappropriate. Perhaps. For command line utils, bad input genrally results in an error code: % ls -z ; echo $? ls: invalid option -- z Try `ls --help' for more information. 2 % man -z man /dev/null ; echo $? man: invalid option -- z 1 % cp -z /bin/sh /tmp/sh ; echo $? cp: invalid option -- z Try `cp --help' for more information. 1 HTH... PS: Would you prefer the above comments were opened as separate bugs? 1) docs a) vague SYNOPSIS --help b) examples (wishlist) 2) needlessly obscure error message 3) exit code 0 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#433988: ChangeLogReader: failed to generate... ... ...divided by 0
In [EMAIL PROTECTED] A. Costa [EMAIL PROTECTED] wrote: Let's throw a changelog at 'treil': % gunzip /usr/share/doc/treil/changelog.Debian.gz /tmp/chl % treil -R ChangeLogReader /tmp/chl /tmp/chl.png ; echo $? Reader: ChangeLogReader Writer: CairoPNGWriter failed to generate `/tmp/chl.png': divided by 0 /usr/lib/ruby/1.8/treil/reader.rb:107:in `/' /usr/lib/ruby/1.8/treil/reader.rb:107:in `set_background_by_timestamp' /usr/lib/ruby/1.8/treil/reader.rb:323:in `read' /usr/bin/treil:111 0 # do ten of 'em % export TMPIN=/tmp/chlog.log ; for f in `locate hangelog.Debian.gz | head`; do gunzip $f $TMPIN ; treil -R ChangeLogReader $TMPIN $TMPIN.png ; echo $? ; done { ...output is the same as the previous example, times ten. } ...perhaps the file format of the above changelogs aren't the kind 'treil' can use? This is not a bug. Your usage is wrong. ChangeLogReader (and other readers) takes directories rather than files. i.e. it is a fallback reader in case they are not version controlled. In any event the exit code of '0' seems inappropriate. Perhaps. Regards, -- Daiki Ueno -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#433988: ChangeLogReader: failed to generate... ... ...divided by 0
Package: treil Version: 1.1-2 Severity: important Let's throw a changelog at 'treil': % gunzip /usr/share/doc/treil/changelog.Debian.gz /tmp/chl % treil -R ChangeLogReader /tmp/chl /tmp/chl.png ; echo $? Reader: ChangeLogReader Writer: CairoPNGWriter failed to generate `/tmp/chl.png': divided by 0 /usr/lib/ruby/1.8/treil/reader.rb:107:in `/' /usr/lib/ruby/1.8/treil/reader.rb:107:in `set_background_by_timestamp' /usr/lib/ruby/1.8/treil/reader.rb:323:in `read' /usr/bin/treil:111 0 # do ten of 'em % export TMPIN=/tmp/chlog.log ; for f in `locate hangelog.Debian.gz | head`; do gunzip $f $TMPIN ; treil -R ChangeLogReader $TMPIN $TMPIN.png ; echo $? ; done { ...output is the same as the previous example, times ten. } ...perhaps the file format of the above changelogs aren't the kind 'treil' can use? In any event the exit code of '0' seems inappropriate. Hope this helps... -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.21-1-686 (SMP w/1 CPU core) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C) Shell: /bin/sh linked to /bin/dash Versions of packages treil depends on: ii libc6 2.6-2 GNU C Library: Shared libraries ii libcairo-ruby1.8 1.5.0-1Cairo bindings for the Ruby langua ii libexpat1 1.95.8-3.4 XML parsing C library - runtime li ii libruby1.81.8.6-2Libraries necessary to run Ruby 1. ii libtreil0 1.1-2 A shared library for treil (tree s ii ruby 1.8.2-1An interpreter of object-oriented treil recommends no packages. -- debconf-show failed -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]