- Added lyx-2.0.6-fix_zombies.patch to fix http://www.lyx.org/trac/ticket/8774.
- Updated name for xdg-open patch (was updated for 2.0.6). - Added texlive-nomencl to Requires as it is also supported by LyX. OBS-URL: https://build.opensuse.org/package/show/Publishing/lyx?expand=0&rev=71
This commit is contained in:
parent
89d4b93629
commit
8fc7614fc0
80
lyx-2.0.6-fix_zombies.patch
Normal file
80
lyx-2.0.6-fix_zombies.patch
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
From 254c5fa439df319e8c71212f946ba74a104be16e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Guy Rutenberg <guyrutenberg@gmail.com>
|
||||||
|
Date: Sat, 6 Jul 2013 16:09:50 +0300
|
||||||
|
Subject: [PATCH] Prevent zobmie process.
|
||||||
|
|
||||||
|
Using Systemcall::startscript() with Starttype::DontWait used to create
|
||||||
|
zombie process, as nobody would collect them. This patch start those
|
||||||
|
process as detached, hence preventing them from becoming zombies.
|
||||||
|
---
|
||||||
|
src/support/Systemcall.cpp | 26 ++++++++++++++++----------
|
||||||
|
src/support/SystemcallPrivate.h | 2 +-
|
||||||
|
2 files changed, 17 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp
|
||||||
|
index ca80409..f689c0b 100644
|
||||||
|
--- a/src/support/Systemcall.cpp
|
||||||
|
+++ b/src/support/Systemcall.cpp
|
||||||
|
@@ -251,19 +251,17 @@ int Systemcall::startscript(Starttype how, string const & what,
|
||||||
|
SystemcallPrivate d(outfile, errfile);
|
||||||
|
|
||||||
|
|
||||||
|
- d.startProcess(cmd, path);
|
||||||
|
- if (!d.waitWhile(SystemcallPrivate::Starting, process_events, -1)) {
|
||||||
|
+ d.startProcess(cmd, path, how == DontWait);
|
||||||
|
+ if (how == DontWait && d.state == SystemcallPrivate::Running) {
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ if (d.state == SystemcallPrivate::Error
|
||||||
|
+ || !d.waitWhile(SystemcallPrivate::Starting, process_events, -1)) {
|
||||||
|
LYXERR0("Systemcall: '" << cmd << "' did not start!");
|
||||||
|
LYXERR0("error " << d.errorMessage());
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (how == DontWait) {
|
||||||
|
- QProcess* released = d.releaseProcess();
|
||||||
|
- (void) released; // TODO who deletes it?
|
||||||
|
- return 0;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
if (!d.waitWhile(SystemcallPrivate::Running, process_events,
|
||||||
|
os::timeout_min() * 60 * 1000)) {
|
||||||
|
LYXERR0("Systemcall: '" << cmd << "' did not finish!");
|
||||||
|
@@ -349,10 +347,18 @@ SystemcallPrivate::SystemcallPrivate(std::string const & sf,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-void SystemcallPrivate::startProcess(QString const & cmd, string const & path)
|
||||||
|
+void SystemcallPrivate::startProcess(QString const & cmd, string const & path, bool detached)
|
||||||
|
{
|
||||||
|
cmd_ = cmd;
|
||||||
|
- if (process_) {
|
||||||
|
+ if (detached) {
|
||||||
|
+ state = SystemcallPrivate::Running;
|
||||||
|
+ if (!QProcess::startDetached(toqstr(latexEnvCmdPrefix(path)) + cmd_)) {
|
||||||
|
+ state = SystemcallPrivate::Error;
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ QProcess* released = releaseProcess();
|
||||||
|
+ delete released;
|
||||||
|
+ } else if (process_) {
|
||||||
|
state = SystemcallPrivate::Starting;
|
||||||
|
process_->start(toqstr(latexEnvCmdPrefix(path)) + cmd_);
|
||||||
|
}
|
||||||
|
diff --git a/src/support/SystemcallPrivate.h b/src/support/SystemcallPrivate.h
|
||||||
|
index b8dc17a..6534d07 100644
|
||||||
|
--- a/src/support/SystemcallPrivate.h
|
||||||
|
+++ b/src/support/SystemcallPrivate.h
|
||||||
|
@@ -45,7 +45,7 @@ public:
|
||||||
|
State state;
|
||||||
|
|
||||||
|
bool waitWhile(State, bool processEvents, int timeout = -1);
|
||||||
|
- void startProcess(QString const & cmd, std::string const & path);
|
||||||
|
+ void startProcess(QString const & cmd, std::string const & path, bool detach);
|
||||||
|
|
||||||
|
int exitCode();
|
||||||
|
|
||||||
|
--
|
||||||
|
1.7.9.5
|
||||||
|
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Aug 1 21:22:25 UTC 2013 - cornelis@solcon.nl
|
||||||
|
|
||||||
|
- Added lyx-2.0.6-fix_zombies.patch to fix http://www.lyx.org/trac/ticket/8774.
|
||||||
|
- Updated name for xdg-open patch (was updated for 2.0.6).
|
||||||
|
- Added texlive-nomencl to Requires as it is also supported by LyX.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon May 6 09:14:37 UTC 2013 - cornelis@solcon.nl
|
Mon May 6 09:14:37 UTC 2013 - cornelis@solcon.nl
|
||||||
|
|
||||||
|
6
lyx.spec
6
lyx.spec
@ -38,7 +38,9 @@ Source2: lyx.png
|
|||||||
Source3: lyxrc.dist
|
Source3: lyxrc.dist
|
||||||
# xdg patch
|
# xdg patch
|
||||||
# This was rejected by upstream (http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg133878.html)
|
# This was rejected by upstream (http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg133878.html)
|
||||||
Patch0: lyx-2.0.1-xdg_open.patch
|
Patch0: lyx-2.0.6-xdg_open.patch
|
||||||
|
# PATCH-FIX-UPSTREAM fix for http://www.lyx.org/trac/ticket/8774 (fixed in 2.1)
|
||||||
|
Patch1: lyx-2.0.6-fix_zombies.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
%if 0%{?suse_version} < 1230
|
%if 0%{?suse_version} < 1230
|
||||||
Requires: ImageMagick
|
Requires: ImageMagick
|
||||||
@ -54,6 +56,7 @@ Requires: texlive-collection-latexrecommended
|
|||||||
Requires: texlive-collection-luatex
|
Requires: texlive-collection-luatex
|
||||||
Requires: texlive-collection-xetex
|
Requires: texlive-collection-xetex
|
||||||
Requires: texlive-endnotes
|
Requires: texlive-endnotes
|
||||||
|
Requires: texlive-nomencl
|
||||||
Requires: texlive-pdfsync
|
Requires: texlive-pdfsync
|
||||||
Requires: texlive-splitindex
|
Requires: texlive-splitindex
|
||||||
Requires: xindy
|
Requires: xindy
|
||||||
@ -74,6 +77,7 @@ have different formats, such as DVI, postscript, PDF, html.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch0
|
%patch0
|
||||||
|
%patch1 -p1
|
||||||
# Remove build time references so build-compare can do its work
|
# Remove build time references so build-compare can do its work
|
||||||
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
|
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
|
||||||
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
|
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user