Update to texinfo-6.0

This commit is contained in:
Vitezslav Crhonek 2015-07-13 11:37:47 +02:00
parent 1b8bac11b2
commit d267005a3b
7 changed files with 94 additions and 286 deletions

2
.gitignore vendored
View File

@ -6,3 +6,5 @@ texinfo-4.13a.tar.lzma.sig
/texinfo-5.1.tar.xz.sig
/texinfo-5.2.tar.xz
/texinfo-5.2.tar.xz.sig
/texinfo-6.0.tar.xz
/texinfo-6.0.tar.xz.sig

View File

@ -1,2 +1,2 @@
cb489df8a7ee9d10a236197aefdb32c5 texinfo-5.2.tar.xz
23be0c1d1ff653bc7599643e359ca1be texinfo-5.2.tar.xz.sig
02818e62a5b8ae0213a7ff572991bb50 texinfo-6.0.tar.xz
6fe30fbdabab79a55ebd0b2608fa6847 texinfo-6.0.tar.xz.sig

View File

@ -1,6 +1,6 @@
diff -up texinfo-5.1/install-info/install-info.c.orig texinfo-5.1/install-info/install-info.c
--- texinfo-5.1/install-info/install-info.c.orig 2013-03-09 03:21:55.000000000 +0100
+++ texinfo-5.1/install-info/install-info.c 2013-03-18 12:47:02.721136885 +0100
diff -up texinfo-6.0/install-info/install-info.c.orig texinfo-6.0/install-info/install-info.c
--- texinfo-6.0/install-info/install-info.c.orig 2015-02-27 19:57:27.000000000 +0100
+++ texinfo-6.0/install-info/install-info.c 2015-06-29 16:28:05.570329815 +0200
@@ -22,6 +22,7 @@
#include <getopt.h>
#include <regex.h>
@ -9,16 +9,17 @@ diff -up texinfo-5.1/install-info/install-info.c.orig texinfo-5.1/install-info/i
#define TAB_WIDTH 8
@@ -670,7 +671,7 @@ The first time you invoke Info you start
@@ -684,15 +685,15 @@ The first time you invoke Info you start
MAGIC number, not the filename. */
Return either stdin reading the file, or a non-stdin pipe reading
the output of the compression program. */
-FILE *
+void *
open_possibly_compressed_file (char *filename,
void (*create_callback) (char *),
char **opened_filename, char **compression_program, int *is_pipe)
@@ -678,7 +679,7 @@ open_possibly_compressed_file (char *fil
- char **opened_filename, char **compression_program)
+ char **opened_filename, char **compression_program, int *is_pipe)
{
char *local_opened_filename, *local_compression_program;
int nread;
char data[13];
@ -27,7 +28,7 @@ diff -up texinfo-5.1/install-info/install-info.c.orig texinfo-5.1/install-info/i
/* We let them pass NULL if they don't want this info, but it's easier
to always determine it. */
@@ -686,48 +687,48 @@ open_possibly_compressed_file (char *fil
@@ -700,48 +701,48 @@ open_possibly_compressed_file (char *fil
opened_filename = &local_opened_filename;
*opened_filename = filename;
@ -83,17 +84,17 @@ diff -up texinfo-5.1/install-info/install-info.c.orig texinfo-5.1/install-info/i
+ f = gzopen (*opened_filename, FOPEN_RBIN);
}
#endif /* __MSDOS__ */
if (!f)
@@ -739,7 +740,7 @@ open_possibly_compressed_file (char *fil
/* And try opening it again. */
free (*opened_filename);
*opened_filename = filename;
- f = fopen (*opened_filename, FOPEN_RBIN);
+ f = gzopen (*opened_filename, FOPEN_RBIN);
if (!f)
pfatal_with_name (filename);
}
@@ -749,12 +750,12 @@ open_possibly_compressed_file (char *fil
if (!f)
@@ -757,7 +758,7 @@ open_possibly_compressed_file (char *fil
(*create_callback) (filename);
/* And try opening it again. */
- f = fopen (*opened_filename, FOPEN_RBIN);
+ f = gzopen (*opened_filename, FOPEN_RBIN);
if (!f)
return 0;
}
@@ -767,12 +768,12 @@ open_possibly_compressed_file (char *fil
/* Read first few bytes of file rather than relying on the filename.
If the file is shorter than this it can't be usable anyway. */
@ -102,51 +103,81 @@ diff -up texinfo-5.1/install-info/install-info.c.orig texinfo-5.1/install-info/i
+ nread = gzread (f, data, sizeof (data));
+ if (nread != sizeof (data))
{
/* Empty files don't set errno, so we get something like
"install-info: No error for foo", which is confusing. */
/* Empty files don't set errno. Calling code can check for
this, so make sure errno == 0 just in case it isn't already. */
- if (nread == 0)
+ if (nread >= 0)
fatal (_("%s: empty file"), *opened_filename);
pfatal_with_name (*opened_filename);
errno = 0;
return 0;
}
@@ -821,20 +822,22 @@ open_possibly_compressed_file (char *fil
@@ -838,35 +839,40 @@ open_possibly_compressed_file (char *fil
*compression_program = NULL;
/* Seek back over the magic bytes. */
- if (fseek (f, 0, 0) < 0)
+ if (gzseek (f, 0, SEEK_SET) == -1)
return 0;
if (*compression_program)
{ /* It's compressed, so fclose the file and then open a pipe. */
{ /* It's compressed, so open a pipe. */
+ FILE *p;
char *command = concat (*compression_program," -cd <", *opened_filename);
char *command = concat (*compression_program, " -d", "");
- if (fclose (f) < 0)
+ if (gzclose (f) < 0)
pfatal_with_name (*opened_filename);
return 0;
- f = freopen (*opened_filename, FOPEN_RBIN, stdin);
- if (!f)
+ p = freopen (*opened_filename, FOPEN_RBIN, stdin);
+ if (!p)
return 0;
- f = popen (command, "r");
- if (f)
- if (!f)
+ p = popen (command, "r");
+ if (p)
*is_pipe = 1;
else
pfatal_with_name (command);
+ if (!p)
{
/* Used for error message in calling code. */
*opened_filename = command;
return 0;
}
+ else
+ *is_pipe = 1;
+ return p;
}
else
{ /* It's a plain file, seek back over the magic bytes. */
- if (fseek (f, 0, 0) < 0)
+ if (gzseek (f, 0, SEEK_SET) < 0)
pfatal_with_name (*opened_filename);
{
-#if O_BINARY
+#if 0 && O_BINARY
/* Since this is a text file, and we opened it in binary mode,
switch back to text mode. */
f = freopen (*opened_filename, "r", f);
@@ -859,7 +862,7 @@ readfile (char *filename, int *sizep,
if (! f)
return 0;
#endif
+ *is_pipe = 0;
}
return f;
@@ -885,7 +891,8 @@ readfile (char *filename, int *sizep,
void (*create_callback) (char *), char **opened_filename,
char **compression_program)
{
char *real_name;
- FILE *f;
+ void *f;
int pipe_p;
+ int pipe_p;
int filled = 0;
int data_size = 8192;
@@ -873,7 +876,12 @@ readfile (char *filename, int *sizep,
char *data = xmalloc (data_size);
@@ -893,14 +900,20 @@ readfile (char *filename, int *sizep,
/* If they passed the space for the file name to return, use it. */
f = open_possibly_compressed_file (filename, create_callback,
opened_filename,
- compression_program);
+ compression_program,
+ &pipe_p);
if (!f)
return 0;
for (;;)
{
@ -158,21 +189,24 @@ diff -up texinfo-5.1/install-info/install-info.c.orig texinfo-5.1/install-info/i
+ else
+ nread = gzread (f, data + filled, data_size - filled);
if (nread < 0)
pfatal_with_name (real_name);
return 0;
if (nread == 0)
@@ -895,7 +903,7 @@ readfile (char *filename, int *sizep,
if (pipe_p)
@@ -919,8 +932,10 @@ readfile (char *filename, int *sizep,
/* We need to close the stream, since on some systems the pipe created
by popen is simulated by a temporary file which only gets removed
inside pclose. */
- if (f != stdin)
+ if (pipe_p)
pclose (f);
else
- fclose (f);
+ else
+ gzclose (f);
*sizep = filled;
return data;
diff -up texinfo-5.1/install-info/Makefile.in.orig texinfo-5.1/install-info/Makefile.in
--- texinfo-5.1/install-info/Makefile.in.orig 2013-03-12 23:56:43.000000000 +0100
+++ texinfo-5.1/install-info/Makefile.in 2013-03-18 12:42:57.165767101 +0100
@@ -171,7 +171,7 @@ am__installdirs = "$(DESTDIR)$(bindir)"
diff -up texinfo-6.0/install-info/Makefile.in.orig texinfo-6.0/install-info/Makefile.in
--- texinfo-6.0/install-info/Makefile.in.orig 2015-06-26 14:51:08.000000000 +0200
+++ texinfo-6.0/install-info/Makefile.in 2015-06-29 16:18:59.342902368 +0200
@@ -241,7 +241,7 @@ am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS)

View File

@ -1,12 +0,0 @@
diff -up texinfo-5.1/install-info/install-info.c.orig texinfo-5.1/install-info/install-info.c
--- texinfo-5.1/install-info/install-info.c.orig 2013-03-18 12:37:15.375860494 +0100
+++ texinfo-5.1/install-info/install-info.c 2013-03-18 12:37:42.589012295 +0100
@@ -835,7 +835,7 @@ open_possibly_compressed_file (char *fil
}
else
{ /* It's a plain file, seek back over the magic bytes. */
- if (gzseek (f, 0, SEEK_SET) < 0)
+ if (gzseek (f, 0, SEEK_SET) == -1)
pfatal_with_name (*opened_filename);
#if 0 && O_BINARY
/* Since this is a text file, and we opened it in binary mode,

View File

@ -1,195 +0,0 @@
Index: info/nodes.c
===================================================================
--- info/nodes.c (revision 5245)
+++ info/nodes.c (revision 5246)
@@ -563,6 +563,7 @@
/* Okay, we have isolated the node name, and we know where the
node starts. Remember this information. */
entry = xmalloc (sizeof (TAG));
+ entry->content_cache = NULL;
entry->nodename = xmalloc (1 + (end - start));
strncpy (entry->nodename, nodeline + start, end - start);
entry->nodename[end - start] = 0;
@@ -667,6 +668,7 @@
break;
entry = xmalloc (sizeof (TAG));
+ entry->content_cache = NULL;
/* Find the beginning of the node definition. */
tmp_search->start += name_offset;
@@ -981,7 +983,12 @@
node->filename = subfile->fullpath;
node->parent = NULL;
node->nodename = tag->nodename;
- node->contents = subfile->contents + tag->nodestart;
+
+ if (tag->content_cache)
+ node->contents = tag->content_cache;
+ else
+ node->contents = subfile->contents + tag->nodestart;
+
node->display_pos = 0;
node->flags = 0;
node_set_body_start (node);
@@ -1049,6 +1056,12 @@
node_body.end = buff_end - node_body.buffer;
node_body.flags = 0;
tag->nodelen = get_node_length (&node_body);
+ /* Expand eventual \b[...\b] constructs in the contents.
+ If found, update node->contents to point to the resulting
+ buffer. */
+ if (tags_expand (node->contents, tag->nodelen,
+ &tag->content_cache, &tag->nodelen))
+ node->contents = tag->content_cache;
node->nodelen = tag->nodelen;
}
else if (tag->nodelen == 0) /* anchor, return containing node */
@@ -1173,7 +1186,8 @@
free_info_tag (TAG *tag)
{
free (tag->nodename);
-
+ free (tag->content_cache);
+
/* We don't free tag->filename, because that filename is part of the
subfiles list for the containing FILE_BUFFER. free_info_tags ()
will free the subfiles when it is appropriate. */
Index: info/tag.c
===================================================================
--- info/tag.c (revision 5245)
+++ info/tag.c (revision 5246)
@@ -113,6 +113,8 @@
if (state == state_delim)
continue;
}
+ else if (state == state_delim)
+ state = state_kw;
cur_len = mb_len (mbi_cur (iter));
cur_ptr = mbi_cur_ptr (iter);
@@ -125,6 +127,8 @@
switch (*cur_ptr)
{
case '=':
+ if (state != state_kw)
+ break;
text_buffer_add_char (&tmpbuf, 0);
kw = tmpbuf.base;
if (!mbi_avail (iter))
@@ -197,22 +201,29 @@
return NULL;
}
-void
-tags_expand (char **pbuf, size_t *pbuflen)
+/* Expand \b[...\b] constructs in INPUT (of INPUTLEN bytes). If encountered,
+ put the expanded text into PBUF, store its length in PBUFLEN, and return
+ 1. Otherwise, don't touch neither of the latter and return 0. */
+int
+tags_expand (char *input, size_t inputlen, char **pbuf, size_t *pbuflen)
{
- char *input = *pbuf;
- char *endp = input + *pbuflen;
+ char *endp = input + inputlen;
struct text_buffer outbuf;
+ int text_buffer_used = 0;
char *p;
- text_buffer_init (&outbuf);
-
while ((p = input + strlen (input)) < endp) /* go forward to null */
{
if (memcmp(p + 1, "\b[", 2) == 0) /* opening magic? */
{
char *q;
+ if (!text_buffer_used)
+ {
+ text_buffer_init (&outbuf);
+ text_buffer_used = 1;
+ }
+
p += 3;
q = p + strlen (p); /* forward to next null */
if (memcmp (q + 1, "\b]", 2) == 0) /* closing magic? */
@@ -227,10 +238,7 @@
while (p[len] == ' ' || p[len] == '\t')
++len; /* move past whitespace */
- if (!text_buffer_off (&outbuf))
- text_buffer_add_string (&outbuf, *pbuf, p - *pbuf - 3);
- else
- text_buffer_add_string (&outbuf, input, p - input - 3);
+ text_buffer_add_string (&outbuf, input, p - input - 3);
if (tp->handler (p + len, &outbuf) == 0)
{
input = q + 3;
@@ -240,21 +248,21 @@
}
}
- if (text_buffer_off (&outbuf))
- {
- text_buffer_add_string (&outbuf, input, p - input);
- }
+ if (text_buffer_used)
+ text_buffer_add_string (&outbuf, input, p - input);
+
input = p + 1;
}
- if (text_buffer_off (&outbuf))
+ if (text_buffer_used && text_buffer_off (&outbuf))
{
if (input < endp)
text_buffer_add_string (&outbuf, input, endp - input);
- free (*pbuf);
*pbuflen = text_buffer_off (&outbuf);
*pbuf = text_buffer_base (&outbuf);
+ return 1;
}
+ return 0;
}
void
Index: info/nodes.h
===================================================================
--- info/nodes.h (revision 5245)
+++ info/nodes.h (revision 5246)
@@ -90,6 +90,9 @@
char *nodename; /* The node pointed to by this tag. */
long nodestart; /* The offset of the start of this node. */
long nodelen; /* The length of this node. */
+ char *content_cache; /* Cache of the node contents; used if the
+ node contents must be preprocessed before
+ displaying it. */
} TAG;
/* The following structure is used to remember information about the contents
Index: info/filesys.c
===================================================================
--- info/filesys.c (revision 5245)
+++ info/filesys.c (revision 5246)
@@ -645,8 +645,6 @@
files are coming from some Windows system across a network. */
fsize = convert_eols (contents, fsize);
- tags_expand (&contents, &fsize);
-
/* EOL conversion can shrink the text quite a bit. We don't
want to waste storage. */
contents = xrealloc (contents, 1 + fsize);
Index: info/tag.h
===================================================================
--- info/tag.h (revision 5245)
+++ info/tag.h (revision 5246)
@@ -19,7 +19,7 @@
#ifndef TAG_H
#define TAG_H
-void tags_expand (char **pbuf, size_t *pbuflen);
+int tags_expand (char *input, size_t inputlen, char **pbuf, size_t *pbuflen);
void handle_tag (char *tag);
#endif

View File

@ -1,18 +0,0 @@
diff -up texinfo-5.2/info/info.c.orig texinfo-5.2/info/info.c
--- texinfo-5.2/info/info.c.orig 2014-01-16 08:55:50.084084818 +0100
+++ texinfo-5.2/info/info.c 2014-01-16 08:55:55.464112252 +0100
@@ -859,7 +859,13 @@ show_error_node (NODE *node)
{
if (info_error_rings_bell_p)
terminal_ring_bell ();
- if (!echo_area_is_active)
+ if (user_output_filename)
+ {
+ if (node->contents[node->nodelen - 1] == '\n')
+ node->contents[node->nodelen - 1] = 0;
+ info_error ("%s", node->contents);
+ }
+ else if (!echo_area_is_active)
{
free_echo_area ();
window_set_node_of_window (the_echo_area, node);

View File

@ -4,8 +4,8 @@
Summary: Tools needed to create Texinfo format documentation files
Name: texinfo
Version: 5.2
Release: 10%{?dist}
Version: 6.0
Release: 1%{?dist}
License: GPLv3+
Group: Applications/Publishing
Url: http://www.gnu.org/software/texinfo/
@ -19,9 +19,6 @@ Source4: filter-provides-texinfo.sh
# Source5: macro definitions
Source5: macros.info
Patch0: texinfo-4.12-zlib.patch
Patch1: texinfo-4.13a-powerpc.patch
# Patch2: bz#1053129, already upstream
Patch2: texinfo-5.2-non-existing-info-page-segfault.patch
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
Requires: perl >= 5.7.3, perl(Text::Unidecode)
@ -69,8 +66,6 @@ for printing using TeX.
%prep
%setup -q
%patch0 -p1 -b .zlib
%patch1 -p1 -b .powerpc
%patch2 -p1 -b .non-existing-info-page-segfault
%build
%configure --with-external-Text-Unidecode \
@ -153,12 +148,10 @@ fi
%{!?_licensedir:%global license %%doc}
%license COPYING
%{_bindir}/info
%{_bindir}/infokey
%{_infodir}/info.info*
%{_infodir}/info-stnd.info*
/sbin/install-info
%{_mandir}/man1/info.1*
%{_mandir}/man1/infokey.1*
%{_mandir}/man1/install-info.1*
%{_mandir}/man5/info.5*
%{_rpmconfigdir}/macros.d/macros.info
@ -175,6 +168,10 @@ fi
%{_mandir}/man1/pdftexi2dvi.1*
%changelog
* Mon Jul 13 2015 Vitezslav Crhonek <vcrhonek@redhat.com> - 6.0-1
- Update to texinfo-6.0
Resolves: #1236254
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.2-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild