Hello community, here is the log from the commit of package libyui for openSUSE:Factory checked in at 2019-07-08 15:01:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libyui (Old) and /work/SRC/openSUSE:Factory/.libyui.new.4615 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libyui" Mon Jul 8 15:01:28 2019 rev:40 rq:713149 version:3.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libyui/libyui.changes 2019-06-28 16:27:15.617999689 +0200 +++ /work/SRC/openSUSE:Factory/.libyui.new.4615/libyui.changes 2019-07-08 15:01:32.658581668 +0200 @@ -1,0 +2,7 @@ +Tue Jun 25 09:32:23 UTC 2019 - Ladislav Slezák <[email protected]> + +- Split the libyui-rest-api plugin to separate Qt and Ncurses parts + (bsc#1139747) +- 3.6.0 + +------------------------------------------------------------------- Old: ---- libyui-3.5.0.tar.bz2 New: ---- libyui-3.6.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libyui-doc.spec ++++++ --- /var/tmp/diff_new_pack.yvVJt8/_old 2019-07-08 15:01:33.542583004 +0200 +++ /var/tmp/diff_new_pack.yvVJt8/_new 2019-07-08 15:01:33.546583011 +0200 @@ -20,7 +20,7 @@ %define so_version 10 Name: %{parent}-doc -Version: 3.5.0 +Version: 3.6.0 Release: 0 Source: %{parent}-%{version}.tar.bz2 ++++++ libyui.spec ++++++ --- /var/tmp/diff_new_pack.yvVJt8/_old 2019-07-08 15:01:33.570583047 +0200 +++ /var/tmp/diff_new_pack.yvVJt8/_new 2019-07-08 15:01:33.574583053 +0200 @@ -17,7 +17,7 @@ Name: libyui -Version: 3.5.0 +Version: 3.6.0 Release: 0 Source: %{name}-%{version}.tar.bz2 ++++++ libyui-3.5.0.tar.bz2 -> libyui-3.6.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.5.0/.travis.yml new/libyui-3.6.0/.travis.yml --- old/libyui-3.5.0/.travis.yml 2019-04-17 18:15:06.000000000 +0200 +++ new/libyui-3.6.0/.travis.yml 2019-07-03 08:15:23.000000000 +0200 @@ -7,5 +7,5 @@ - docker build -t libyui-image . script: # the "libyui-travis" script is included in the base libyui/devel image - # see https://github.com/libyui/docker-devel/blob/master/libyui-travis - - docker run -it -e COVERALLS_TOKEN="$COVERALLS_TOKEN" -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" libyui-image libyui-travis + # see https://github.com/libyui/ci-libyui-container/blob/master/package/libyui-travis + - docker run -it --rm -e COVERALLS_TOKEN="$COVERALLS_TOKEN" -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" libyui-image libyui-travis diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.5.0/Dockerfile new/libyui-3.6.0/Dockerfile --- old/libyui-3.5.0/Dockerfile 2019-04-17 18:15:06.000000000 +0200 +++ new/libyui-3.6.0/Dockerfile 2019-07-03 08:15:23.000000000 +0200 @@ -1,4 +1,4 @@ -# Use the libyui/devel image as the base -FROM libyui/devel +# Use the libyui-devel image as the base +FROM registry.opensuse.org/devel/libraries/libyui/containers/libyui-devel:latest COPY . /usr/src/app diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.5.0/VERSION.cmake new/libyui-3.6.0/VERSION.cmake --- old/libyui-3.5.0/VERSION.cmake 2019-04-17 18:15:06.000000000 +0200 +++ new/libyui-3.6.0/VERSION.cmake 2019-07-03 08:15:23.000000000 +0200 @@ -1,5 +1,5 @@ SET( VERSION_MAJOR "3") -SET( VERSION_MINOR "5" ) +SET( VERSION_MINOR "6" ) SET( VERSION_PATCH "0" ) SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.5.0/package/libyui-doc.spec new/libyui-3.6.0/package/libyui-doc.spec --- old/libyui-3.5.0/package/libyui-doc.spec 2019-04-17 18:15:06.000000000 +0200 +++ new/libyui-3.6.0/package/libyui-doc.spec 2019-07-03 08:15:23.000000000 +0200 @@ -20,7 +20,7 @@ %define so_version 10 Name: %{parent}-doc -Version: 3.5.0 +Version: 3.6.0 Release: 0 Source: %{parent}-%{version}.tar.bz2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.5.0/package/libyui.changes new/libyui-3.6.0/package/libyui.changes --- old/libyui-3.5.0/package/libyui.changes 2019-04-17 18:15:06.000000000 +0200 +++ new/libyui-3.6.0/package/libyui.changes 2019-07-03 08:15:23.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Jun 25 09:32:23 UTC 2019 - Ladislav Slezák <[email protected]> + +- Split the libyui-rest-api plugin to separate Qt and Ncurses parts + (bsc#1139747) +- 3.6.0 + +------------------------------------------------------------------- Thu Dec 20 09:53:15 UTC 2018 - Rodion Iafarov <[email protected]> - Add changes required for the libyui-rest-api (bsc#1132247) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.5.0/package/libyui.spec new/libyui-3.6.0/package/libyui.spec --- old/libyui-3.5.0/package/libyui.spec 2019-04-17 18:15:06.000000000 +0200 +++ new/libyui-3.6.0/package/libyui.spec 2019-07-03 08:15:23.000000000 +0200 @@ -16,7 +16,7 @@ # Name: libyui -Version: 3.5.0 +Version: 3.6.0 Release: 0 Source: %{name}-%{version}.tar.bz2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.5.0/src/YUILoader.cc new/libyui-3.6.0/src/YUILoader.cc --- old/libyui-3.5.0/src/YUILoader.cc 2019-04-17 18:15:06.000000000 +0200 +++ new/libyui-3.6.0/src/YUILoader.cc 2019-07-03 08:15:23.000000000 +0200 @@ -39,13 +39,18 @@ #include "Libyui_config.h" +bool rest_enabled() +{ + const char *env = getenv("YUI_HTTP_PORT"); + return env && atoi(env) > 0; +} + void YUILoader::loadUI( bool withThreads ) { bool isGtk = false; const char * envDesktop = getenv( "XDG_CURRENT_DESKTOP" ) ?: ""; const char * envDisplay = getenv( "DISPLAY" ) ?: ""; const char * envPreset = getenv( "YUI_PREFERED_BACKEND" ) ?: ""; - const char * envTestEnable = getenv( "Y2TEST" ) ? : ""; std::string wantedGUI; @@ -125,7 +130,7 @@ // Load integration testing framework plugin, which load required UI // There is no support for GTK planned, so not loading rest api // plugin in case gtk was requested - if ( strcmp( envTestEnable, "1" ) == 0 && wantedGUI != YUIPlugin_Gtk ) + if ( rest_enabled() && wantedGUI != YUIPlugin_Gtk ) { loadRestAPIPlugin( wantedGUI, withThreads ); } @@ -175,38 +180,44 @@ yuiMilestone () << "Requested to start http server to control UI." << std::endl; if( pluginExists( YUIPlugin_RestAPI ) ) { - // TODO: Do not load unused libraries - // Load underlying UI plugin, as test method inherits from it - // YUIPlugin_Test uses both libraries to be single point of entry - YUIPlugin uiPluginNC( YUIPlugin_NCurses ); - YUIPlugin uiPluginQT( YUIPlugin_Qt ); - YUIPlugin uiTestPlugin( YUIPlugin_RestAPI ); - + YUIPlugin uiRestPlugin( YUIPlugin_RestAPI ); + createUIFunction_t createUI = nullptr; yuiMilestone () << "User-selected underlying UI-plugin: \"" << wantedGUI << "\"" << std::endl; - if ( uiPluginNC.success() && uiPluginQT.success() && uiTestPlugin.success() ) + + if (wantedGUI == YUIPlugin_Qt) { - yuiMilestone () << "Loading http server to control UI." << std::endl; + YUIPlugin uiPluginQT( YUIPlugin_Qt ); + YUIPlugin uiPluginQTRest( YUIPlugin_Qt_RestAPI ); - createUIFunction_t createUI = 0; - // Only QT an Ncurses are supported - if( wantedGUI == YUIPlugin_Qt ) + if ( uiPluginQT.success() && uiRestPlugin.success() && uiPluginQTRest.success() ) { - createUI = (createUIFunction_t) uiTestPlugin.locateSymbol( "createYQHttpUI" ); - } - else if( wantedGUI == YUIPlugin_NCurses ) { - createUI = (createUIFunction_t) uiTestPlugin.locateSymbol( "createYNCHttpUI" ); + yuiMilestone () << "Loading the http server to control the Qt UI" << std::endl; + createUI = (createUIFunction_t) uiPluginQTRest.locateSymbol( "createYQHttpUI" ); } + else + yuiError() << "Cannot load Qt REST API UI" << std::endl; + } - if ( createUI ) + // fallback to ncurses + REST API if Qt does not work + if (wantedGUI == YUIPlugin_NCurses || createUI == nullptr) + { + YUIPlugin uiPluginNC( YUIPlugin_NCurses ); + YUIPlugin uiPluginNCRest( YUIPlugin_Ncurses_RestAPI ); + if ( uiPluginNC.success() && uiRestPlugin.success() && uiPluginNCRest.success()) { - YUI * ui = createUI( withThreads ); // no threads - // Same as in loadPlugin - atexit(deleteUI); - - if ( ui ) - return; + yuiMilestone () << "Loading the http server to control the ncurses UI" << std::endl; + createUI = (createUIFunction_t) uiPluginNCRest.locateSymbol( "createYNCHttpUI" ); } } + + if ( createUI ) + { + YUI * ui = createUI( withThreads ); + // Same as in loadPlugin + atexit(deleteUI); + + if ( ui ) return; + } } // Throw an exception if loading of the plugin failed YUI_THROW ( YUIPluginException ( YUIPlugin_RestAPI ) ); @@ -225,6 +236,12 @@ void YUILoader::loadPlugin( const std::string & name, bool withThreads ) { + if (rest_enabled() && (name == YUIPlugin_NCurses || name == YUIPlugin_Qt)) + { + loadRestAPIPlugin(name, withThreads); + return; + } + YUIPlugin uiPlugin( name.c_str() ); if ( uiPlugin.success() ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-3.5.0/src/YUILoader.h new/libyui-3.6.0/src/YUILoader.h --- old/libyui-3.5.0/src/YUILoader.h 2019-04-17 18:15:06.000000000 +0200 +++ new/libyui-3.6.0/src/YUILoader.h 2019-07-03 08:15:23.000000000 +0200 @@ -38,6 +38,8 @@ #define YUIPlugin_NCurses "ncurses" #define YUIPlugin_Gtk "gtk" #define YUIPlugin_RestAPI "rest-api" +#define YUIPlugin_Ncurses_RestAPI "ncurses-rest-api" +#define YUIPlugin_Qt_RestAPI "qt-rest-api" /** * Class to load one of the concrete UI plug-ins: Qt, NCurses, Gtk.
