From 84aa727c4eb3d106aeb1d2674c44dcd26b468b1c6e53fd5a4a12543e1fc164ec Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Mon, 7 Oct 2019 11:37:58 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/texinfo?expand=0&rev=56 --- texinfo-zlib.patch | 123 +++++++++++++++++---------------------------- texinfo.changes | 30 +++++++++++ texinfo.spec | 76 ++++++++++++++++++++++------ 3 files changed, 139 insertions(+), 90 deletions(-) diff --git a/texinfo-zlib.patch b/texinfo-zlib.patch index f2740d1..102733b 100644 --- a/texinfo-zlib.patch +++ b/texinfo-zlib.patch @@ -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 #include @@ -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) { diff --git a/texinfo.changes b/texinfo.changes index 57f2a5f..0ce21fe 100644 --- a/texinfo.changes +++ b/texinfo.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Fri Sep 27 14:29:01 UTC 2019 - Ludwig Nussel + +- use filetrigger instead of transfiletrigger + +------------------------------------------------------------------- +Fri Sep 27 10:35:46 UTC 2019 - Dr. Werner Fink + +- 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 + +- 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 + +- 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 + +- implement file trigger for installing and removing info pages + (boo#1152105) + ------------------------------------------------------------------- Wed Aug 28 08:24:13 UTC 2019 - Dr. Werner Fink diff --git a/texinfo.spec b/texinfo.spec index a7bd256..4285d6f 100644 --- a/texinfo.spec +++ b/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 -- %{_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 -- %{_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