]> granicus.if.org Git - icinga2/commitdiff
Remove libreadline support
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 13 Jan 2015 13:45:38 +0000 (14:45 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 13 Jan 2015 13:45:38 +0000 (14:45 +0100)
fixes #8168

CMakeLists.txt
INSTALL.md
config.h.cmake
icinga2.spec
lib/cli/CMakeLists.txt
lib/cli/consolecommand.cpp

index 31636cfe0f69c6a4655c9bece7060db1da487608..245510e1e504254bbe1b24478b0892197218c0df 100644 (file)
@@ -158,8 +158,6 @@ check_function_exists(pipe2 HAVE_PIPE2)
 check_function_exists(nice HAVE_NICE)
 check_library_exists(dl dladdr "dlfcn.h" HAVE_DLADDR)
 check_library_exists(execinfo backtrace_symbols "" HAVE_LIBEXECINFO)
-check_library_exists(readline readline "" HAVE_LIBREADLINE)
-check_library_exists(ncurses attroff "" HAVE_LIBNCURSES)
 check_include_file_cxx(cxxabi.h HAVE_CXXABI_H)
 
 if(HAVE_LIBEXECINFO)
index 1c902e7664b645ad62c86577d0e7f33f96d5ca32..c18660abedeae9486139343710f8715e40d80c6f 100644 (file)
@@ -27,8 +27,6 @@ parentheses):
 * GNU flex (flex) >= 2.5.35
 * recommended: libexecinfo on FreeBSD (automatically used when Icinga 2 is
                installed via port or package)
-* recommended: GNU readline (readline-devel on RHEL, libreadline-dev on Debian)
-* recommended: ncurses (ncurses-devel on RHEL, libncurses-dev on Debian)
 * optional: MySQL (mysql-devel on RHEL, libmysqlclient-dev on Debian); set CMake
              variable `ICINGA2_WITH_MYSQL` to disable this module
 * optional: PostgreSQL (postgresql-devel on RHEL, libpq-dev on Debian); set CMake
index 0f6f45cec1fdb1b8517ebcf4b08fe2a459f5a154..24c38ef27258c9d12469b3c7b0642bfb3b0a269b 100644 (file)
@@ -9,8 +9,6 @@
 #cmakedefine HAVE_LIBEXECINFO
 #cmakedefine HAVE_CXXABI_H
 #cmakedefine HAVE_NICE
-#cmakedefine HAVE_LIBREADLINE
-#cmakedefine HAVE_LIBNCURSES
 
 #cmakedefine ICINGA2_UNITY_BUILD
 
index 5f8fc9f02a9e4d8d090eea0b82a039d9ccc4a08e..e51cb83e66ba43007b48c37d6b7b3b712c188552 100644 (file)
@@ -97,8 +97,6 @@ BuildRequires: cmake
 BuildRequires: flex >= 2.5.35
 BuildRequires: bison
 BuildRequires: make
-BuildRequires: readline-devel
-BuildRequires: ncurses-devel
 
 %if "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5")
 # el5 requires packages.icinga.org
index f7b7e7cdd69064d6dae51c2a631604c6a0ccb3eb..720d8c355c58d748133bc3a59d423bc153c7aef3 100644 (file)
@@ -37,14 +37,6 @@ add_library(cli SHARED ${cli_SOURCES})
 
 target_link_libraries(cli ${Boost_LIBRARIES} base config remote)
 
-if(HAVE_LIBREADLINE)
-  target_link_libraries(cli readline)
-endif()
-
-if(HAVE_LIBNCURSES)
-  target_link_libraries(cli ncurses)
-endif()
-
 set_target_properties (
   cli PROPERTIES
   INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
index 4d88dada250142d6e887f42a060999dde54197c5..a94c14e9afd366d830a9a7c44264a043ab34a53f 100644 (file)
 #include "base/networkstream.hpp"
 #include <iostream>
 
-#if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBNCURSES)
-extern "C" {
-#include <readline/readline.h>
-#include <readline/history.h>
-}
-#endif /* HAVE_LIBREADLINE && HAVE_LIBNCURSES */
 
 using namespace icinga;
 namespace po = boost::program_options;
@@ -86,41 +80,14 @@ int ConsoleCommand::Run(const po::variables_map& vm, const std::vector<std::stri
                String fileName = "<" + Convert::ToString(next_line) + ">";
                next_line++;
 
-#if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBNCURSES)
-               ConsoleType type = Console::GetType(std::cout);
-
-               std::stringstream prompt_sbuf;
-
-               prompt_sbuf << RL_PROMPT_START_IGNORE << ConsoleColorTag(Console_ForegroundCyan, type)
-                   << RL_PROMPT_END_IGNORE << fileName
-                   << RL_PROMPT_START_IGNORE << ConsoleColorTag(Console_ForegroundRed, type)
-                   << RL_PROMPT_END_IGNORE << " => "
-                   << RL_PROMPT_START_IGNORE << ConsoleColorTag(Console_Normal, type);
-#else /* HAVE_LIBREADLINE && HAVE_LIBNCURSES */
                std::cout << ConsoleColorTag(Console_ForegroundCyan)
                    << fileName
                    << ConsoleColorTag(Console_ForegroundRed)
                    << " => "
                    << ConsoleColorTag(Console_Normal);
-#endif /* HAVE_LIBREADLINE && HAVE_LIBNCURSES */
-
-#if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBNCURSES)
-               String prompt = prompt_sbuf.str();
-
-               char *rline = readline(prompt.CStr());
-
-               if (!rline)
-                       break;
-
-               if (*rline)
-                       add_history(rline);
 
-               String line = rline;
-               free(rline);
-#else /* HAVE_LIBREADLINE */
                std::string line;
                std::getline(std::cin, line);
-#endif /* HAVE_LIBREADLINE */
 
                if (addr.IsEmpty()) {
                        Expression *expr;