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

Bug#730599: makeinfo -D 'var value' doesn't work



Package: texinfo
Version: 5.2.0.dfsg.1-2
Severity: important
Tags: patch

Hello,

In new versions of texinfo, the behaviour of makeinfo -D option changed
so that the -D "variable value" no longer works.

eg.

$ cat test.texi
@value{var1}
$ # older version (4.13)
$ makeinfo -v -D 'var1 foo' -o test.info test.texi
makeinfo (GNU texinfo) 4.13
Making info file `test.info' from `test.texi'.
$ cat test.info
This is test.info, produced by makeinfo version 4.13 from test.texi.

foo

$ # new version of makeinfo (5.2)
$ makeinfo -v -D 'var1 foo' -o test.info test.texi
test.texi:1: warning: undefined flag: var1
Output file test.info
test.texi: warning: document without nodes
gyx@miz:~/bugs.d.o/texinfo$ cat test.info
This is test.info, produced by makeinfo version 5.2 from test.texi.

{No value for 'var1'}


Tag Table:

End Tag Table
$

A patch is attached that could hopefully fix this bug. (However, I
didn't check the old implementation's source for the exact semantics
of "-D".)

Cheers,

GUO Yixuan

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.11-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages texinfo depends on:
ii  libc6                   2.17-93
ii  libintl-perl            1.23-1
ii  libtext-unidecode-perl  0.04-2
ii  libxml-libxml-perl      2.0107+dfsg-1

texinfo recommends no packages.

Versions of packages texinfo suggests:
pn  texinfo-doc-nonfree          <none>
pn  texlive-base                 <none>
pn  texlive-generic-recommended  <none>
pn  texlive-latex-base           <none>

--- a/tp/texi2any.pl
+++ b/tp/texi2any.pl
@@ -924,7 +924,15 @@ There is NO WARRANTY, to the extent perm
                         document_warn($message);
                       }
                     },
- 'D=s' => sub {$parser_default_options->{'values'}->{$_[1]} = 1;},
+ 'D=s' => sub {
+    my $var = $_[1];
+    my @field = split /\s+/, $var;
+    if (@field == 1) {
+      $parser_default_options->{'values'}->{$var} = 1;
+    } else {
+      $parser_default_options->{'values'}->{$field[0]} = $field[1];
+    }
+ },
  'U=s' => sub {delete $parser_default_options->{'values'}->{$_[1]};},
  'init-file=s' => sub {
     locate_and_load_init_file($_[1], [ @conf_dirs, @program_init_dirs ]);

Reply to: