From ea330f611c8c54caaf56a78cd3b4c869891c81ae Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Wed, 22 Jun 2016 15:09:54 +0200 Subject: [PATCH] install-info: use create-tmp-then-rename pattern because of OSTree --- ...o-use-create-tmp-then-rename-pattern.patch | 44 +++++++++++++++++++ texinfo.spec | 10 ++++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 texinfo-6.0-install-info-use-create-tmp-then-rename-pattern.patch diff --git a/texinfo-6.0-install-info-use-create-tmp-then-rename-pattern.patch b/texinfo-6.0-install-info-use-create-tmp-then-rename-pattern.patch new file mode 100644 index 0000000..b5339ea --- /dev/null +++ b/texinfo-6.0-install-info-use-create-tmp-then-rename-pattern.patch @@ -0,0 +1,44 @@ +diff -up texinfo-6.0/install-info/install-info.c.orig texinfo-6.0/install-info/install-info.c +--- texinfo-6.0/install-info/install-info.c.orig 2016-06-22 15:21:04.000000000 +0200 ++++ texinfo-6.0/install-info/install-info.c 2016-06-22 15:22:13.340282906 +0200 +@@ -954,18 +954,23 @@ output_dirfile (char *dirfile, int dir_n + int n_entries_added = 0; + int i; + FILE *output; ++ char *dirfile_tmp = NULL; ++ ++ asprintf (&dirfile_tmp, "%s.tmp", dirfile); ++ if (!dirfile_tmp) ++ xalloc_die (); + + if (compression_program) + { +- char *command = concat (compression_program, ">", dirfile); ++ char *command = concat (compression_program, ">", dirfile_tmp); + output = popen (command, "w"); + } + else +- output = fopen (dirfile, "w"); ++ output = fopen (dirfile_tmp, "w"); + + if (!output) + { +- perror (dirfile); ++ perror (dirfile_tmp); + exit (EXIT_FAILURE); + } + +@@ -1076,6 +1081,13 @@ output_dirfile (char *dirfile, int dir_n + pclose (output); + else + fclose (output); ++ ++ if (rename (dirfile_tmp, dirfile) < 0) ++ { ++ perror (dirfile_tmp); ++ exit (EXIT_FAILURE); ++ } ++ free (dirfile_tmp); + } + + /* Parse the input to find the section names and the entry names it diff --git a/texinfo.spec b/texinfo.spec index 8b5d617..ae10297 100644 --- a/texinfo.spec +++ b/texinfo.spec @@ -5,7 +5,7 @@ Summary: Tools needed to create Texinfo format documentation files Name: texinfo Version: 6.0 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3+ Group: Applications/Publishing Url: http://www.gnu.org/software/texinfo/ @@ -22,6 +22,8 @@ Patch0: texinfo-4.12-zlib.patch Patch1: texinfo-6.0-disable-failing-info-test.patch # bz#1305062 already upstream Patch2: texinfo-6.0-mouse-protocol.patch +# Patch3: rhbz#1348671, because of OSTree +Patch3: texinfo-6.0-install-info-use-create-tmp-then-rename-pattern.patch Requires(post): /sbin/install-info Requires(preun): /sbin/install-info Requires: perl >= 5.7.3, perl(Text::Unidecode) @@ -71,6 +73,7 @@ for printing using TeX. %patch0 -p1 -b .zlib %patch1 -p1 -b .disable-failing-info-test %patch2 -p1 -b .mouse-protocol +%patch3 -p1 -b .install-info-use-create-tmp-then-rename-pattern %build %configure --with-external-Text-Unidecode \ @@ -173,6 +176,11 @@ fi %{_mandir}/man1/pdftexi2dvi.1* %changelog +* Wed Jun 22 2016 Vitezslav Crhonek - 6.0-3 +- install-info: use create-tmp-then-rename pattern because of OSTree + (patch by Colin Walters) + Resolves: #1348671 + * Tue Feb 09 2016 Vitezslav Crhonek - 6.0-2 - Fix mouse no longer works with info Resolves: #1305062