forked from pool/texinfo
This commit is contained in:
parent
c7f35f0a50
commit
84aa727c4e
@ -2,11 +2,11 @@ Index: texinfo-6.6/install-info/Makefile.in
|
||||
===================================================================
|
||||
---
|
||||
texinfo-6.6/install-info/Makefile.in | 2 -
|
||||
texinfo-6.6/install-info/install-info.c | 56 +++++++++++++++++++++++++++-----
|
||||
2 files changed, 49 insertions(+), 9 deletions(-)
|
||||
texinfo-6.6/install-info/install-info.c | 54 ++++++++++++++++++++++++--------
|
||||
2 files changed, 42 insertions(+), 14 deletions(-)
|
||||
|
||||
--- texinfo-6.6/install-info/Makefile.in
|
||||
+++ texinfo-6.6/install-info/Makefile.in 2019-08-27 13:50:21.423140298 +0000
|
||||
+++ texinfo-6.6/install-info/Makefile.in 2019-09-27 08:03:19.381937177 +0000
|
||||
@@ -218,7 +218,7 @@ am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
|
||||
@ -17,7 +17,7 @@ Index: texinfo-6.6/install-info/Makefile.in
|
||||
ginstall_info_DEPENDENCIES = $(top_builddir)/gnulib/lib/libgnu.a \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
--- texinfo-6.6/install-info/install-info.c
|
||||
+++ texinfo-6.6/install-info/install-info.c 2019-08-27 13:51:57.493361483 +0000
|
||||
+++ texinfo-6.6/install-info/install-info.c 2019-09-27 08:52:36.071070583 +0000
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <getopt.h>
|
||||
#include <regex.h>
|
||||
@ -26,81 +26,52 @@ Index: texinfo-6.6/install-info/Makefile.in
|
||||
|
||||
#define TAB_WIDTH 8
|
||||
|
||||
@@ -698,34 +699,59 @@ open_possibly_compressed_file (char *fil
|
||||
@@ -858,20 +859,33 @@ determine_file_type:
|
||||
return 0;
|
||||
|
||||
*opened_filename = filename;
|
||||
f = fopen (*opened_filename, FOPEN_RBIN);
|
||||
+ if (!compression_program)
|
||||
+ compression_program = &local_compression_program;
|
||||
+ *compression_program = NULL;
|
||||
+ if (f)
|
||||
if (*compression_program)
|
||||
- { /* It's compressed, so open a pipe. */
|
||||
- char *command = concat (*compression_program, " -d", "");
|
||||
-
|
||||
+ {
|
||||
+ nread = fread (data, sizeof (data), 1, f);
|
||||
+ if (nread == 1)
|
||||
+ {
|
||||
+ if (data[0] == '\x1f' && data[1] == '\x8b')
|
||||
+ *compression_program = "gzip";
|
||||
+ else if (data[0] == '\x1f' && data[1] == '\x9d')
|
||||
+ *compression_program = "gzip";
|
||||
+ else if (data[0] == '\x1f' && data[1] == '\x9e')
|
||||
+ *compression_program = "gzip";
|
||||
+ else if (data[0] == 'B' && data[1] == 'Z' && data[2] == 'h')
|
||||
+ *compression_program = "bzip2";
|
||||
+ }
|
||||
+ fclose (f);
|
||||
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
||||
+ }
|
||||
if (!f)
|
||||
{
|
||||
*opened_filename = concat (filename, ".gz", "");
|
||||
- f = fopen (*opened_filename, FOPEN_RBIN);
|
||||
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
||||
+ *compression_program = "gzip";
|
||||
if (fclose (f) < 0)
|
||||
return 0;
|
||||
- f = freopen (*opened_filename, FOPEN_RBIN, stdin);
|
||||
- if (!f)
|
||||
- return 0;
|
||||
- f = popen (command, "r");
|
||||
+ if (**compression_program == 'g' || **compression_program == 'z')
|
||||
+ f = fzopen (*opened_filename, "rg");
|
||||
+ if (**compression_program == 'b')
|
||||
+ f = fzopen (*opened_filename, "rb");
|
||||
+ if (**compression_program == 'Z')
|
||||
+ f = fzopen (*opened_filename, "rZ");
|
||||
+ if (**compression_program == 'l')
|
||||
+ f = fzopen (*opened_filename, "rl");
|
||||
+ if (**compression_program == 'x')
|
||||
+ f = fzopen (*opened_filename, "rx");
|
||||
if (!f)
|
||||
- {
|
||||
- /* Used for error message in calling code. */
|
||||
- *opened_filename = command;
|
||||
- return 0;
|
||||
+ { /* It's compressed, so open a pipe. */
|
||||
+ char *command = concat (*compression_program, " -d", "");
|
||||
+
|
||||
+ f = freopen (*opened_filename, FOPEN_RBIN, stdin);
|
||||
+ if (!f)
|
||||
+ return 0;
|
||||
+ f = popen (command, "r");
|
||||
+ if (!f)
|
||||
+ {
|
||||
+ /* Used for error message in calling code. */
|
||||
+ *opened_filename = command;
|
||||
+ return 0;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
if (!f)
|
||||
{
|
||||
free (*opened_filename);
|
||||
*opened_filename = concat (filename, ".xz", "");
|
||||
- f = fopen (*opened_filename, FOPEN_RBIN);
|
||||
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
||||
+ *compression_program = "xz";
|
||||
}
|
||||
if (!f)
|
||||
{
|
||||
free (*opened_filename);
|
||||
*opened_filename = concat (filename, ".bz2", "");
|
||||
- f = fopen (*opened_filename, FOPEN_RBIN);
|
||||
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
||||
+ *compression_program = "bzip2";
|
||||
}
|
||||
if (!f)
|
||||
{
|
||||
free (*opened_filename);
|
||||
*opened_filename = concat (filename, ".lz", "");
|
||||
- f = fopen (*opened_filename, FOPEN_RBIN);
|
||||
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
||||
+ *compression_program = "lzma";
|
||||
}
|
||||
if (!f)
|
||||
{
|
||||
free (*opened_filename);
|
||||
*opened_filename = concat (filename, ".lzma", "");
|
||||
- f = fopen (*opened_filename, FOPEN_RBIN);
|
||||
+ f = fzopen (*opened_filename, FOPEN_RBIN);
|
||||
+ *compression_program = "lzma";
|
||||
}
|
||||
#ifdef __MSDOS__
|
||||
if (!f)
|
||||
@@ -850,7 +876,7 @@ determine_file_type:
|
||||
*compression_program = "lzma";
|
||||
#endif
|
||||
|
||||
- else
|
||||
+ else if (!*compression_program)
|
||||
*compression_program = NULL;
|
||||
|
||||
/* Seek back over the magic bytes. */
|
||||
@@ -958,8 +984,22 @@ output_dirfile (char *dirfile, int dir_n
|
||||
else
|
||||
@@ -958,8 +972,22 @@ output_dirfile (char *dirfile, int dir_n
|
||||
|
||||
if (compression_program)
|
||||
{
|
||||
|
@ -1,3 +1,33 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 27 14:29:01 UTC 2019 - Ludwig Nussel <lnussel@suse.de>
|
||||
|
||||
- use filetrigger instead of transfiletrigger
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 27 10:35:46 UTC 2019 - Dr. Werner Fink <werner@suse.de>
|
||||
|
||||
- Temporary disable %transfiletriggerin/%transfiletriggerun and
|
||||
reintroduce %post/%preun with %install_info/%install_info_delete
|
||||
as libzypp currentyl can not handle first case (boo#1041742)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 27 08:56:50 UTC 2019 - Dr. Werner Fink <werner@suse.de>
|
||||
|
||||
- Fix patch texinfo-zlib.patch to enable open of compressed info
|
||||
files without using a compressor utility (boo#1152105)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 26 12:41:40 UTC 2019 - Dr. Werner Fink <werner@suse.de>
|
||||
|
||||
- For bug boo#1152105 split of the info pages of package info to be
|
||||
able to preinstall gzip before/with first install-info call
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 26 11:53:33 UTC 2019 - Ludwig Nussel <lnussel@suse.de>
|
||||
|
||||
- implement file trigger for installing and removing info pages
|
||||
(boo#1152105)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 28 08:24:13 UTC 2019 - Dr. Werner Fink <werner@suse.de>
|
||||
|
||||
|
76
texinfo.spec
76
texinfo.spec
@ -51,8 +51,6 @@ Requires: texlive-makeindex
|
||||
Requires: texlive-pdftex
|
||||
Requires: texlive-tex
|
||||
Requires: texlive-texinfo
|
||||
Requires(post): %{install_info_prereq}
|
||||
Requires(preun): %{install_info_prereq}
|
||||
Recommends: texi2html
|
||||
Recommends: texi2roff
|
||||
|
||||
@ -68,6 +66,7 @@ makeinfo tool.
|
||||
%package -n info
|
||||
Summary: A Stand-Alone Terminal-Based Info Browser
|
||||
Group: Productivity/Publishing/Texinfo
|
||||
Requires: gzip
|
||||
|
||||
%description -n info
|
||||
Info is a terminal-based program for reading documentation of computer
|
||||
@ -75,6 +74,18 @@ programs in the Info format. The GNU Project distributes most of its
|
||||
on-line manuals in the Info format, so you need a program called "Info
|
||||
reader" to read the manuals.
|
||||
|
||||
%package -n info-std
|
||||
Summary: The info pages of the Info Browser
|
||||
Group: Productivity/Publishing/Texinfo
|
||||
Supplements: packageand(info:patterns-base-documentation)
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n info-std
|
||||
Info is a terminal-based program for reading documentation of computer
|
||||
programs in the Info format. The GNU Project distributes most of its
|
||||
on-line manuals in the Info format, so you need a program called "Info
|
||||
reader" to read the manuals.
|
||||
|
||||
%package -n makeinfo
|
||||
Summary: Translator for converting texinfo documents to info format
|
||||
# /usr/share/texinfo/Texinfo/Convert/NodeNameNormalization.pm uses Text::Unidecode
|
||||
@ -91,7 +102,7 @@ or standalone GNU Info.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1 -b .p1
|
||||
%patch1 -p1 -b .zio
|
||||
%patch2 -p1
|
||||
|
||||
%build
|
||||
@ -130,17 +141,51 @@ LANG=en_GB.UTF-8
|
||||
export LANG
|
||||
make %{?_smp_mflags} check
|
||||
|
||||
%post
|
||||
%install_info --info-dir=%{_infodir} %{_infodir}/texinfo.info%{ext_info}
|
||||
%filetriggerin -n info -p <lua> -- %{_infodir}
|
||||
-- TODO: replace with rpm.execute after rpm 4.15
|
||||
function execute(path, ...)
|
||||
local pid = posix.fork()
|
||||
if pid == 0 then
|
||||
posix.exec(path, ...)
|
||||
io.write(path, ": exec failed: ", posix.errno(), "\n")
|
||||
os.exit(1)
|
||||
end
|
||||
if not pid then
|
||||
error(path .. ": fork failed: " .. posix.errno() .. "\n")
|
||||
end
|
||||
posix.wait(pid)
|
||||
end
|
||||
--
|
||||
file = rpm.next_file()
|
||||
while file do
|
||||
if string.match(file, "%%.info%%.gz$") then
|
||||
execute("/usr/bin/install-info", "--info-dir=%{_infodir}", file)
|
||||
end
|
||||
file = rpm.next_file()
|
||||
end
|
||||
|
||||
%preun
|
||||
%install_info_delete --info-dir=%{_infodir} %{_infodir}/texinfo.info%{ext_info}
|
||||
|
||||
%post -n info
|
||||
%install_info --info-dir=%{_infodir} %{_infodir}/info-stnd.info%{ext_info}
|
||||
|
||||
%preun -n info
|
||||
%install_info_delete --info-dir=%{_infodir} %{_infodir}/info-stnd.info%{ext_info}
|
||||
%filetriggerun -n info -p <lua> -- %{_infodir}
|
||||
-- TODO: replace with rpm.execute after rpm 4.15
|
||||
function execute(path, ...)
|
||||
local pid = posix.fork()
|
||||
if pid == 0 then
|
||||
posix.exec(path, ...)
|
||||
io.write(path, ": exec failed: ", posix.errno(), "\n")
|
||||
os.exit(1)
|
||||
end
|
||||
if not pid then
|
||||
error(path .. ": fork failed: " .. posix.errno() .. "\n")
|
||||
end
|
||||
posix.wait(pid)
|
||||
end
|
||||
--
|
||||
file = rpm.next_file()
|
||||
while file do
|
||||
if string.match(file, "%%.info%%.gz$") then
|
||||
execute("/usr/bin/install-info", "--quiet", "--delete", "--info-dir=%{_infodir}", file)
|
||||
end
|
||||
file = rpm.next_file()
|
||||
end
|
||||
|
||||
%files -f %{name}_document.lang
|
||||
%defattr(-,root,root,0755)
|
||||
@ -177,9 +222,12 @@ make %{?_smp_mflags} check
|
||||
/sbin/install-info
|
||||
%{_bindir}/install-info
|
||||
%{_bindir}/info
|
||||
%{_infodir}/info-stnd.info%{?ext_info}
|
||||
%{_mandir}/man1/info.1%{?ext_man}
|
||||
%{_mandir}/man1/install-info.1%{?ext_man}
|
||||
%{_mandir}/man5/info.5%{?ext_man}
|
||||
|
||||
%files -n info-std
|
||||
%defattr(-,root,root,0755)
|
||||
%{_infodir}/info-stnd.info%{?ext_info}
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user