Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-ruby-bindings for openSUSE:Factory checked in at 2021-02-26 21:58:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-ruby-bindings (Old) and /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new.2378 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-ruby-bindings" Fri Feb 26 21:58:22 2021 rev:107 rq:872744 version:4.3.12 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-ruby-bindings/yast2-ruby-bindings.changes 2020-11-23 16:27:55.380686088 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new.2378/yast2-ruby-bindings.changes 2021-02-26 21:58:24.791766110 +0100 @@ -1,0 +2,7 @@ +Mon Feb 15 17:44:17 UTC 2021 - Ladislav Slez??k <lsle...@suse.cz> + +- Handle a special keyboard shortcut for starting the installation + console (jsc#PM-1895, jsc#SLE-16263) +- 4.3.12 + +------------------------------------------------------------------- Old: ---- yast2-ruby-bindings-4.3.11.tar.bz2 New: ---- yast2-ruby-bindings-4.3.12.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-ruby-bindings.spec ++++++ --- /var/tmp/diff_new_pack.Gop2VU/_old 2021-02-26 21:58:25.303766560 +0100 +++ /var/tmp/diff_new_pack.Gop2VU/_new 2021-02-26 21:58:25.307766563 +0100 @@ -1,7 +1,7 @@ # # spec file for package yast2-ruby-bindings # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: yast2-ruby-bindings -Version: 4.3.11 +Version: 4.3.12 Release: 0 URL: https://github.com/yast/yast-ruby-bindings BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-ruby-bindings-4.3.11.tar.bz2 -> yast2-ruby-bindings-4.3.12.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-4.3.11/.github/workflows/ci.yml new/yast2-ruby-bindings-4.3.12/.github/workflows/ci.yml --- old/yast2-ruby-bindings-4.3.11/.github/workflows/ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-ruby-bindings-4.3.12/.github/workflows/ci.yml 2021-02-16 10:06:27.000000000 +0100 @@ -0,0 +1,28 @@ + +# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions + +name: CI + +on: [push, pull_request] + +jobs: + Package: + runs-on: ubuntu-latest + container: registry.opensuse.org/yast/head/containers/yast-cpp:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v1 + + - name: Install Dependencies + run: | + # Install tmux to make sure the libyui+YaST integration tests are run + zypper --non-interactive in tmux + # Enable installing docs... + sed -i 's/\(rpm\.install\.excludedocs =\).*/\1 no/' /etc/zypp/zypp.conf + # ... and reinstall the RPM containing the examples we use for tests + zypper --non-interactive in --force yast2-ycp-ui-bindings-devel + + - name: Package Build + run: yast-ci-cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-4.3.11/.travis.yml new/yast2-ruby-bindings-4.3.12/.travis.yml --- old/yast2-ruby-bindings-4.3.11/.travis.yml 2020-11-19 11:35:39.000000000 +0100 +++ new/yast2-ruby-bindings-4.3.12/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -sudo: required -language: bash -services: - - docker - -before_install: - - docker build -t yast-ruby-bindings-image . -script: - # the "yast-travis-cpp" script is included in the base yastdevel/cpp-tw image - # see https://github.com/yast/docker-yast-cpp-tw/blob/master/yast-travis-cpp - - docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" yast-ruby-bindings-image yast-travis-cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-4.3.11/Dockerfile new/yast2-ruby-bindings-4.3.12/Dockerfile --- old/yast2-ruby-bindings-4.3.11/Dockerfile 2020-11-19 11:35:39.000000000 +0100 +++ new/yast2-ruby-bindings-4.3.12/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -FROM registry.opensuse.org/yast/head/containers/yast-cpp:latest -# Install tmux to make sure the libyui+YaST integration tests are run -RUN zypper --non-interactive in tmux - -# Enable installing docs... -RUN sed -i 's/\(rpm\.install\.excludedocs =\).*/\1 no/' /etc/zypp/zypp.conf -# ... and reinstall the RPM containing the examples we use for tests -RUN zypper --non-interactive in --force yast2-ycp-ui-bindings-devel - -COPY . /usr/src/app diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-4.3.11/README.md new/yast2-ruby-bindings-4.3.12/README.md --- old/yast2-ruby-bindings-4.3.11/README.md 2020-11-19 11:35:39.000000000 +0100 +++ new/yast2-ruby-bindings-4.3.12/README.md 2021-02-16 10:06:27.000000000 +0100 @@ -1,7 +1,9 @@ -# Yast2-ruby-bindings +# YaST Ruby Bindings -[](https://travis-ci.org/yast/yast-ruby-bindings) -[](http://ci.opensuse.org/view/Yast/job/yast-ruby-bindings-master/) +[]( +https://github.com/yast/yast-ruby-bindings/actions?query=branch%3Amaster) +[]( +https://ci.opensuse.org/view/Yast/job/yast-yast-ruby-bindings-master/) It is part of [YaST](http://yast.github.io) where you can find more information about YaST and its component system. The Ruby bindings cover only the connection to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-4.3.11/package/yast2-ruby-bindings.changes new/yast2-ruby-bindings-4.3.12/package/yast2-ruby-bindings.changes --- old/yast2-ruby-bindings-4.3.11/package/yast2-ruby-bindings.changes 2020-11-19 11:35:39.000000000 +0100 +++ new/yast2-ruby-bindings-4.3.12/package/yast2-ruby-bindings.changes 2021-02-16 10:06:27.000000000 +0100 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Feb 15 17:44:17 UTC 2021 - Ladislav Slez??k <lsle...@suse.cz> + +- Handle a special keyboard shortcut for starting the installation + console (jsc#PM-1895, jsc#SLE-16263) +- 4.3.12 + +------------------------------------------------------------------- Thu Nov 19 10:13:01 UTC 2020 - Stefan Hundhammer <shundham...@suse.com> - Removed Requires / BuildRequires to libyui (build failure) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-4.3.11/package/yast2-ruby-bindings.spec new/yast2-ruby-bindings-4.3.12/package/yast2-ruby-bindings.spec --- old/yast2-ruby-bindings-4.3.11/package/yast2-ruby-bindings.spec 2020-11-19 11:35:39.000000000 +0100 +++ new/yast2-ruby-bindings-4.3.12/package/yast2-ruby-bindings.spec 2021-02-16 10:06:27.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-ruby-bindings -Version: 4.3.11 +Version: 4.3.12 Release: 0 URL: https://github.com/yast/yast-ruby-bindings BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-4.3.11/src/binary/Builtin.cc new/yast2-ruby-bindings-4.3.12/src/binary/Builtin.cc --- old/yast2-ruby-bindings-4.3.11/src/binary/Builtin.cc 2020-11-19 11:35:39.000000000 +0100 +++ new/yast2-ruby-bindings-4.3.12/src/binary/Builtin.cc 2021-02-16 10:06:27.000000000 +0100 @@ -225,17 +225,14 @@ const char *entropy = NULL; const size_t entropy_len = 0; - char output[CRYPT_GENSALT_OUTPUT_SIZE]; - char* retval = crypt_gensalt_rn (crypt_prefix, crypt_rounds, entropy, - entropy_len, output, sizeof(output)); + char* retval = crypt_gensalt_ra (crypt_prefix, crypt_rounds, entropy, entropy_len); if (!retval) { y2error ("Unable to generate a salt, check your crypt settings.\n"); - return 0; } - return strdup (retval); + return retval; } @@ -273,7 +270,7 @@ } if (!salt) { - y2error ("Cannot create salt for sha512 crypt"); + y2error ("Cannot create salt for crypt type %d", use_crypt); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-4.3.11/src/binary/Yast.cc new/yast2-ruby-bindings-4.3.12/src/binary/Yast.cc --- old/yast2-ruby-bindings-4.3.11/src/binary/Yast.cc 2020-11-19 11:35:39.000000000 +0100 +++ new/yast2-ruby-bindings-4.3.12/src/binary/Yast.cc 2021-02-16 10:06:27.000000000 +0100 @@ -243,6 +243,42 @@ } /** + * Returns true if the input symbol starts special configuration. + * @param val YCPSymbol returned from an UI input call + * @return true/false + */ +static bool is_config_symbol(YCPValue val) +{ + return !val.isNull() && val->isSymbol() && + val->asSymbol()->symbol() == "special_key:config"; +} + +/** + * Returns true if the input is a config UI event. + * @param val YCPMap returned from the UI::WaitForEvent call + * @return true/false + */ +static bool is_config_event(YCPValue val) +{ + // is it a map? + if (val.isNull() || !val->isMap()) + return false; + + YCPMap map = val->asMap(); + + YCPValue event_type = map->value(YCPString("EventType")); + // is map["EventType"] == "SpecialKeyEvent"? + if (event_type.isNull() || !event_type->isString() || + event_type->asString()->value() != "SpecialKeyEvent") + return false; + + YCPValue event_id = map->value(YCPString("ID")); + // is map["ID"] == :"special_key:config"? + return !event_id.isNull() && event_id->isSymbol() && + event_id->asSymbol()->symbol() == "special_key:config"; +} + +/** * Start the Ruby debugger, it calls "Yast::Debugger.start" Ruby code. * See file ../ruby/yast/debugger.rb for more details. */ @@ -257,6 +293,38 @@ rb_funcall(klass, rb_intern("start"), 0); } +static VALUE require_console(...) +{ + rb_require("installation/console"); + return Qtrue; +} + +static VALUE rescue_require_console(...) +{ + y2warning("Loading the console failed!"); + return Qfalse; +} + +/** + * Start the configuration console, it calls "Installation::Console.run" Ruby code. + */ +static void start_config_console() +{ + y2milestone("Starting the configuration console..."); + + // catch the LoadError exception + VALUE success = rb_rescue2( &require_console, Qnil, &rescue_require_console, + Qnil, rb_eLoadError, 0); + + // LoadError caught + if (success == Qfalse) return; + + // call "Installation::Console.run" + VALUE installation = rb_const_get(rb_cObject, rb_intern("Installation")); + VALUE console = rb_const_get(installation, rb_intern("Console")); + rb_funcall(console, rb_intern("run"), 0); +} + /* * call_ycp_function * @@ -353,8 +421,9 @@ rb_funcall(argv[i->first], rb_intern("value="), 1, val); } - // hack: handle the Shift+Ctrl+Alt+D debugging magic key combination - // returned from UI calls, start the Ruby debugger when the magic key is received + // hack: handle the magic key combinations returned from UI calls, + // start the Ruby debugger or the installation console when the respective + // magic key is received if (strcmp(namespace_name, "UI") == 0) { if ( @@ -365,6 +434,18 @@ y2milestone("UI::%s() caught magic debug key: %s", function_name, res->toString().c_str()); start_ruby_debugger(); } + if ( + (ui_input_function(function_name) && is_config_symbol(res)) || + (ui_event_function(function_name) && is_config_event(res)) + ) + { + y2milestone("UI::%s() caught magic config key: %s", function_name, res->toString().c_str()); + start_config_console(); + + // restart the UI call, handle the config event completely internally, + // return a real user input value + return ycp_module_call_ycp_function(argc, argv, self); + } } return ycpvalue_2_rbvalue(res);