[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Does anybody know how to edit web2c change files?



On Thu, Mar 23, 2006 at 08:45:17AM +0100, Frank K?ster wrote:
> Julian Gilbey <jdg@polya.uklinux.net> wrote:
> 
> > On Wed, Mar 22, 2006 at 03:51:35PM +0100, Frank K?ster wrote:
> >> Hi,
> >> 
> >> as requested by Martin Schr?der, the pdfTeX maintainer, I'd like to add
> >> something about libpoppler to the "pdeftex --version" output or the
> >> general banner, but I don't manage.  According to him, it should be
> >> sufficient to change texk/web2c/pdfetexdir/pdfetexextra.in, but that
> >> doesn't have any effect here - probably we have such an ancient version
> >> (1.20 instead of 1.40 in which he is thinking...).
> >
> > Just modifying the #define BANNER=... line in that file does it for
> > me.
> 
> Strange - I tried and got funny results, e.g. after changing
> 
> #define BANNER "This is pdfeTeX, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION"
> 
> to 
> 
> #define BANNER "This is not pdfeTeX, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION"
> 
> it printed "not pdfeTeX..." instead of "This is pdfeTeX..."

With the normal version, compare:

burnside:~ $ pdfetex --version
pdfeTeX 3.141592-1.21a-2.2 (Web2C 7.5.4)
kpathsea version 3.5.4
Copyright (C) 1997-2004 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Kpathsea is copyright (C) 1997-2004 Free Software Foundation, Inc.
[...]

with:

burnside:~ $ pdfetex
This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
**

It turns out that when producing the version string for --version in
lib/printversion.c, function printversionandexit, the leading prefix
"This is " is stripped off from the banner name.  Furthermore, the
banner string is parsed like this:

"This is pdfeTeX, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION"
 ^^^^^^^^-------          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 stripped name            progversion

where "This is " is stripped, the prog name goes up to the first
comma, and the progversion is everything after the final space; then
the first line of the --version output is:

name progversion (Web2C-version)

So if all is wanted is to tweak the banner line, there are two ways to
do it:

(1) Hackish: define BANNER to be something like:
    "This is pdfeTeX with Debian tweaks, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION"

(2) Actually modify the printversionandexit code in lib/printversion.c
    to output something like:

  string debianversion = "(Debian version blah)";

  len = prog_name_end - banner - sizeof ("This is") + sizeof(debianversion);
  prog_name = (string)xmalloc (len + 1);
  strncpy (prog_name, banner + sizeof ("This is"), len);
  prog_name[len] = 0;

  /* The Web2c version string starts with a space.  */
  printf ("%s %s%s %s\n", prog_name, prog_version, versionstring, debianversion);

    and a similar change in one of the change files.

But the latter seems like hard work :/

   Julian



Reply to: