diff options
author | Mark Wright <gienah@gentoo.org> | 2014-02-20 01:57:16 +0000 |
---|---|---|
committer | Mark Wright <gienah@gentoo.org> | 2014-02-20 01:57:16 +0000 |
commit | 9fa06b0ea51c0fe718a4795ea01e224d0361c3d1 (patch) | |
tree | 8623750a0dee7b6f974ddce16a6e2b4ae9d5a5e1 /sci-mathematics | |
parent | Automated update. (diff) | |
download | gentoo-2-9fa06b0ea51c0fe718a4795ea01e224d0361c3d1.tar.gz gentoo-2-9fa06b0ea51c0fe718a4795ea01e224d0361c3d1.tar.bz2 gentoo-2-9fa06b0ea51c0fe718a4795ea01e224d0361c3d1.zip |
Fix bug 501760 octave 3.8.0 gui crashes if curl is not available, by applying the patch from upstream for http://savannah.gnu.org/bugs/?41067. Thanks to Fabian Koester for reporting.
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 618E971F)
Diffstat (limited to 'sci-mathematics')
3 files changed, 216 insertions, 2 deletions
diff --git a/sci-mathematics/octave/ChangeLog b/sci-mathematics/octave/ChangeLog index 0a89ba9f75c1..830afd84e896 100644 --- a/sci-mathematics/octave/ChangeLog +++ b/sci-mathematics/octave/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sci-mathematics/octave # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/ChangeLog,v 1.150 2014/02/20 00:59:19 gienah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/ChangeLog,v 1.151 2014/02/20 01:57:16 gienah Exp $ + + 20 Feb 2014; Mark Wright <gienah@gentoo.org> + +files/octave-3.8.0-avoid-gui-sigsegv-if-curl-is-not-available.patch, + octave-3.8.0.ebuild: + Fix bug 501760 octave 3.8.0 gui crashes if curl is not available, by applying + the patch from upstream for http://savannah.gnu.org/bugs/?41067. Thanks to + Fabian Koester for reporting. 20 Feb 2014; Mark Wright <gienah@gentoo.org> octave-3.8.0.ebuild: Fix bug 501762, pkg-pretend check that dependencies are built with the same diff --git a/sci-mathematics/octave/files/octave-3.8.0-avoid-gui-sigsegv-if-curl-is-not-available.patch b/sci-mathematics/octave/files/octave-3.8.0-avoid-gui-sigsegv-if-curl-is-not-available.patch new file mode 100644 index 000000000000..afeb156bace7 --- /dev/null +++ b/sci-mathematics/octave/files/octave-3.8.0-avoid-gui-sigsegv-if-curl-is-not-available.patch @@ -0,0 +1,206 @@ + +# HG changeset patch +# User John W. Eaton <jwe@octave.org> +# Date 1389817323 18000 +# Node ID 9a43d8d6e29ed1d9c29f3916f7064ebbbcb955f1 +# Parent de72c443ed3fd6abb22fa1b5236835d96da62f99 +avoid startup crash if curl library is not available (bug #41067) + +* main-window.cc (news_reader::process): Don't attempt to use +url_transfer object unless it is valid. +* urlwrite.cc (ch_manager::do_make_curl_handle, Furlwrite, Furlread): +Likewise. +* url-transfer.cc (url_transfer::url_transfer): Don't call +disabled_error. +(disabled_error): Delete unused function. + +diff --git a/libgui/src/main-window.cc b/libgui/src/main-window.cc +--- a/libgui/src/main-window.cc ++++ b/libgui/src/main-window.cc +@@ -367,11 +367,14 @@ + std::ostringstream buf; + url_transfer octave_dot_org (url.toStdString (), buf); + +- Array<std::string> param; +- octave_dot_org.http_get (param); +- +- if (octave_dot_org.good ()) +- html_text = QString::fromStdString (buf.str ()); ++ if (octave_dot_org.is_valid ()) ++ { ++ Array<std::string> param; ++ octave_dot_org.http_get (param); ++ ++ if (octave_dot_org.good ()) ++ html_text = QString::fromStdString (buf.str ()); ++ } + + if (html_text.contains ("this-is-the-gnu-octave-community-news-page")) + { +diff --git a/libinterp/corefcn/urlwrite.cc b/libinterp/corefcn/urlwrite.cc +--- a/libinterp/corefcn/urlwrite.cc ++++ b/libinterp/corefcn/urlwrite.cc +@@ -189,10 +189,15 @@ + + url_transfer obj (host, user, passwd, os); + +- if (! error_state) +- handle_map[h] = obj; ++ if (obj.is_valid ()) ++ { ++ if (! error_state) ++ handle_map[h] = obj; ++ else ++ h = curl_handle (); ++ } + else +- h = curl_handle (); ++ error ("support for url transfers was disabled when Octave was built"); + + return h; + } +@@ -413,31 +418,36 @@ + + url_transfer curl = url_transfer (url, ofile); + +- curl.http_action (param, method); ++ if (! curl.is_valid ()) ++ { ++ curl.http_action (param, method); + +- ofile.close (); ++ ofile.close (); + +- if (curl.good ()) +- frame.discard (); ++ if (curl.good ()) ++ frame.discard (); + +- if (nargout > 0) +- { +- if (curl.good ()) ++ if (nargout > 0) + { +- retval(2) = std::string (); +- retval(1) = true; +- retval(0) = octave_env::make_absolute (filename); ++ if (curl.good ()) ++ { ++ retval(2) = std::string (); ++ retval(1) = true; ++ retval(0) = octave_env::make_absolute (filename); ++ } ++ else ++ { ++ retval(2) = curl.lasterror (); ++ retval(1) = false; ++ retval(0) = std::string (); ++ } + } +- else +- { +- retval(2) = curl.lasterror (); +- retval(1) = false; +- retval(0) = std::string (); +- } ++ ++ if (nargout < 2 && ! curl.good ()) ++ error ("urlwrite: %s", curl.lasterror ().c_str ()); + } +- +- if (nargout < 2 && ! curl.good ()) +- error ("urlwrite: %s", curl.lasterror ().c_str ()); ++ else ++ error ("support for url transfers was disabled when Octave was built"); + + return retval; + } +@@ -540,21 +550,26 @@ + + url_transfer curl = url_transfer (url, buf); + +- curl.http_action (param, method); ++ if (curl.is_valid ()) ++ { ++ curl.http_action (param, method); + +- if (curl.good ()) +- { +- if (nargout > 0) ++ if (curl.good ()) + { +- // Return empty string if no error occured. +- retval(2) = curl.good () ? "" : curl.lasterror (); +- retval(1) = curl.good (); +- retval(0) = buf.str (); ++ if (nargout > 0) ++ { ++ // Return empty string if no error occured. ++ retval(2) = curl.good () ? "" : curl.lasterror (); ++ retval(1) = curl.good (); ++ retval(0) = buf.str (); ++ } + } ++ ++ if (nargout < 2 && ! curl.good ()) ++ error ("urlread: %s", curl.lasterror().c_str()); + } +- +- if (nargout < 2 && ! curl.good ()) +- error ("urlread: %s", curl.lasterror().c_str()); ++ else ++ error ("support for url transfers was disabled when Octave was built"); + + return retval; + } +diff --git a/liboctave/util/url-transfer.cc b/liboctave/util/url-transfer.cc +--- a/liboctave/util/url-transfer.cc ++++ b/liboctave/util/url-transfer.cc +@@ -767,15 +767,6 @@ + + #undef SETOPT + +-#else +- +-static void +-disabled_error (void) +-{ +- (*current_liboctave_error_handler) +- ("support for url transfers was disabled when Octave was built"); +-} +- + #endif + + #if defined (HAVE_CURL) +@@ -785,27 +776,15 @@ + #endif + + url_transfer::url_transfer (void) : rep (new REP_CLASS ()) +-{ +-#if !defined (HAVE_CURL) +- disabled_error (); +-#endif +-} ++{ } + + url_transfer::url_transfer (const std::string& host, const std::string& user, + const std::string& passwd, std::ostream& os) + : rep (new REP_CLASS (host, user, passwd, os)) +-{ +-#if !defined (HAVE_CURL) +- disabled_error (); +-#endif +-} ++{ } + + url_transfer::url_transfer (const std::string& url, std::ostream& os) + : rep (new REP_CLASS (url, os)) +-{ +-#if !defined (HAVE_CURL) +- disabled_error (); +-#endif +-} ++{ } + + #undef REP_CLASS + diff --git a/sci-mathematics/octave/octave-3.8.0.ebuild b/sci-mathematics/octave/octave-3.8.0.ebuild index 89276e82f0ed..560fffc9ab86 100644 --- a/sci-mathematics/octave/octave-3.8.0.ebuild +++ b/sci-mathematics/octave/octave-3.8.0.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/octave-3.8.0.ebuild,v 1.3 2014/02/20 00:59:19 gienah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/octave/octave-3.8.0.ebuild,v 1.4 2014/02/20 01:57:16 gienah Exp $ EAPI=5 @@ -77,6 +77,7 @@ PATCHES=( "${FILESDIR}"/${PN}-3.8.0-llvm-configure.patch "${FILESDIR}"/${PN}-3.8.0-JIT-64-bit-indexing.patch "${FILESDIR}"/${PN}-3.8.0-disable-getcwd-path-max-test-as-it-is-too-slow.patch + "${FILESDIR}"/${PN}-3.8.0-avoid-gui-sigsegv-if-curl-is-not-available.patch ) pkg_pretend() { |