From 6bcde251c2176c5290b1fed9df69f6a42df7ad2f Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Apr 10 2016 14:41:41 +0000 Subject: Add upstream patch to fix setting TERM variable (bug #1325548) --- diff --git a/octave-term.patch b/octave-term.patch new file mode 100644 index 0000000..0615801 --- /dev/null +++ b/octave-term.patch @@ -0,0 +1,41 @@ + +# HG changeset patch +# User Mike Miller +# Date 1458325635 25200 +# Node ID c64e57319f081803d4510a09478e853674e90625 +# Parent eebbb80bf6d9fa7e5e0a75a4e0c3d589d9be55d9 +octave-gui: Set TERM unconditionally to Octave's expected terminal type (bug #47449) + +* octave-gui.cc (octave_start_gui): Set TERM unconditionally to the expected +terminal type for the host system. + +diff --git a/libgui/src/octave-gui.cc b/libgui/src/octave-gui.cc +--- a/libgui/src/octave-gui.cc ++++ b/libgui/src/octave-gui.cc +@@ -160,20 +160,12 @@ + // update network-settings + resource_manager::update_network_settings (); + +-#if ! defined (__WIN32__) || defined (__CYGWIN__) +- // If we were started from a launcher, TERM might not be +- // defined, but we provide a terminal with xterm +- // capabilities. +- +- std::string term = octave_env::getenv ("TERM"); +- +- if (term.empty ()) +- octave_env::putenv ("TERM", "xterm"); ++ // We provide specific terminal capabilities, so ensure that TERM is ++ // always set appropriately ++#if defined (__WIN32__) && ! defined (__CYGWIN__) ++ octave_env::putenv ("TERM", "cygwin"); + #else +- std::string term = octave_env::getenv ("TERM"); +- +- if (term.empty ()) +- octave_env::putenv ("TERM", "cygwin"); ++ octave_env::putenv ("TERM", "xterm"); + #endif + + // shortcut manager + diff --git a/octave.spec b/octave.spec index f24e53e..6d46503 100644 --- a/octave.spec +++ b/octave.spec @@ -16,7 +16,7 @@ Name: octave Epoch: 6 Version: 4.0.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: A high-level language for numerical computations Group: Applications/Engineering License: GPLv3+ @@ -43,6 +43,9 @@ Patch3: octave-signbit.patch Patch4: octave-gnulib.patch # Handle g++ 6 abs() change Patch5: octave-abs.patch +# Make sure TERM variable is set correctly +# http://hg.savannah.gnu.org/hgweb/octave/raw-rev/c64e57319f08 +Patch6: octave-term.patch Provides: octave(api) = %{octave_api} Provides: bundled(gnulib) @@ -170,6 +173,7 @@ This package contains documentation for Octave. %patch3 -p1 -b .signbit %patch4 -p1 -b .gnulib %patch5 -p1 -b .abs +%patch6 -p1 -b .term # Explicitly use gnulib headers %if 0%{?fedora} >= 24 find -name \*.cc -o -name \*.h -o -name \*.yy | xargs sed -i -e 's/#include /#include <\1.h>/' @@ -403,6 +407,9 @@ fi %{_pkgdocdir}/refcard*.pdf %changelog +* Sun Apr 10 2016 Orion Poplawski - 6:4.0.1-6 +- Add upstream patch to fix setting TERM variable (bug #1325548) + * Mon Apr 4 2016 Orion Poplawski - 6:4.0.1-5 - Arm tests appear to be running okay now (bug #1149953)