[boinc] 01/01: Update previous patch boinc-issue-1177.patch
Gianfranco Costamagna
locutusofborg at moszumanska.debian.org
Thu Apr 27 09:40:59 UTC 2017
This is an automated email from the git hooks/post-receive script.
locutusofborg pushed a commit to branch master
in repository boinc.
commit c372ee78cf63918799b793a27ab6e6466ca8f8cb
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date: Thu Apr 27 11:40:34 2017 +0200
Update previous patch boinc-issue-1177.patch
---
debian/changelog | 4 ++
debian/patches/boinc-issue-1177.patch | 129 ++++++++++++++++++++++++----------
2 files changed, 95 insertions(+), 38 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index a5ed251..0b85535 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,12 @@
boinc (7.6.33+dfsg-12) UNRELEASED; urgency=medium
+ [ Steffen Moeller ]
* Added dependency on lsb-base (>= 3.0-6) of boinc-client for the init
script. Thanks to Lintian and the Package Tracker for spotting that.
+ [ Gianfranco Costamagna ]
+ * Update the previous boinc-issue-1177.patch with the upstream merged patch.
+
-- Steffen Moeller <moeller at debian.org> Thu, 13 Apr 2017 11:37:11 +0200
boinc (7.6.33+dfsg-11exp1) experimental; urgency=medium
diff --git a/debian/patches/boinc-issue-1177.patch b/debian/patches/boinc-issue-1177.patch
index 5570c8f..7e6950b 100644
--- a/debian/patches/boinc-issue-1177.patch
+++ b/debian/patches/boinc-issue-1177.patch
@@ -1,58 +1,111 @@
-Description: Fix for the new process spawn
-Author: Christian Beer
+From 31e8427469ede148249796fed05be0165e321d23 Mon Sep 17 00:00:00 2001
+From: Christian Beer <christian.beer at aei.mpg.de>
+Date: Thu, 16 Mar 2017 18:28:08 +0100
+Subject: [PATCH 1/2] Manager/Lib: fix 'New Manager window' function on Linux
-Bug-Ubuntu: https://launchpad.net/bugs/1115607
-Forwarded: https://github.com/BOINC/boinc/issues/1177
+This was not working because the manager was not detecting its own executable name and path so it couldn't start a new instance of itself. Windows and Mac use different codepaths so it worked there.
+The new library function can be extended for Windows and Mac to avoid code duplication.
+---
+ clientgui/BOINCGUIApp.cpp | 21 +++++++++++++++++++++
+ configure.ac | 5 +++++
+ lib/util.cpp | 17 +++++++++++++++++
+ lib/util.h | 2 ++
+ 4 files changed, 45 insertions(+)
---- a/clientgui/AdvancedFrame.cpp
-+++ b/clientgui/AdvancedFrame.cpp
-@@ -1601,7 +1601,7 @@ void CAdvancedFrame::OnLaunchNewInstance(wxCommandEvent& WXUNUSED(event)) {
- wxString strExecutable = wxGetApp().GetRootDirectory() + wxGetApp().GetExecutableName();
-
- run_program(
-- wxGetApp().GetRootDirectory().mb_str(),
-+ wxGetApp().GetDataDirectory().mb_str(),
- strExecutable.mb_str(),
- argc,
- argv,
-diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp
-index 434769b5e4..b5c0b8a45b 100644
---- a/clientgui/BOINCGUIApp.cpp
-+++ b/clientgui/BOINCGUIApp.cpp
-@@ -721,6 +721,17 @@ void CBOINCGUIApp::DetectExecutableName() {
+Index: boinc/clientgui/BOINCGUIApp.cpp
+===================================================================
+--- boinc.orig/clientgui/BOINCGUIApp.cpp
++++ boinc/clientgui/BOINCGUIApp.cpp
+@@ -765,6 +765,16 @@
// Store the root directory for later use.
m_strBOINCMGRExecutableName = pszProg;
-+#else
++#elif defined(__WXGTK__)
+ char path[PATH_MAX];
-+ memset(path,0,sizeof(path));
-+ int ret = readlink("/proc/self/exe", path, PATH_MAX);
-+ if ( ret >= 0) {
-+ path[ret] = '\0'; // readlink does not null terminate
-+ char* name = strrchr(path, '/') + 1;
-+ m_strBOINCMGRExecutableName = name;
-+ } else {
-+ perror("readlink");
++ if (!get_real_executable_path(path, PATH_MAX)) {
++ // find filename component
++ char* name = strrchr(path, '/');
++ if (name) {
++ name++;
++ m_strBOINCMGRExecutableName = name;
++ }
+ }
#endif
}
-@@ -742,6 +753,18 @@ void CBOINCGUIApp::DetectRootDirectory() {
+@@ -786,6 +796,17 @@
// Store the root directory for later use.
m_strBOINCMGRRootDirectory = szPath;
-+#else
++#elif defined(__WXGTK__)
+ char path[PATH_MAX];
-+ memset(path,0,sizeof(path));
-+ int ret = readlink("/proc/self/exe", path, PATH_MAX);
++ if (!get_real_executable_path(path, PATH_MAX)) {
++ // find path component
++ char* name = strrchr(path, '/');
++ if (name) {
++ name++;
++ *name = '\0';
++ m_strBOINCMGRRootDirectory = path;
++ }
++ }
+ #endif
+ }
+
+Index: boinc/configure.ac
+===================================================================
+--- boinc.orig/configure.ac
++++ boinc/configure.ac
+@@ -1026,6 +1026,11 @@
+ AC_DEFINE(HAVE__PROC_SELF_STAT, 1, [Define to 1 if /proc/self/stat exists])
+ fi
+
++dnl Check for /proc/self/exe (Linux)
++if test -e "/proc/self/exe"; then
++ AC_DEFINE(HAVE__PROC_SELF_EXE, 1, [Define to 1 if /proc/self/exe exists])
++fi
++
+ dnl Check for /proc/meminfo (Linux)
+ if test -e "/proc/meminfo"; then
+ AC_DEFINE(HAVE__PROC_MEMINFO, 1, [Define to 1 if /proc/meminfo exists])
+Index: boinc/lib/util.cpp
+===================================================================
+--- boinc.orig/lib/util.cpp
++++ boinc/lib/util.cpp
+@@ -617,3 +617,24 @@
+ cached = true;
+ return z*cos(PI2*u2);
+ }
++
++// determines the real path and filename of the current process
++// not the current working directory
++//
++int get_real_executable_path(char* path, size_t max_len) {
++#ifdef HAVE__PROC_SELF_EXE
++ int ret = readlink("/proc/self/exe", path, max_len);
+ if ( ret >= 0) {
+ path[ret] = '\0'; // readlink does not null terminate
-+ char* name = strrchr(path, '/') + 1;
-+ *name = '\0';
-+ m_strBOINCMGRRootDirectory = path;
++ return 0;
+ } else {
++#ifdef _USING_FCGI_
++ FCGI::perror("readlink");
++#else
+ perror("readlink");
++#endif
++ return ERR_PROC_PARSE;
+ }
- #endif
- }
++#endif
++ return ERR_NOT_IMPLEMENTED;
++}
+Index: boinc/lib/util.h
+===================================================================
+--- boinc.orig/lib/util.h
++++ boinc/lib/util.h
+@@ -110,6 +110,8 @@
+
+ extern int wait_client_mutex(const char* dir, double timeout);
++extern int get_real_executable_path(char* path, size_t max_len);
++
+ #ifdef GCL_SIMULATOR
+ extern double simtime;
+ #define time(x) ((int)simtime)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-boinc/boinc.git
More information about the pkg-boinc-commits
mailing list