From 45947a6508bb72414cc2695ad5342ae26b36e55c547a51225b02ddc3d038ca08 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Fri, 5 Aug 2022 17:49:32 +0000 Subject: [PATCH] - In case of an update of package info: do never remove existing info page from dir file (boo#1201852) - Do lua scripting only once for execute() function - Check for filetrigger lua scriplets if rpm.execute() as function call is given and used this OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/texinfo?expand=0&rev=65 --- texinfo.changes | 17 +++++++++++++ texinfo.spec | 63 ++++++++++++++++++++++++------------------------- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/texinfo.changes b/texinfo.changes index 4fc6afc..d006306 100644 --- a/texinfo.changes +++ b/texinfo.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Wed Aug 3 08:30:34 UTC 2022 - Dr. Werner Fink + +- In case of an update of package info: do never remove existing + info page from dir file (boo#1201852) + +------------------------------------------------------------------- +Fri Jul 29 12:14:22 UTC 2022 - Dr. Werner Fink + +- Do lua scripting only once for execute() function + +------------------------------------------------------------------- +Wed Jul 27 07:39:30 UTC 2022 - Dr. Werner Fink + +- Check for filetrigger lua scriplets if rpm.execute() as function + call is given and used this + ------------------------------------------------------------------- Tue Apr 26 13:37:31 UTC 2022 - Ferdinand Thiessen diff --git a/texinfo.spec b/texinfo.spec index f34a9c9..7c5cca3 100644 --- a/texinfo.spec +++ b/texinfo.spec @@ -129,7 +129,7 @@ fi if cmp %{buildroot}%{_mandir}/man1/pdftexi2dvi.1 %{buildroot}%{_mandir}/man1/texi2pdf.1 then rm -vf %{buildroot}%{_mandir}/man1/pdftexi2dvi.1 - ln -sf texi2pdf.1.gz %{buildroot}%{_mandir}/man1/pdftexi2dvi.1.gz + ln -sf texi2pdf.1%{?ext_man} %{buildroot}%{_mandir}/man1/pdftexi2dvi.1%{?ext_man} fi %if !0%{?usrmerged} @@ -150,48 +150,47 @@ LANG=en_GB.UTF-8 export LANG make %{?_smp_mflags} check -%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) +%global trigger_functions %{expand: +-- Check if rpm.execute() as function call is given +if type(rpm.execute) == "function" then + execute = rpm.execute +else + function execute(path, ...) + local pid = posix.fork() + if not pid then + error(path .. ": fork failed: " .. posix.errno() .. "\n") + elseif pid == 0 then + assert(posix.exec(path, ...)) + else + posix.wait(pid) + end end - if not pid then - error(path .. ": fork failed: " .. posix.errno() .. "\n") - end - posix.wait(pid) end -- +} + +%filetriggerin -n info -p -- %{_infodir} +%trigger_functions file = rpm.next_file() while file do - if string.match(file, "%%.info%%.gz$") then - execute("%{_bindir}/install-info", "--info-dir=%{_infodir}", file) + if string.match(file, "%%.info%%%{ext_info}$") then + stat = posix.stat(file) + if stat then + execute("%{_bindir}/install-info", "--info-dir=%{_infodir}", file) + end end file = rpm.next_file() end %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 --- +%trigger_functions file = rpm.next_file() while file do - if string.match(file, "%%.info%%.gz$") then - execute("%{_bindir}/install-info", "--quiet", "--delete", "--info-dir=%{_infodir}", file) + if string.match(file, "%%.info%%%{ext_info}$") then + stat = posix.stat(file) + if not stat then + execute("%{_bindir}/install-info", "--quiet", "--delete", "--info-dir=%{_infodir}", file) + end end file = rpm.next_file() end @@ -231,7 +230,7 @@ end %files -n info %defattr(-,root,root,0755) -%ghost %verify(not md5 size mtime) %{_infodir}/dir +%ghost %verify(not mode md5 size mtime) %{_infodir}/dir %if !0%{?usrmerged} /sbin/install-info %else