summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch')
-rw-r--r--meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch187
1 files changed, 187 insertions, 0 deletions
diff --git a/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch b/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
new file mode 100644
index 0000000000..bebcbdf8da
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
@@ -0,0 +1,187 @@
1Upstream-Status: Pending
2
3Index: texinfo-5.1/install-info/Makefile.in
4===================================================================
5--- texinfo-5.1.orig/install-info/Makefile.in
6+++ texinfo-5.1/install-info/Makefile.in
7@@ -171,7 +171,7 @@ am__installdirs = "$(DESTDIR)$(bindir)"
8 PROGRAMS = $(bin_PROGRAMS)
9 am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
10 ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS)
11-ginstall_info_LDADD = $(LDADD)
12+ginstall_info_LDADD = $(LDADD) -lz
13 am__DEPENDENCIES_1 =
14 ginstall_info_DEPENDENCIES = $(top_builddir)/gnulib/lib/libgnu.a \
15 $(am__DEPENDENCIES_1)
16Index: texinfo-5.1/install-info/install-info.c
17===================================================================
18--- texinfo-5.1.orig/install-info/install-info.c
19+++ texinfo-5.1/install-info/install-info.c
20@@ -22,6 +22,7 @@
21 #include <getopt.h>
22 #include <regex.h>
23 #include <argz.h>
24+#include <zlib.h>
25
26 #define TAB_WIDTH 8
27
28@@ -670,7 +671,7 @@ The first time you invoke Info you start
29
30 MAGIC number, not the filename. */
31
32-FILE *
33+void *
34 open_possibly_compressed_file (char *filename,
35 void (*create_callback) (char *),
36 char **opened_filename, char **compression_program, int *is_pipe)
37@@ -678,7 +679,7 @@ open_possibly_compressed_file (char *fil
38 char *local_opened_filename, *local_compression_program;
39 int nread;
40 char data[13];
41- FILE *f;
42+ gzFile *f;
43
44 /* We let them pass NULL if they don't want this info, but it's easier
45 to always determine it. */
46@@ -686,48 +687,48 @@ open_possibly_compressed_file (char *fil
47 opened_filename = &local_opened_filename;
48
49 *opened_filename = filename;
50- f = fopen (*opened_filename, FOPEN_RBIN);
51+ f = gzopen (*opened_filename, FOPEN_RBIN);
52 if (!f)
53 {
54 *opened_filename = concat (filename, ".gz", "");
55- f = fopen (*opened_filename, FOPEN_RBIN);
56+ f = gzopen (*opened_filename, FOPEN_RBIN);
57 }
58 if (!f)
59 {
60 free (*opened_filename);
61 *opened_filename = concat (filename, ".xz", "");
62- f = fopen (*opened_filename, FOPEN_RBIN);
63+ f = gzopen (*opened_filename, FOPEN_RBIN);
64 }
65 if (!f)
66 {
67 free (*opened_filename);
68 *opened_filename = concat (filename, ".bz2", "");
69- f = fopen (*opened_filename, FOPEN_RBIN);
70+ f = gzopen (*opened_filename, FOPEN_RBIN);
71 }
72 if (!f)
73 {
74 free (*opened_filename);
75 *opened_filename = concat (filename, ".lz", "");
76- f = fopen (*opened_filename, FOPEN_RBIN);
77+ f = gzopen (*opened_filename, FOPEN_RBIN);
78 }
79 if (!f)
80 {
81 free (*opened_filename);
82 *opened_filename = concat (filename, ".lzma", "");
83- f = fopen (*opened_filename, FOPEN_RBIN);
84+ f = gzopen (*opened_filename, FOPEN_RBIN);
85 }
86 #ifdef __MSDOS__
87 if (!f)
88 {
89 free (*opened_filename);
90 *opened_filename = concat (filename, ".igz", "");
91- f = fopen (*opened_filename, FOPEN_RBIN);
92+ f = gzopen (*opened_filename, FOPEN_RBIN);
93 }
94 if (!f)
95 {
96 free (*opened_filename);
97 *opened_filename = concat (filename, ".inz", "");
98- f = fopen (*opened_filename, FOPEN_RBIN);
99+ f = gzopen (*opened_filename, FOPEN_RBIN);
100 }
101 #endif /* __MSDOS__ */
102 if (!f)
103@@ -739,7 +740,7 @@ open_possibly_compressed_file (char *fil
104 /* And try opening it again. */
105 free (*opened_filename);
106 *opened_filename = filename;
107- f = fopen (*opened_filename, FOPEN_RBIN);
108+ f = gzopen (*opened_filename, FOPEN_RBIN);
109 if (!f)
110 pfatal_with_name (filename);
111 }
112@@ -749,12 +750,12 @@ open_possibly_compressed_file (char *fil
113
114 /* Read first few bytes of file rather than relying on the filename.
115 If the file is shorter than this it can't be usable anyway. */
116- nread = fread (data, sizeof (data), 1, f);
117- if (nread != 1)
118+ nread = gzread (f, data, sizeof (data));
119+ if (nread != sizeof (data))
120 {
121 /* Empty files don't set errno, so we get something like
122 "install-info: No error for foo", which is confusing. */
123- if (nread == 0)
124+ if (nread >= 0)
125 fatal (_("%s: empty file"), *opened_filename);
126 pfatal_with_name (*opened_filename);
127 }
128@@ -821,20 +822,22 @@ open_possibly_compressed_file (char *fil
129
130 if (*compression_program)
131 { /* It's compressed, so fclose the file and then open a pipe. */
132+ FILE *p;
133 char *command = concat (*compression_program," -cd <", *opened_filename);
134- if (fclose (f) < 0)
135+ if (gzclose (f) < 0)
136 pfatal_with_name (*opened_filename);
137- f = popen (command, "r");
138- if (f)
139+ p = popen (command, "r");
140+ if (p)
141 *is_pipe = 1;
142 else
143 pfatal_with_name (command);
144+ return p;
145 }
146 else
147 { /* It's a plain file, seek back over the magic bytes. */
148- if (fseek (f, 0, 0) < 0)
149+ if (gzseek (f, 0, SEEK_SET) < 0)
150 pfatal_with_name (*opened_filename);
151-#if O_BINARY
152+#if 0 && O_BINARY
153 /* Since this is a text file, and we opened it in binary mode,
154 switch back to text mode. */
155 f = freopen (*opened_filename, "r", f);
156@@ -859,7 +862,7 @@ readfile (char *filename, int *sizep,
157 char **compression_program)
158 {
159 char *real_name;
160- FILE *f;
161+ void *f;
162 int pipe_p;
163 int filled = 0;
164 int data_size = 8192;
165@@ -873,7 +876,12 @@ readfile (char *filename, int *sizep,
166
167 for (;;)
168 {
169- int nread = fread (data + filled, 1, data_size - filled, f);
170+ int nread;
171+
172+ if (pipe_p)
173+ nread = fread (data + filled, 1, data_size - filled, f);
174+ else
175+ nread = gzread (f, data + filled, data_size - filled);
176 if (nread < 0)
177 pfatal_with_name (real_name);
178 if (nread == 0)
179@@ -895,7 +903,7 @@ readfile (char *filename, int *sizep,
180 if (pipe_p)
181 pclose (f);
182 else
183- fclose (f);
184+ gzclose (f);
185
186 *sizep = filled;
187 return data;