Rebase to upstream texinfo-4.11, Resolves: #295441
This commit is contained in:
parent
af70858f74
commit
21e91be42b
@ -1,3 +1,4 @@
|
|||||||
texinfo-4.7.tar.bz2
|
texinfo-4.7.tar.bz2
|
||||||
texinfo-4.8.tar.bz2
|
texinfo-4.8.tar.bz2
|
||||||
texinfo-4.9.tar.bz2
|
texinfo-4.9.tar.bz2
|
||||||
|
texinfo-4.11.tar.bz2
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
f4458e4b81e5469fa0815c35654141ab texinfo-4.9.tar.bz2
|
c6bf13df4fbeff8ce874aacd6a51e814 texinfo-4.11.tar.bz2
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
--- texinfo-4.8/util/Makefile.in.zlib 2006-01-16 05:53:28.000000000 +0100
|
--- texinfo-4.11/util/Makefile.in_old 2007-09-10 02:37:45.000000000 +0200
|
||||||
+++ texinfo-4.8/util/Makefile.in 2006-01-16 05:53:45.000000000 +0100
|
+++ texinfo-4.11/util/Makefile.in 2007-09-19 10:29:06.000000000 +0200
|
||||||
@@ -83,7 +83,7 @@
|
@@ -110,7 +110,7 @@
|
||||||
PROGRAMS = $(bin_PROGRAMS)
|
PROGRAMS = $(bin_PROGRAMS)
|
||||||
am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
|
am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
|
||||||
ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS)
|
ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS)
|
||||||
-ginstall_info_LDADD = $(LDADD)
|
-ginstall_info_LDADD = $(LDADD)
|
||||||
+ginstall_info_LDADD = $(LDADD) -lz
|
+ginstall_info_LDADD = $(LDADD) -lz
|
||||||
am__DEPENDENCIES_1 =
|
am__DEPENDENCIES_1 =
|
||||||
ginstall_info_DEPENDENCIES = ../lib/libtxi.a $(am__DEPENDENCIES_1)
|
ginstall_info_DEPENDENCIES = ../lib/libtxi.a \
|
||||||
texindex_SOURCES = texindex.c
|
$(top_builddir)/gnulib/lib/libgnu.a $(am__DEPENDENCIES_1)
|
||||||
--- texinfo-4.8/util/install-info.c.zlib 2006-01-16 05:55:00.000000000 +0100
|
--- texinfo-4.11/util/install-info.c_old 2007-07-01 23:20:33.000000000 +0200
|
||||||
+++ texinfo-4.8/util/install-info.c 2006-01-16 06:03:40.000000000 +0100
|
+++ texinfo-4.11/util/install-info.c 2007-09-19 10:40:02.000000000 +0200
|
||||||
@@ -20,6 +20,7 @@
|
@@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
#include <regex.h>
|
||||||
+#include <zlib.h>
|
+#include <zlib.h>
|
||||||
|
|
||||||
static char *progname = "install-info";
|
static char *progname = "install-info";
|
||||||
|
|
||||||
@@ -529,7 +530,7 @@
|
@@ -559,7 +560,7 @@
|
||||||
COMPRESSION_PROGRAM. The compression program is determined by the
|
COMPRESSION_PROGRAM. The compression program is determined by the
|
||||||
magic number, not the filename. */
|
magic number, not the filename. */
|
||||||
|
|
||||||
@ -28,7 +28,7 @@
|
|||||||
open_possibly_compressed_file (char *filename,
|
open_possibly_compressed_file (char *filename,
|
||||||
void (*create_callback) (char *),
|
void (*create_callback) (char *),
|
||||||
char **opened_filename, char **compression_program, int *is_pipe)
|
char **opened_filename, char **compression_program, int *is_pipe)
|
||||||
@@ -537,7 +538,7 @@
|
@@ -567,7 +568,7 @@
|
||||||
char *local_opened_filename, *local_compression_program;
|
char *local_opened_filename, *local_compression_program;
|
||||||
int nread;
|
int nread;
|
||||||
char data[4];
|
char data[4];
|
||||||
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
/* We let them pass NULL if they don't want this info, but it's easier
|
/* We let them pass NULL if they don't want this info, but it's easier
|
||||||
to always determine it. */
|
to always determine it. */
|
||||||
@@ -545,16 +546,16 @@
|
@@ -575,16 +576,16 @@
|
||||||
opened_filename = &local_opened_filename;
|
opened_filename = &local_opened_filename;
|
||||||
|
|
||||||
*opened_filename = filename;
|
*opened_filename = filename;
|
||||||
@ -57,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
@@ -562,13 +563,13 @@
|
@@ -592,13 +593,13 @@
|
||||||
{
|
{
|
||||||
free (*opened_filename);
|
free (*opened_filename);
|
||||||
*opened_filename = concat (filename, ".igz", "");
|
*opened_filename = concat (filename, ".igz", "");
|
||||||
@ -73,7 +73,7 @@
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!f)
|
if (!f)
|
||||||
@@ -580,7 +581,7 @@
|
@@ -610,7 +611,7 @@
|
||||||
/* And try opening it again. */
|
/* And try opening it again. */
|
||||||
free (*opened_filename);
|
free (*opened_filename);
|
||||||
*opened_filename = filename;
|
*opened_filename = filename;
|
||||||
@ -82,7 +82,7 @@
|
|||||||
if (!f)
|
if (!f)
|
||||||
pfatal_with_name (filename);
|
pfatal_with_name (filename);
|
||||||
}
|
}
|
||||||
@@ -591,12 +592,12 @@
|
@@ -621,12 +622,12 @@
|
||||||
|
|
||||||
/* Read first few bytes of file rather than relying on the filename.
|
/* 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. */
|
If the file is shorter than this it can't be usable anyway. */
|
||||||
@ -98,7 +98,7 @@
|
|||||||
fatal (_("%s: empty file"), *opened_filename, 0);
|
fatal (_("%s: empty file"), *opened_filename, 0);
|
||||||
pfatal_with_name (*opened_filename);
|
pfatal_with_name (*opened_filename);
|
||||||
}
|
}
|
||||||
@@ -629,20 +630,22 @@
|
@@ -659,20 +660,22 @@
|
||||||
|
|
||||||
if (*compression_program)
|
if (*compression_program)
|
||||||
{ /* It's compressed, so fclose the file and then open a pipe. */
|
{ /* It's compressed, so fclose the file and then open a pipe. */
|
||||||
@ -126,7 +126,7 @@
|
|||||||
/* Since this is a text file, and we opened it in binary mode,
|
/* Since this is a text file, and we opened it in binary mode,
|
||||||
switch back to text mode. */
|
switch back to text mode. */
|
||||||
f = freopen (*opened_filename, "r", f);
|
f = freopen (*opened_filename, "r", f);
|
||||||
@@ -667,7 +670,7 @@
|
@@ -697,7 +700,7 @@
|
||||||
char **compression_program)
|
char **compression_program)
|
||||||
{
|
{
|
||||||
char *real_name;
|
char *real_name;
|
||||||
@ -135,21 +135,21 @@
|
|||||||
int pipe_p;
|
int pipe_p;
|
||||||
int filled = 0;
|
int filled = 0;
|
||||||
int data_size = 8192;
|
int data_size = 8192;
|
||||||
@@ -681,7 +684,12 @@
|
@@ -711,7 +714,12 @@
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
- int nread = fread (data + filled, 1, data_size - filled, f);
|
- int nread = fread (data + filled, 1, data_size - filled, f);
|
||||||
+ int nread;
|
+ int nread;
|
||||||
+
|
+
|
||||||
+ if (pipe_p)
|
+ if (pipe_p)
|
||||||
+ nread = fread (data + filled, 1, data_size - filled, f);
|
+ nread = fread (data + filled, 1, data_size - filled, f);
|
||||||
+ else
|
+ else
|
||||||
+ nread = gzread (f, data + filled, data_size - filled);
|
+ nread = gzread (f, data + filled, data_size - filled);
|
||||||
if (nread < 0)
|
if (nread < 0)
|
||||||
pfatal_with_name (real_name);
|
pfatal_with_name (real_name);
|
||||||
if (nread == 0)
|
if (nread == 0)
|
||||||
@@ -703,7 +711,7 @@
|
@@ -733,7 +741,7 @@
|
||||||
if (pipe_p)
|
if (pipe_p)
|
||||||
pclose (f);
|
pclose (f);
|
||||||
else
|
else
|
@ -1,71 +0,0 @@
|
|||||||
--- texinfo-4.8/makeinfo/makeinfo.c.0xA0 2004-12-19 18:15:42.000000000 +0100
|
|
||||||
+++ texinfo-4.8/makeinfo/makeinfo.c 2006-12-04 22:37:54.000000000 +0100
|
|
||||||
@@ -2427,6 +2427,10 @@
|
|
||||||
len = fill_column - output_column;
|
|
||||||
break;
|
|
||||||
|
|
||||||
+ case NON_BREAKING_SPACE:
|
|
||||||
+ len = 1;
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
default:
|
|
||||||
/* ASCII control characters appear as two characters in the output
|
|
||||||
(e.g., ^A). But characters with the high bit set are just one
|
|
||||||
@@ -2584,7 +2588,7 @@
|
|
||||||
character = ';';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
- character = META (' '); /* unmeta-d in flush_output */
|
|
||||||
+ character = NON_BREAKING_SPACE; /* restored in flush_output */
|
|
||||||
}
|
|
||||||
|
|
||||||
insertion_paragraph_closed = 0;
|
|
||||||
@@ -2922,17 +2926,11 @@
|
|
||||||
node_line_number++;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /* If we turned on the 8th bit for a space inside @w, turn it
|
|
||||||
- back off for output. This might be problematic, since the
|
|
||||||
- 0x80 character may be used in 8-bit character sets. Sigh.
|
|
||||||
- In any case, don't do this for HTML, since the nbsp character
|
|
||||||
- is valid input and must be passed along to the browser. */
|
|
||||||
- if (!html && (output_paragraph[i] & meta_character_bit))
|
|
||||||
- {
|
|
||||||
- int temp = UNMETA (output_paragraph[i]);
|
|
||||||
- if (temp == ' ')
|
|
||||||
- output_paragraph[i] &= 0x7f;
|
|
||||||
- }
|
|
||||||
+ /* If we turned on the 8th bit for a space inside @w, turn it back off
|
|
||||||
+ for output. Don't do this for HTML, since the nbsp character is valid
|
|
||||||
+ input and must be passed along to the browser. */
|
|
||||||
+ if (!html && output_paragraph[i] == NON_BREAKING_SPACE)
|
|
||||||
+ output_paragraph[i] = ' ';
|
|
||||||
}
|
|
||||||
|
|
||||||
fwrite (output_paragraph, 1, output_paragraph_offset, output_stream);
|
|
||||||
--- texinfo-4.8/makeinfo/makeinfo.h.0xA0 2004-11-30 03:03:23.000000000 +0100
|
|
||||||
+++ texinfo-4.8/makeinfo/makeinfo.h 2006-12-04 22:35:06.000000000 +0100
|
|
||||||
@@ -242,13 +242,6 @@
|
|
||||||
#define coerce_to_upper(c) ((islower(c) ? toupper(c) : (c)))
|
|
||||||
#define coerce_to_lower(c) ((isupper(c) ? tolower(c) : (c)))
|
|
||||||
|
|
||||||
-#define control_character_bit 0x40 /* %01000000, must be off. */
|
|
||||||
-#define meta_character_bit 0x080/* %10000000, must be on. */
|
|
||||||
-#define CTL(c) ((c) & (~control_character_bit))
|
|
||||||
-#define UNCTL(c) coerce_to_upper(((c)|control_character_bit))
|
|
||||||
-#define META(c) ((c) | (meta_character_bit))
|
|
||||||
-#define UNMETA(c) ((c) & (~meta_character_bit))
|
|
||||||
-
|
|
||||||
#define whitespace(c) ((c) == '\t' || (c) == ' ')
|
|
||||||
#define sentence_ender(c) ((c) == '.' || (c) == '?' || (c) == '!')
|
|
||||||
#define cr_or_whitespace(c) (whitespace(c) || (c) == '\r' || (c) == '\n')
|
|
||||||
@@ -282,6 +275,9 @@
|
|
||||||
|
|
||||||
#define COMMAND_PREFIX '@'
|
|
||||||
|
|
||||||
+/* A byte value to represent a non-breaking space until flush_output (). */
|
|
||||||
+#define NON_BREAKING_SPACE 036
|
|
||||||
+
|
|
||||||
#define END_VERBATIM "end verbatim"
|
|
||||||
|
|
||||||
/* Stuff for splitting large files. The numbers for Emacs
|
|
@ -1,561 +0,0 @@
|
|||||||
--- texinfo-4.9/util/texindex.c_old 2007-06-27 19:11:08.000000000 +0200
|
|
||||||
+++ texinfo-4.9/util/texindex.c 2007-07-31 08:49:25.000000000 +0200
|
|
||||||
@@ -37,16 +37,12 @@
|
|
||||||
#define memset(ptr, ignore, count) bzero (ptr, count)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-char *mktemp (char *);
|
|
||||||
-
|
|
||||||
#if !defined (SEEK_SET)
|
|
||||||
# define SEEK_SET 0
|
|
||||||
# define SEEK_CUR 1
|
|
||||||
# define SEEK_END 2
|
|
||||||
#endif /* !SEEK_SET */
|
|
||||||
|
|
||||||
-struct linebuffer;
|
|
||||||
-
|
|
||||||
/* When sorting in core, this structure describes one line
|
|
||||||
and the position and length of its first keyfield. */
|
|
||||||
struct lineinfo
|
|
||||||
@@ -96,16 +92,6 @@
|
|
||||||
/* The allocated length of `linearray'. */
|
|
||||||
long nlines;
|
|
||||||
|
|
||||||
-/* Directory to use for temporary files. On Unix, it ends with a slash. */
|
|
||||||
-char *tempdir;
|
|
||||||
-
|
|
||||||
-/* Number of last temporary file. */
|
|
||||||
-int tempcount;
|
|
||||||
-
|
|
||||||
-/* Number of last temporary file already deleted.
|
|
||||||
- Temporary files are deleted by `flush_tempfiles' in order of creation. */
|
|
||||||
-int last_deleted_tempcount;
|
|
||||||
-
|
|
||||||
/* During in-core sort, this points to the base of the data block
|
|
||||||
which contains all the lines of data. */
|
|
||||||
char *text_base;
|
|
||||||
@@ -117,15 +103,9 @@
|
|
||||||
determine whether we need initials in the sorted form. */
|
|
||||||
char first_initial;
|
|
||||||
|
|
||||||
-/* Additional command switches .*/
|
|
||||||
-
|
|
||||||
-/* Nonzero means do not delete tempfiles -- for debugging. */
|
|
||||||
-int keep_tempfiles;
|
|
||||||
-
|
|
||||||
/* Forward declarations of functions in this file. */
|
|
||||||
void decode_command (int argc, char **argv);
|
|
||||||
void sort_in_core (char *infile, int total, char *outfile);
|
|
||||||
-void sort_offline (char *infile, off_t total, char *outfile);
|
|
||||||
char **parsefile (char *filename, char **nextline, char *data, long int size);
|
|
||||||
char *find_field (struct keyfield *keyfield, char *str, long int *lengthptr);
|
|
||||||
char *find_pos (char *str, int words, int chars, int ignore_blanks);
|
|
||||||
@@ -137,26 +117,17 @@
|
|
||||||
long int length1, long int pos1, char *start2,
|
|
||||||
long int length2, long int pos2);
|
|
||||||
int compare_full (const void *, const void *);
|
|
||||||
-long readline (struct linebuffer *linebuffer, FILE *stream);
|
|
||||||
-int merge_files (char **infiles, int nfiles, char *outfile);
|
|
||||||
-int merge_direct (char **infiles, int nfiles, char *outfile);
|
|
||||||
void pfatal_with_name (const char *name);
|
|
||||||
void fatal (const char *format, const char *arg);
|
|
||||||
void error (const char *format, const char *arg);
|
|
||||||
void *xmalloc (), *xrealloc ();
|
|
||||||
char *concat (char *s1, char *s2);
|
|
||||||
-void flush_tempfiles (int to_count);
|
|
||||||
|
|
||||||
-#define MAX_IN_CORE_SORT 500000
|
|
||||||
-
|
|
||||||
int
|
|
||||||
main (int argc, char **argv)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
- tempcount = 0;
|
|
||||||
- last_deleted_tempcount = 0;
|
|
||||||
-
|
|
||||||
#ifdef HAVE_SETLOCALE
|
|
||||||
/* Set locale via LC_ALL. */
|
|
||||||
setlocale (LC_ALL, "");
|
|
||||||
@@ -225,14 +196,15 @@
|
|
||||||
need_initials = 0;
|
|
||||||
first_initial = '\0';
|
|
||||||
|
|
||||||
- if (ptr < MAX_IN_CORE_SORT)
|
|
||||||
- /* Sort a small amount of data. */
|
|
||||||
- sort_in_core (infiles[i], (int)ptr, outfile);
|
|
||||||
- else
|
|
||||||
- sort_offline (infiles[i], ptr, outfile);
|
|
||||||
+ if (ptr != (int)ptr)
|
|
||||||
+ {
|
|
||||||
+ fprintf (stderr, "%s: %s: file too large\n", program_name,
|
|
||||||
+ infiles[i]);
|
|
||||||
+ xexit (1);
|
|
||||||
+ }
|
|
||||||
+ sort_in_core (infiles[i], (int)ptr, outfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
- flush_tempfiles (tempcount);
|
|
||||||
xexit (0);
|
|
||||||
return 0; /* Avoid bogus warnings. */
|
|
||||||
}
|
|
||||||
@@ -250,10 +222,6 @@
|
|
||||||
TEXINDEX_OPTION texindex_options[] = {
|
|
||||||
{ "--help", "-h", (int *)NULL, 0, (char *)NULL,
|
|
||||||
N_("display this help and exit") },
|
|
||||||
- { "--keep", "-k", &keep_tempfiles, 1, (char *)NULL,
|
|
||||||
- N_("keep temporary files around after processing") },
|
|
||||||
- { "--no-keep", 0, &keep_tempfiles, 0, (char *)NULL,
|
|
||||||
- N_("do not keep temporary files around after processing (default)") },
|
|
||||||
{ "--output", "-o", (int *)NULL, 0, "FILE",
|
|
||||||
N_("send output to FILE") },
|
|
||||||
{ "--version", (char *)NULL, (int *)NULL, 0, (char *)NULL,
|
|
||||||
@@ -308,20 +276,6 @@
|
|
||||||
char **ip;
|
|
||||||
char **op;
|
|
||||||
|
|
||||||
- /* Store default values into parameter variables. */
|
|
||||||
-
|
|
||||||
- tempdir = getenv ("TMPDIR");
|
|
||||||
- if (tempdir == NULL)
|
|
||||||
- tempdir = getenv ("TEMP");
|
|
||||||
- if (tempdir == NULL)
|
|
||||||
- tempdir = getenv ("TMP");
|
|
||||||
- if (tempdir == NULL)
|
|
||||||
- tempdir = DEFAULT_TMPDIR;
|
|
||||||
- else
|
|
||||||
- tempdir = concat (tempdir, "/");
|
|
||||||
-
|
|
||||||
- keep_tempfiles = 0;
|
|
||||||
-
|
|
||||||
/* Allocate ARGC input files, which must be enough. */
|
|
||||||
|
|
||||||
infiles = (char **) xmalloc (argc * sizeof (char *));
|
|
||||||
@@ -349,7 +303,7 @@
|
|
||||||
else if ((strcmp (arg, "--keep") == 0) ||
|
|
||||||
(strcmp (arg, "-k") == 0))
|
|
||||||
{
|
|
||||||
- keep_tempfiles = 1;
|
|
||||||
+ /* Ignore, for backward compatibility */
|
|
||||||
}
|
|
||||||
else if ((strcmp (arg, "--help") == 0) ||
|
|
||||||
(strcmp (arg, "-h") == 0))
|
|
||||||
@@ -385,41 +339,6 @@
|
|
||||||
usage (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
-/* Return a name for temporary file COUNT. */
|
|
||||||
-
|
|
||||||
-static char *
|
|
||||||
-maketempname (int count)
|
|
||||||
-{
|
|
||||||
- static char *tempbase = NULL;
|
|
||||||
- char tempsuffix[10];
|
|
||||||
-
|
|
||||||
- if (!tempbase)
|
|
||||||
- {
|
|
||||||
- int fd;
|
|
||||||
- tempbase = concat (tempdir, "txidxXXXXXX");
|
|
||||||
-
|
|
||||||
- fd = mkstemp (tempbase);
|
|
||||||
- if (fd == -1)
|
|
||||||
- pfatal_with_name (tempbase);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- sprintf (tempsuffix, ".%d", count);
|
|
||||||
- return concat (tempbase, tempsuffix);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-/* Delete all temporary files up to TO_COUNT. */
|
|
||||||
-
|
|
||||||
-void
|
|
||||||
-flush_tempfiles (int to_count)
|
|
||||||
-{
|
|
||||||
- if (keep_tempfiles)
|
|
||||||
- return;
|
|
||||||
- while (last_deleted_tempcount < to_count)
|
|
||||||
- unlink (maketempname (++last_deleted_tempcount));
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-
|
|
||||||
/* Compare LINE1 and LINE2 according to the specified set of keyfields. */
|
|
||||||
|
|
||||||
int
|
|
||||||
@@ -802,150 +721,6 @@
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-/* A `struct linebuffer' is a structure which holds a line of text.
|
|
||||||
- `readline' reads a line from a stream into a linebuffer
|
|
||||||
- and works regardless of the length of the line. */
|
|
||||||
-
|
|
||||||
-struct linebuffer
|
|
||||||
-{
|
|
||||||
- long size;
|
|
||||||
- char *buffer;
|
|
||||||
-};
|
|
||||||
-
|
|
||||||
-/* Initialize LINEBUFFER for use. */
|
|
||||||
-
|
|
||||||
-void
|
|
||||||
-initbuffer (struct linebuffer *linebuffer)
|
|
||||||
-{
|
|
||||||
- linebuffer->size = 200;
|
|
||||||
- linebuffer->buffer = (char *) xmalloc (200);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-/* Read a line of text from STREAM into LINEBUFFER.
|
|
||||||
- Return the length of the line. */
|
|
||||||
-
|
|
||||||
-long
|
|
||||||
-readline (struct linebuffer *linebuffer, FILE *stream)
|
|
||||||
-{
|
|
||||||
- char *buffer = linebuffer->buffer;
|
|
||||||
- char *p = linebuffer->buffer;
|
|
||||||
- char *end = p + linebuffer->size;
|
|
||||||
-
|
|
||||||
- while (1)
|
|
||||||
- {
|
|
||||||
- int c = getc (stream);
|
|
||||||
- if (p == end)
|
|
||||||
- {
|
|
||||||
- buffer = (char *) xrealloc (buffer, linebuffer->size *= 2);
|
|
||||||
- p += buffer - linebuffer->buffer;
|
|
||||||
- end += buffer - linebuffer->buffer;
|
|
||||||
- linebuffer->buffer = buffer;
|
|
||||||
- }
|
|
||||||
- if (c < 0 || c == '\n')
|
|
||||||
- {
|
|
||||||
- *p = 0;
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- *p++ = c;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- return p - buffer;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-/* Sort an input file too big to sort in core. */
|
|
||||||
-
|
|
||||||
-void
|
|
||||||
-sort_offline (char *infile, off_t total, char *outfile)
|
|
||||||
-{
|
|
||||||
- /* More than enough. */
|
|
||||||
- int ntemps = 2 * (total + MAX_IN_CORE_SORT - 1) / MAX_IN_CORE_SORT;
|
|
||||||
- char **tempfiles = (char **) xmalloc (ntemps * sizeof (char *));
|
|
||||||
- FILE *istream = fopen (infile, "r");
|
|
||||||
- int i;
|
|
||||||
- struct linebuffer lb;
|
|
||||||
- long linelength;
|
|
||||||
- int failure = 0;
|
|
||||||
-
|
|
||||||
- initbuffer (&lb);
|
|
||||||
-
|
|
||||||
- /* Read in one line of input data. */
|
|
||||||
-
|
|
||||||
- linelength = readline (&lb, istream);
|
|
||||||
-
|
|
||||||
- if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
|
|
||||||
- {
|
|
||||||
- error (_("%s: not a texinfo index file"), infile);
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- /* Split up the input into `ntemps' temporary files, or maybe fewer,
|
|
||||||
- and put the new files' names into `tempfiles' */
|
|
||||||
-
|
|
||||||
- for (i = 0; i < ntemps; i++)
|
|
||||||
- {
|
|
||||||
- char *outname = maketempname (++tempcount);
|
|
||||||
- FILE *ostream = fopen (outname, "w");
|
|
||||||
- long tempsize = 0;
|
|
||||||
-
|
|
||||||
- if (!ostream)
|
|
||||||
- pfatal_with_name (outname);
|
|
||||||
- tempfiles[i] = outname;
|
|
||||||
-
|
|
||||||
- /* Copy lines into this temp file as long as it does not make file
|
|
||||||
- "too big" or until there are no more lines. */
|
|
||||||
-
|
|
||||||
- while (tempsize + linelength + 1 <= MAX_IN_CORE_SORT)
|
|
||||||
- {
|
|
||||||
- tempsize += linelength + 1;
|
|
||||||
- fputs (lb.buffer, ostream);
|
|
||||||
- putc ('\n', ostream);
|
|
||||||
-
|
|
||||||
- /* Read another line of input data. */
|
|
||||||
-
|
|
||||||
- linelength = readline (&lb, istream);
|
|
||||||
- if (!linelength && feof (istream))
|
|
||||||
- break;
|
|
||||||
-
|
|
||||||
- if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
|
|
||||||
- {
|
|
||||||
- error (_("%s: not a texinfo index file"), infile);
|
|
||||||
- failure = 1;
|
|
||||||
- goto fail;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- fclose (ostream);
|
|
||||||
- if (feof (istream))
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- free (lb.buffer);
|
|
||||||
-
|
|
||||||
-fail:
|
|
||||||
- /* Record number of temp files we actually needed. */
|
|
||||||
-
|
|
||||||
- ntemps = i;
|
|
||||||
-
|
|
||||||
- /* Sort each tempfile into another tempfile.
|
|
||||||
- Delete the first set of tempfiles and put the names of the second
|
|
||||||
- into `tempfiles'. */
|
|
||||||
-
|
|
||||||
- for (i = 0; i < ntemps; i++)
|
|
||||||
- {
|
|
||||||
- char *newtemp = maketempname (++tempcount);
|
|
||||||
- sort_in_core (tempfiles[i], MAX_IN_CORE_SORT, newtemp);
|
|
||||||
- if (!keep_tempfiles)
|
|
||||||
- unlink (tempfiles[i]);
|
|
||||||
- tempfiles[i] = newtemp;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (failure)
|
|
||||||
- return;
|
|
||||||
-
|
|
||||||
- /* Merge the tempfiles together and indexify. */
|
|
||||||
-
|
|
||||||
- merge_files (tempfiles, ntemps, outfile);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
/* Sort INFILE, whose size is TOTAL,
|
|
||||||
assuming that is small enough to be done in-core,
|
|
||||||
then indexify it and send the output to OUTFILE (or to stdout). */
|
|
||||||
@@ -1349,8 +1124,7 @@
|
|
||||||
|
|
||||||
for (next_line = linearray; next_line != stop_line; next_line++)
|
|
||||||
{
|
|
||||||
- /* If -u was specified, output the line only if distinct from
|
|
||||||
- previous one. */
|
|
||||||
+ /* Output the line only if distinct from previous one. */
|
|
||||||
if (next_line == linearray
|
|
||||||
/* Compare previous line with this one, using only the
|
|
||||||
explicitly specd keyfields. */
|
|
||||||
@@ -1370,215 +1144,6 @@
|
|
||||||
finish_index (ostream);
|
|
||||||
}
|
|
||||||
|
|
||||||
-/* Assume (and optionally verify) that each input file is sorted;
|
|
||||||
- merge them and output the result.
|
|
||||||
- Returns nonzero if any input file fails to be sorted.
|
|
||||||
-
|
|
||||||
- This is the high-level interface that can handle an unlimited
|
|
||||||
- number of files. */
|
|
||||||
-
|
|
||||||
-#define MAX_DIRECT_MERGE 10
|
|
||||||
-
|
|
||||||
-int
|
|
||||||
-merge_files (char **infiles, int nfiles, char *outfile)
|
|
||||||
-{
|
|
||||||
- char **tempfiles;
|
|
||||||
- int ntemps;
|
|
||||||
- int i;
|
|
||||||
- int value = 0;
|
|
||||||
- int start_tempcount = tempcount;
|
|
||||||
-
|
|
||||||
- if (nfiles <= MAX_DIRECT_MERGE)
|
|
||||||
- return merge_direct (infiles, nfiles, outfile);
|
|
||||||
-
|
|
||||||
- /* Merge groups of MAX_DIRECT_MERGE input files at a time,
|
|
||||||
- making a temporary file to hold each group's result. */
|
|
||||||
-
|
|
||||||
- ntemps = (nfiles + MAX_DIRECT_MERGE - 1) / MAX_DIRECT_MERGE;
|
|
||||||
- tempfiles = (char **) xmalloc (ntemps * sizeof (char *));
|
|
||||||
- for (i = 0; i < ntemps; i++)
|
|
||||||
- {
|
|
||||||
- int nf = MAX_DIRECT_MERGE;
|
|
||||||
- if (i + 1 == ntemps)
|
|
||||||
- nf = nfiles - i * MAX_DIRECT_MERGE;
|
|
||||||
- tempfiles[i] = maketempname (++tempcount);
|
|
||||||
- value |= merge_direct (&infiles[i * MAX_DIRECT_MERGE], nf, tempfiles[i]);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- /* All temporary files that existed before are no longer needed
|
|
||||||
- since their contents have been merged into our new tempfiles.
|
|
||||||
- So delete them. */
|
|
||||||
- flush_tempfiles (start_tempcount);
|
|
||||||
-
|
|
||||||
- /* Now merge the temporary files we created. */
|
|
||||||
-
|
|
||||||
- merge_files (tempfiles, ntemps, outfile);
|
|
||||||
-
|
|
||||||
- free (tempfiles);
|
|
||||||
-
|
|
||||||
- return value;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-/* Assume (and optionally verify) that each input file is sorted;
|
|
||||||
- merge them and output the result.
|
|
||||||
- Returns nonzero if any input file fails to be sorted.
|
|
||||||
-
|
|
||||||
- This version of merging will not work if the number of
|
|
||||||
- input files gets too high. Higher level functions
|
|
||||||
- use it only with a bounded number of input files. */
|
|
||||||
-
|
|
||||||
-int
|
|
||||||
-merge_direct (char **infiles, int nfiles, char *outfile)
|
|
||||||
-{
|
|
||||||
- struct linebuffer *lb1, *lb2;
|
|
||||||
- struct linebuffer **thisline, **prevline;
|
|
||||||
- FILE **streams;
|
|
||||||
- int i;
|
|
||||||
- int nleft;
|
|
||||||
- int lossage = 0;
|
|
||||||
- int *file_lossage;
|
|
||||||
- struct linebuffer *prev_out = 0;
|
|
||||||
- FILE *ostream = stdout;
|
|
||||||
-
|
|
||||||
- if (outfile)
|
|
||||||
- {
|
|
||||||
- ostream = fopen (outfile, "w");
|
|
||||||
- }
|
|
||||||
- if (!ostream)
|
|
||||||
- pfatal_with_name (outfile);
|
|
||||||
-
|
|
||||||
- init_index ();
|
|
||||||
-
|
|
||||||
- if (nfiles == 0)
|
|
||||||
- {
|
|
||||||
- if (outfile)
|
|
||||||
- fclose (ostream);
|
|
||||||
- return 0;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- /* For each file, make two line buffers. Also, for each file, there
|
|
||||||
- is an element of `thisline' which points at any time to one of the
|
|
||||||
- file's two buffers, and an element of `prevline' which points to
|
|
||||||
- the other buffer. `thisline' is supposed to point to the next
|
|
||||||
- available line from the file, while `prevline' holds the last file
|
|
||||||
- line used, which is remembered so that we can verify that the file
|
|
||||||
- is properly sorted. */
|
|
||||||
-
|
|
||||||
- /* lb1 and lb2 contain one buffer each per file. */
|
|
||||||
- lb1 = (struct linebuffer *) xmalloc (nfiles * sizeof (struct linebuffer));
|
|
||||||
- lb2 = (struct linebuffer *) xmalloc (nfiles * sizeof (struct linebuffer));
|
|
||||||
-
|
|
||||||
- /* thisline[i] points to the linebuffer holding the next available
|
|
||||||
- line in file i, or is zero if there are no lines left in that file. */
|
|
||||||
- thisline = (struct linebuffer **)
|
|
||||||
- xmalloc (nfiles * sizeof (struct linebuffer *));
|
|
||||||
- /* prevline[i] points to the linebuffer holding the last used line
|
|
||||||
- from file i. This is just for verifying that file i is properly
|
|
||||||
- sorted. */
|
|
||||||
- prevline = (struct linebuffer **)
|
|
||||||
- xmalloc (nfiles * sizeof (struct linebuffer *));
|
|
||||||
- /* streams[i] holds the input stream for file i. */
|
|
||||||
- streams = (FILE **) xmalloc (nfiles * sizeof (FILE *));
|
|
||||||
- /* file_lossage[i] is nonzero if we already know file i is not
|
|
||||||
- properly sorted. */
|
|
||||||
- file_lossage = (int *) xmalloc (nfiles * sizeof (int));
|
|
||||||
-
|
|
||||||
- /* Allocate and initialize all that storage. */
|
|
||||||
-
|
|
||||||
- for (i = 0; i < nfiles; i++)
|
|
||||||
- {
|
|
||||||
- initbuffer (&lb1[i]);
|
|
||||||
- initbuffer (&lb2[i]);
|
|
||||||
- thisline[i] = &lb1[i];
|
|
||||||
- prevline[i] = &lb2[i];
|
|
||||||
- file_lossage[i] = 0;
|
|
||||||
- streams[i] = fopen (infiles[i], "r");
|
|
||||||
- if (!streams[i])
|
|
||||||
- pfatal_with_name (infiles[i]);
|
|
||||||
-
|
|
||||||
- readline (thisline[i], streams[i]);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- /* Keep count of number of files not at eof. */
|
|
||||||
- nleft = nfiles;
|
|
||||||
-
|
|
||||||
- while (nleft)
|
|
||||||
- {
|
|
||||||
- struct linebuffer *best = 0;
|
|
||||||
- struct linebuffer *exch;
|
|
||||||
- int bestfile = -1;
|
|
||||||
- int i;
|
|
||||||
-
|
|
||||||
- /* Look at the next avail line of each file; choose the least one. */
|
|
||||||
-
|
|
||||||
- for (i = 0; i < nfiles; i++)
|
|
||||||
- {
|
|
||||||
- if (thisline[i] &&
|
|
||||||
- (!best ||
|
|
||||||
- 0 < compare_general (best->buffer, thisline[i]->buffer,
|
|
||||||
- (long) bestfile, (long) i, num_keyfields)))
|
|
||||||
- {
|
|
||||||
- best = thisline[i];
|
|
||||||
- bestfile = i;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- /* Output that line, unless it matches the previous one and we
|
|
||||||
- don't want duplicates. */
|
|
||||||
-
|
|
||||||
- if (!(prev_out &&
|
|
||||||
- !compare_general (prev_out->buffer,
|
|
||||||
- best->buffer, 0L, 1L, num_keyfields - 1)))
|
|
||||||
- indexify (best->buffer, ostream);
|
|
||||||
- prev_out = best;
|
|
||||||
-
|
|
||||||
- /* Now make the line the previous of its file, and fetch a new
|
|
||||||
- line from that file. */
|
|
||||||
-
|
|
||||||
- exch = prevline[bestfile];
|
|
||||||
- prevline[bestfile] = thisline[bestfile];
|
|
||||||
- thisline[bestfile] = exch;
|
|
||||||
-
|
|
||||||
- while (1)
|
|
||||||
- {
|
|
||||||
- /* If the file has no more, mark it empty. */
|
|
||||||
-
|
|
||||||
- if (feof (streams[bestfile]))
|
|
||||||
- {
|
|
||||||
- thisline[bestfile] = 0;
|
|
||||||
- /* Update the number of files still not empty. */
|
|
||||||
- nleft--;
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- readline (thisline[bestfile], streams[bestfile]);
|
|
||||||
- if (thisline[bestfile]->buffer[0] || !feof (streams[bestfile]))
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- finish_index (ostream);
|
|
||||||
-
|
|
||||||
- /* Free all storage and close all input streams. */
|
|
||||||
-
|
|
||||||
- for (i = 0; i < nfiles; i++)
|
|
||||||
- {
|
|
||||||
- fclose (streams[i]);
|
|
||||||
- free (lb1[i].buffer);
|
|
||||||
- free (lb2[i].buffer);
|
|
||||||
- }
|
|
||||||
- free (file_lossage);
|
|
||||||
- free (lb1);
|
|
||||||
- free (lb2);
|
|
||||||
- free (thisline);
|
|
||||||
- free (prevline);
|
|
||||||
- free (streams);
|
|
||||||
-
|
|
||||||
- if (outfile)
|
|
||||||
- fclose (ostream);
|
|
||||||
-
|
|
||||||
- return lossage;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
/* Print error message and exit. */
|
|
||||||
|
|
||||||
void
|
|
15
texinfo.spec
15
texinfo.spec
@ -1,16 +1,14 @@
|
|||||||
Summary: Tools needed to create Texinfo format documentation files
|
Summary: Tools needed to create Texinfo format documentation files
|
||||||
Name: texinfo
|
Name: texinfo
|
||||||
Version: 4.9
|
Version: 4.11
|
||||||
Release: 2%{?dist}
|
Release: 1%{?dist}
|
||||||
License: GPLv3
|
License: GPLv3
|
||||||
Group: Applications/Publishing
|
Group: Applications/Publishing
|
||||||
Url: http://www.gnu.org/software/texinfo/
|
Url: http://www.gnu.org/software/texinfo/
|
||||||
Source0: ftp://ftp.gnu.org/gnu/texinfo/texinfo-%{version}.tar.bz2
|
Source0: ftp://ftp.gnu.org/gnu/texinfo/texinfo-%{version}.tar.bz2
|
||||||
Source1: info-dir
|
Source1: info-dir
|
||||||
Source2: texi2pdf.man
|
Source2: texi2pdf.man
|
||||||
Patch0: texinfo-4.8-zlib.patch
|
Patch0: texinfo-4.11-zlib.patch
|
||||||
Patch1: texinfo-4.9-texindex.patch
|
|
||||||
Patch2: texinfo-4.8-0xA0.patch
|
|
||||||
Requires(post): /sbin/install-info
|
Requires(post): /sbin/install-info
|
||||||
Requires(preun): /sbin/install-info
|
Requires(preun): /sbin/install-info
|
||||||
Buildroot: %{_tmppath}/%{name}-%{version}-root
|
Buildroot: %{_tmppath}/%{name}-%{version}-root
|
||||||
@ -61,8 +59,6 @@ for printing using TeX.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1 -b .zlib
|
%patch0 -p1 -b .zlib
|
||||||
%patch1 -p1 -b .texindex
|
|
||||||
%patch2 -p1 -b .0xA0
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
@ -140,6 +136,11 @@ fi
|
|||||||
%{_mandir}/man1/texi2pdf.1*
|
%{_mandir}/man1/texi2pdf.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Sep 19 2007 Vitezslav Crhonek <vcrhonek@redhat.com> - 4.11-1
|
||||||
|
- Rebase to upstream texinfo-4.11 (update zlib.patch, drop
|
||||||
|
texindex.patch and 0xA0.patch -- both included in upstream)
|
||||||
|
Resolves: #295441
|
||||||
|
|
||||||
* Tue Aug 28 2007 Vitezslav Crhonek <vcrhonek@redhat.com> - 4.9-2
|
* Tue Aug 28 2007 Vitezslav Crhonek <vcrhonek@redhat.com> - 4.9-2
|
||||||
- Fix license
|
- Fix license
|
||||||
- Rebuild
|
- Rebuild
|
||||||
|
Loading…
Reference in New Issue
Block a user