[mosh/el5] Correct a build error on EPEL 5
Alex Chernyakhovsky
achernya at fedoraproject.org
Wed Mar 27 07:27:04 UTC 2013
commit d7bd90f8d25486e190ae1eb3d518a4ab097b2638
Author: Alexander Chernyakhovsky <achernya at mit.edu>
Date: Wed Mar 27 03:26:57 2013 -0400
Correct a build error on EPEL 5
fix-el5-build.patch | 34 ++++++++++++++++++++++++++++++++++
mosh.spec | 2 ++
2 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/fix-el5-build.patch b/fix-el5-build.patch
new file mode 100644
index 0000000..6b501d2
--- /dev/null
+++ b/fix-el5-build.patch
@@ -0,0 +1,34 @@
+commit 172b1e5cef4cba12de2b3010eb3b21be9c60f9f6
+Author: Alexander Chernyakhovsky <achernya at mit.edu>
+Date: Wed Mar 27 02:15:25 2013 -0400
+
+ Cast time_elapsed to int before calling human_readable_duration
+
+ When attempting to build againt EPEL 5, it was noticed that
+ human_readable_duration expects an int, but time_elapsed is an
+ integer. Explicitly static_cast<int>( time_elapsed ) to appease older
+ compilers.
+
+diff --git a/src/frontend/terminaloverlay.cc b/src/frontend/terminaloverlay.cc
+index cd28f50..9c68d7b 100644
+--- a/src/frontend/terminaloverlay.cc
++++ b/src/frontend/terminaloverlay.cc
+@@ -242,13 +242,16 @@ void NotificationEngine::apply( Framebuffer &fb ) const
+ return;
+ } else if ( message.empty() && time_expired ) {
+ swprintf( tmp, 128, L"mosh: Last %s %s ago.%s", explanation,
+- human_readable_duration( time_elapsed, "seconds" ).c_str(),
++ human_readable_duration( static_cast<int>( time_elapsed ),
++ "seconds" ).c_str(),
+ keystroke_str );
+ } else if ( (!message.empty()) && (!time_expired) ) {
+ swprintf( tmp, 128, L"mosh: %ls%s", message.c_str(), keystroke_str );
+ } else {
+ swprintf( tmp, 128, L"mosh: %ls (%s without %s.)%s", message.c_str(),
+- human_readable_duration( time_elapsed, "s" ).c_str(), explanation, keystroke_str );
++ human_readable_duration( static_cast<int>( time_elapsed ),
++ "s" ).c_str(),
++ explanation, keystroke_str );
+ }
+
+ wstring string_to_draw( tmp );
diff --git a/mosh.spec b/mosh.spec
index 0747cf8..843e149 100644
--- a/mosh.spec
+++ b/mosh.spec
@@ -7,6 +7,7 @@ License: GPLv3+
Group: Applications/Internet
URL: http://mosh.mit.edu/
Source0: https://github.com/downloads/keithw/mosh/mosh-%{version}.tar.gz
+Patch0: fix-el5-build.patch
BuildRequires: protobuf-compiler
BuildRequires: protobuf-devel
@@ -29,6 +30,7 @@ Mosh is a remote terminal application that supports:
%prep
%setup -q
+%patch0 -p1 -b .fix-el5-build
%build
More information about the scm-commits
mailing list