SHA256
3
0
forked from pool/texinfo
Dominique Leuenberger 2019-10-07 11:37:58 +00:00 committed by Git OBS Bridge
parent c7f35f0a50
commit 84aa727c4e
3 changed files with 139 additions and 90 deletions

View File

@ -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/Makefile.in | 2 -
texinfo-6.6/install-info/install-info.c | 56 +++++++++++++++++++++++++++----- texinfo-6.6/install-info/install-info.c | 54 ++++++++++++++++++++++++--------
2 files changed, 49 insertions(+), 9 deletions(-) 2 files changed, 42 insertions(+), 14 deletions(-)
--- texinfo-6.6/install-info/Makefile.in --- 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)" @@ -218,7 +218,7 @@ am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS) PROGRAMS = $(bin_PROGRAMS)
am_ginstall_info_OBJECTS = install-info.$(OBJEXT) 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 \ ginstall_info_DEPENDENCIES = $(top_builddir)/gnulib/lib/libgnu.a \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
--- texinfo-6.6/install-info/install-info.c --- 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 @@ @@ -19,6 +19,7 @@
#include <getopt.h> #include <getopt.h>
#include <regex.h> #include <regex.h>
@ -26,81 +26,52 @@ Index: texinfo-6.6/install-info/Makefile.in
#define TAB_WIDTH 8 #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; if (*compression_program)
f = fopen (*opened_filename, FOPEN_RBIN); - { /* It's compressed, so open a pipe. */
+ if (!compression_program) - char *command = concat (*compression_program, " -d", "");
+ compression_program = &local_compression_program; -
+ *compression_program = NULL;
+ if (f)
+ { + {
+ nread = fread (data, sizeof (data), 1, f); if (fclose (f) < 0)
+ if (nread == 1) return 0;
+ { - f = freopen (*opened_filename, FOPEN_RBIN, stdin);
+ if (data[0] == '\x1f' && data[1] == '\x8b') - if (!f)
+ *compression_program = "gzip"; - return 0;
+ else if (data[0] == '\x1f' && data[1] == '\x9d') - f = popen (command, "r");
+ *compression_program = "gzip"; + if (**compression_program == 'g' || **compression_program == 'z')
+ else if (data[0] == '\x1f' && data[1] == '\x9e') + f = fzopen (*opened_filename, "rg");
+ *compression_program = "gzip"; + if (**compression_program == 'b')
+ else if (data[0] == 'B' && data[1] == 'Z' && data[2] == 'h') + f = fzopen (*opened_filename, "rb");
+ *compression_program = "bzip2"; + if (**compression_program == 'Z')
+ } + f = fzopen (*opened_filename, "rZ");
+ fclose (f); + if (**compression_program == 'l')
+ f = fzopen (*opened_filename, FOPEN_RBIN); + f = fzopen (*opened_filename, "rl");
+ } + if (**compression_program == 'x')
if (!f) + f = fzopen (*opened_filename, "rx");
{ if (!f)
*opened_filename = concat (filename, ".gz", ""); - {
- f = fopen (*opened_filename, FOPEN_RBIN); - /* Used for error message in calling code. */
+ f = fzopen (*opened_filename, FOPEN_RBIN); - *opened_filename = command;
+ *compression_program = "gzip"; - 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) else
{ @@ -958,8 +972,22 @@ output_dirfile (char *dirfile, int dir_n
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
if (compression_program) if (compression_program)
{ {

View File

@ -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> Wed Aug 28 08:24:13 UTC 2019 - Dr. Werner Fink <werner@suse.de>

View File

@ -51,8 +51,6 @@ Requires: texlive-makeindex
Requires: texlive-pdftex Requires: texlive-pdftex
Requires: texlive-tex Requires: texlive-tex
Requires: texlive-texinfo Requires: texlive-texinfo
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
Recommends: texi2html Recommends: texi2html
Recommends: texi2roff Recommends: texi2roff
@ -68,6 +66,7 @@ makeinfo tool.
%package -n info %package -n info
Summary: A Stand-Alone Terminal-Based Info Browser Summary: A Stand-Alone Terminal-Based Info Browser
Group: Productivity/Publishing/Texinfo Group: Productivity/Publishing/Texinfo
Requires: gzip
%description -n info %description -n info
Info is a terminal-based program for reading documentation of computer 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 on-line manuals in the Info format, so you need a program called "Info
reader" to read the manuals. 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 %package -n makeinfo
Summary: Translator for converting texinfo documents to info format Summary: Translator for converting texinfo documents to info format
# /usr/share/texinfo/Texinfo/Convert/NodeNameNormalization.pm uses Text::Unidecode # /usr/share/texinfo/Texinfo/Convert/NodeNameNormalization.pm uses Text::Unidecode
@ -91,7 +102,7 @@ or standalone GNU Info.
%prep %prep
%setup -q %setup -q
%patch1 -p1 -b .p1 %patch1 -p1 -b .zio
%patch2 -p1 %patch2 -p1
%build %build
@ -130,17 +141,51 @@ LANG=en_GB.UTF-8
export LANG export LANG
make %{?_smp_mflags} check make %{?_smp_mflags} check
%post %filetriggerin -n info -p <lua> -- %{_infodir}
%install_info --info-dir=%{_infodir} %{_infodir}/texinfo.info%{ext_info} -- 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 %filetriggerun -n info -p <lua> -- %{_infodir}
%install_info_delete --info-dir=%{_infodir} %{_infodir}/texinfo.info%{ext_info} -- TODO: replace with rpm.execute after rpm 4.15
function execute(path, ...)
%post -n info local pid = posix.fork()
%install_info --info-dir=%{_infodir} %{_infodir}/info-stnd.info%{ext_info} if pid == 0 then
posix.exec(path, ...)
%preun -n info io.write(path, ": exec failed: ", posix.errno(), "\n")
%install_info_delete --info-dir=%{_infodir} %{_infodir}/info-stnd.info%{ext_info} 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 %files -f %{name}_document.lang
%defattr(-,root,root,0755) %defattr(-,root,root,0755)
@ -177,9 +222,12 @@ make %{?_smp_mflags} check
/sbin/install-info /sbin/install-info
%{_bindir}/install-info %{_bindir}/install-info
%{_bindir}/info %{_bindir}/info
%{_infodir}/info-stnd.info%{?ext_info}
%{_mandir}/man1/info.1%{?ext_man} %{_mandir}/man1/info.1%{?ext_man}
%{_mandir}/man1/install-info.1%{?ext_man} %{_mandir}/man1/install-info.1%{?ext_man}
%{_mandir}/man5/info.5%{?ext_man} %{_mandir}/man5/info.5%{?ext_man}
%files -n info-std
%defattr(-,root,root,0755)
%{_infodir}/info-stnd.info%{?ext_info}
%changelog %changelog