Thursday, January 18, 2007

GNU Gengetopt 2.19.1

Although I released 2.19 of GNU Gengetopt few weeks ago, I had to release a fixed version: 2.19.1, http://www.gnu.org/software/gengetopt.

This release basically fixes some bugs such as:

  • fixed compilation problem that can make 'make check' fail on some systems
    lacking getopt_long.
  • fixed a test problem when not using GNU sed
  • in strings # comments are not considered
The first problem was quite interesting, since it was due to not passing to the C compiler the right command line switches, in particular the switch specifying the paths where to look for header files. In systems where getopt_long is not provided (or it is provided in a not too up to date version), the configure script provides the right version of sources with getopt_long functions. However, you must make sure to include the right version of the header file containing the prototype for getopt_long, otherwise, the C compiler will use the header file of the C library (this, of course, happens only in the case where the C library provides this function, but configure detected that it does not behave correctly - this is accomplished by using GNU Gnulib) and links to the customized version of getopt_long. Of course, the results will be unpredictable!

The second problem was due to a usage of sed with a regular expression which seems to work with GNU sed, but not with BSD sed (actually I don't know which version misbehaves). The solution was provided by Bob White (thanks again Bob!) and it is also online here.

The problem was that I was using this sed command line:
sed -e "s/^\(\([^\/]*\)\/\)\+//g"
in order to remove the directories of a path, while it was sufficient to use this simpler command line:
sed -e "s/^.*\///g"
since the * is greedy and will match the last /. Well done Bob! :-)

Wednesday, January 10, 2007

Debian, Cups & Xerox Phaser (stopped with status 22)

I had previously posted on this blog about this Xerox printer, a Phaser 4500 DT (by using the drivers found on their website). I had solved a problem under Gentoo, but now I've experienced other problems under Debian, after I upgraded these drivers downloaded from Xerox website.

By taking a look at the log /var/log/cups/error_log, I found this line again:

PID xxxx stopped with status 22
This time the problem was with the wrong filter used in the ppd of the printer, in particular this line of XRX_Phaser_4500dx.ppd:
*cupsFilter: "application/vnd.cups-postscript 0 pstoxeroxps"
which needs to be changed into
*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
Now everything seems to work :-)

Saturday, January 06, 2007

Please, don't eject my music player!


Before you start reading, this is NOT a serious post. I've been using an Acer MP-320 as an mp3 player (kind of Ipod) for a few years now, and I've never experienced problems, not even with Linux, which sees this reader as an hard disk, so that I don't have to resort to strange (or even worse, proprietary) tools to access it and store files in it. I hadn't been using it for a while, and today I connected it to my linux laptop and KDE successfully recognized it, mounted it and opened a file manager window to access it. After I was done copying files to it, I right clicked on the desktop icon for my device and chose "safely remove". The device was unmounted, but the system notified me that it couldn't eject it... I would say "thank God you cannot eject it"... I was thinking of my laptop throwing the player out of the window... LOL ;-)

Tuesday, January 02, 2007

GNU Gengetopt 2.19

Happy New Year :-)

I've just released the new version of GNU Gengetopt 2.19: http://www.gnu.org/software/gengetopt.

This release basically fixes some bugs such as:

  • Wherever they can be specified, strings can spawn more than one line and contain escaped " (e.g., \");
  • with --long-help the optional options are correctly printed between [];
  • Now --no-handle-help correctly handles also --full-help (thanks to Gyozo Papp), i.e., when --no-handle-help is specified in gengetopt, the generated command line parser will not handle automatically the --full-help, but will allow the programmer to do so;
  • automatically generated usage strings are now correctly wrapped.
Besides these bug fix, some enhancements were added (basically based on users requests):
  • usage string can be specified by the programmer in the .ggo file, thus overriding the one generated automatically by gengetopt;
  • the programmer can also specify in the .ggo file a description string that will be printed after the usage string, in the --help output;
  • configuration files can include other configuration files (thanks to David Bird), using the include keyword
  • the option --show-required was added: if specified to gengetopt, the generated help output will print the string "(mandatory)" after the description of each required option; you can also specify the string that has to be printed, instead of the default "(mandatory)"
These new features should make the code produced by gengetopt (in particular, with these features, the generated output of --help) more customizable. Since now you can use purpose, usage and description as you see fit.