Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2016-11-08 18:26:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2016-10-20 23:06:12.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2016-11-08 18:26:40.000000000 +0100 @@ -1,0 +2,8 @@ +Thu Nov 3 12:51:09 UTC 2016 - [email protected] + +- fix do not show again for packages downloaded to temporary + directory (bsc#481011) +- remove icons from signature check dialogs (bsc#875201) +- 3.2.3 + +------------------------------------------------------------------- Old: ---- yast2-3.2.2.tar.bz2 New: ---- yast2-3.2.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.Df9hUf/_old 2016-11-08 18:26:41.000000000 +0100 +++ /var/tmp/diff_new_pack.Df9hUf/_new 2016-11-08 18:26:41.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.2.2 +Version: 3.2.3 Release: 0 Summary: YaST2 - Main Package License: GPL-2.0 ++++++ yast2-3.2.2.tar.bz2 -> yast2-3.2.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.2.2/library/general/test/agents_test/fstab_agent_test.rb new/yast2-3.2.3/library/general/test/agents_test/fstab_agent_test.rb --- old/yast2-3.2.2/library/general/test/agents_test/fstab_agent_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.2.3/library/general/test/agents_test/fstab_agent_test.rb 2016-11-07 11:09:36.000000000 +0100 @@ -0,0 +1,34 @@ +#!/usr/bin/env rspec + +require_relative "../test_helper" +require "yast" + +describe ".proc.meminfo" do + around :each do |example| + root = File.join(File.dirname(__FILE__), "test_root") + change_scr_root(root, &example) + end + + describe ".Read" do + let(:content) { Yast::SCR.Read(path(".etc.fstab")) } + + it "reads content of /etc/fstab and returns array" do + expect(content).to be_a(Array) + end + + it "returns an array containing nfs entries" do + expect(content).to satisfy { |r| r.find { |e| e["file"] == "/home/kv2" } } + expect(content).to satisfy { |r| r.find { |e| e["file"] == "/media/new" } } + expect(content).to satisfy { |r| r.find { |e| e["file"] == "/media/new2" } } + end + + it "returns an array containing tmpfs entry" do + expect(content).to satisfy { |r| r.find { |e| e["file"] == "/tmp" } } + end + + it "is able to parse comments" do + pending "need to be fixed" + expect(content).to include("#comment") + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.2.2/library/general/test/agents_test/test_root/etc/fstab new/yast2-3.2.3/library/general/test/agents_test/test_root/etc/fstab --- old/yast2-3.2.2/library/general/test/agents_test/test_root/etc/fstab 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.2.3/library/general/test/agents_test/test_root/etc/fstab 2016-11-07 11:09:36.000000000 +0100 @@ -0,0 +1,7 @@ +UUID=b66c1028-cd4a-4c08-b92d-fc4b9840845d / ext4 noatime,data=writeback,acl,user_xattr 1 1 +UUID=d2811ace-66e0-4ef2-9b68-9b2758359391 /home ext4 noatime,data=writeback,acl 1 2 +192.168.1.2:/home/kv /home/kv2 nfs defaults 0 0 +192.168.1.2:/media/new2 /media/new2 nfs defaults 0 0 +192.168.1.2:/media/new /media/new nfs defaults 0 0 +# my fine comment +tmpfs /tmp tmpfs defaults,size=25% 0 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.2.2/library/packages/src/modules/SignatureCheckDialogs.rb new/yast2-3.2.3/library/packages/src/modules/SignatureCheckDialogs.rb --- old/yast2-3.2.2/library/packages/src/modules/SignatureCheckDialogs.rb 2016-10-19 09:16:01.000000000 +0200 +++ new/yast2-3.2.3/library/packages/src/modules/SignatureCheckDialogs.rb 2016-11-07 11:09:36.000000000 +0100 @@ -56,13 +56,6 @@ # GnuPG key ID used as "Key ID: 1144AAAA444" @s_keyid = _("Key ID") - # Defining icons for dialogs - @msg_icons = { - "error" => "/usr/share/YaST2/theme/current/icons/32x32/apps/msg_error.png", - "warning" => "/usr/share/YaST2/theme/current/icons/32x32/apps/msg_warning.png", - "question" => "/usr/share/YaST2/theme/current/icons/32x32/apps/msg_warning.png" - } - # UI can show images @has_local_image_support = nil @@ -204,37 +197,6 @@ stored_return end - def HandleDoNotShowDialogAgain(default_return, dont_show_dialog_ident, dont_show_dialog_checkboxid, dont_show_url) - dont_show_status = Convert.to_boolean( - UI.QueryWidget(Id(dont_show_dialog_checkboxid), :Value) - ) - # Widget doesn't exist - if dont_show_status.nil? - Builtins.y2warning( - "No such UI widget with ID: %1", - dont_show_dialog_checkboxid - ) - # Checkbox selected -> Don't show again - elsif dont_show_status == true - Builtins.y2debug( - "User decision -- don't show the dialog %1 again, setting default return %2", - dont_show_dialog_ident, - default_return - ) - SetShowThisPopup(dont_show_dialog_ident, false, dont_show_url) - SetDefaultDialogReturn( - dont_show_dialog_ident, - default_return, - dont_show_url - ) - # Checkbox not selected -> Show again - else - SetShowThisPopup(dont_show_dialog_ident, true, dont_show_url) - end - - nil - end - # A semi-public helper. Convert the kernel parameter # to the sysconfig string # @return sysconfig value: yes, yast, no @@ -277,159 +239,6 @@ @check_signatures end - # Function adds delimiter between after_chars characters in the string - # - # @param string to be splitted - # @param [String] delimiter - # @param integer after characters - # @return [String] with delimiters - def StringSplitter(whattosplit, delimiter, after_chars) - splittedstring = "" - after_chars_counter = 0 - max_size = Builtins.size(whattosplit) - - loop do - if Ops.greater_or_equal( - Ops.add(after_chars_counter, after_chars), - max_size - ) - splittedstring = Ops.add( - Ops.add(splittedstring, splittedstring == "" ? "" : delimiter), - Builtins.substring(whattosplit, after_chars_counter) - ) - break - else - splittedstring = Ops.add( - Ops.add(splittedstring, splittedstring == "" ? "" : delimiter), - Builtins.substring(whattosplit, after_chars_counter, after_chars) - ) - after_chars_counter = Ops.add(after_chars_counter, after_chars) - end - end - - splittedstring - end - - # Returns term with message icon - # - # @param string message type "error", "warning" or "question" - # @return [Yast::Term] `Image(...) with margins - def MessageIcon(msg_type) - # lazy loading - if @has_local_image_support.nil? - ui_capabilities = UI.GetDisplayInfo - @has_local_image_support = Ops.get_boolean( - ui_capabilities, - "HasLocalImageSupport", - false - ) - end - - # UI cannot show images - return Empty() unless @has_local_image_support - - if Ops.get(@msg_icons, msg_type).nil? - Builtins.y2warning("Message type %1 not defined", msg_type) - Empty() - else - MarginBox( - 1, - 0.5, - Image(Ops.get(@msg_icons, msg_type, ""), "[!]") - ) - end - end - - # Returns term of yes/no buttons - # - # @param symbol default button `yes or `no - # @return [Yast::Term] with buttons - def YesNoButtons(default_button) - yes_button = PushButton( - Id(:yes), - Opt(:okButton, :key_F10), - Label.YesButton - ) - no_button = PushButton( - Id(:no), - Opt(:cancelButton, :key_F9), - Label.NoButton - ) - - if default_button == :yes - yes_button = PushButton( - Id(:yes), - Opt(:default, :okButton, :key_F10), - Label.YesButton - ) - else - no_button = PushButton( - Id(:no), - Opt(:default, :cancelButton, :key_F9), - Label.NoButton - ) - end - - ButtonBox(yes_button, no_button) - end - - # Returns 'true' (yes), 'false' (no) or 'nil' (cancel) - # - # @return [Boolean] user input yes==true - def WaitForYesNoCancelUserInput - user_input = nil - ret = nil - - loop do - user_input = UI.UserInput - # yes button - if user_input == :yes - ret = true - break - # no button - elsif user_input == :no - ret = false - break - # closing window uisng [x] - elsif user_input == :cancel - ret = nil - break - else - Builtins.y2error("Unknown user input: '%1'", user_input) - next - end - end - - ret - end - - # Waits for user input and checks it agains accepted symbols. - # Returns the default symbol in case of `cancel (user closes the dialog). - # - # @param list <symbol> of accepted symbol by UserInput - # @param symbol default return for case of `cancel - def WaitForSymbolUserInput(list_of_accepted, default_symb) - list_of_accepted = deep_copy(list_of_accepted) - user_input = nil - ret = nil - - loop do - user_input = Convert.to_symbol(UI.UserInput) - if Builtins.contains(list_of_accepted, user_input) - ret = user_input - break - elsif user_input == :cancel - ret = default_symb - break - else - Builtins.y2error("Unknown user input: '%1'", user_input) - next - end - end - - ret - end - # Used for unsiged file or package. Opens dialog asking whether user wants # to use this unsigned item. # @@ -463,6 +272,7 @@ "Install it anyway?" ) else + item_name = strip_download_prefix(item_name) # popup question, %1 stands for the filename # %2 is a repository name # %3 is URL of the repository @@ -484,19 +294,12 @@ UI.OpenDialog( Opt(:decorated), VBox( - HBox( - VCenter(MessageIcon("warning")), - # popup heading - VCenter( - Heading( - if item_type == :package - _("Unsigned Package") - else - _("Unsigned File") - end - ) - ), - HStretch() + Heading( + if item_type == :package + _("Unsigned Package") + else + _("Unsigned File") + end ), MarginBox(0.5, 0.5, Label(description_text)), Left( @@ -550,6 +353,7 @@ "Install it anyway?\n" ) else + item_name = strip_download_prefix(item_name) # popup question, %1 stands for the filename _( "No checksum for file %1 was found in the repository.\n" \ @@ -566,12 +370,8 @@ UI.OpenDialog( Opt(:decorated), VBox( - HBox( - VCenter(MessageIcon("warning")), - # popup heading - VCenter(Heading(_("No Checksum Found"))), - HStretch() - ), + # popup heading + Heading(_("No Checksum Found")), MarginBox(0.5, 0.5, Label(description_text)), Left( MarginBox( @@ -604,166 +404,57 @@ ret end - def GPGKeyAsString(key) + # Used for corrupted file or package. Opens dialog asking whether user wants + # to use this corrupted item. + # + # @param [Symbol] item_type `file or `package + # @param [String] item_name file name or package name + # @param [Hash{String => Object}] key Used key + # @return [Boolean] use or don't use ('true' if 'yes') + def UseCorruptedItem(item_type, item_name, key, repository) key = deep_copy(key) - # Part of the GnuPG key description in popup, %1 is a GnuPG key ID - Ops.add( - Ops.add( - Ops.add( - Ops.add( - Ops.add( - Builtins.sformat(_("ID: %1"), Ops.get_string(key, "id", "")), - "\n" - ), - if Ops.get_string(key, "fingerprint", "").nil? || - Ops.get_string(key, "fingerprint", "") == "" - # Part of the GnuPG key description in popup, %1 is a GnuPG key fingerprint - "" - else - Builtins.sformat( - _("Fingerprint: %1") + "\n", - StringSplitter(Ops.get_string(key, "fingerprint", ""), " ", 4) - ) - end - ), - # Part of the GnuPG key description in popup, %1 is a GnuPG key name - Builtins.sformat(_("Name: %1"), Ops.get_string(key, "name", "")) - ), - if Ops.get_string(key, "created", "") != "" - Ops.add( - "\n", - Builtins.sformat( - _("Created: %1"), - Ops.get_string(key, "created", "") - ) - ) - else - "" - end - ), - if Ops.get_string(key, "expires", "") != "" - Ops.add( - "\n", - Builtins.sformat( - _("Expires: %1"), - Ops.get_string(key, "expires", "") - ) + repo = Pkg.SourceGeneralData(repository) + + description_text = Builtins.sformat( + if item_type == :package + # popup question, %1 stands for the package name, %2 for the complete description of the GnuPG key (multiline) + _( + "Package %1 from repository %2\n" \ + "%3\n" \ + "is signed with the following GnuPG key, but the integrity check failed: %4\n" \ + "\n" \ + "The package has been changed, either by accident or by an attacker,\n" \ + "since the repository creator signed it. Installing it is a big risk\n" \ + "for the integrity and security of your system.\n" \ + "\n" \ + "Install it anyway?\n" ) else - "" - end - ) - end - - def GPGKeyAsTerm(key) - key = deep_copy(key) - rt = Ops.add( - # GPG key property - Builtins.sformat( - "<b>%1</b>%2", - _("ID: "), - Ops.get_string(key, "id", "") - ), - # GPG key property - Builtins.sformat( - "<br><b>%1</b>%2", - _("Name: "), - Ops.get_string(key, "name", "") - ) - ) - if Ops.greater_than( - Builtins.size(Ops.get_string(key, "fingerprint", "")), - 0 - ) - # GPG key property - rt = Ops.add( - rt, - Builtins.sformat( - "<br><b>%1</b>%2", - _("Fingerprint: "), - StringSplitter(Ops.get_string(key, "fingerprint", ""), " ", 4) - ) - ) - end - if Ops.greater_than(Builtins.size(Ops.get_string(key, "created", "")), 0) - # GPG key property - rt = Ops.add( - rt, - Builtins.sformat( - "<br><b>%1</b>%2", - _("Created: "), - Ops.get_string(key, "created", "") - ) - ) - end - if Ops.greater_than(Builtins.size(Ops.get_string(key, "expires", "")), 0) - # GPG key property - rt = Ops.add( - rt, - Builtins.sformat( - "<br><b>%1</b>%2", - _("Expires: "), - Ops.get_string(key, "expires", "") - ) - ) - end - RichText(rt) - end - - # Used for corrupted file or package. Opens dialog asking whether user wants - # to use this corrupted item. - # - # @param [Symbol] item_type `file or `package - # @param [String] item_name file name or package name - # @param [Hash{String => Object}] key Used key - # @return [Boolean] use or don't use ('true' if 'yes') - def UseCorruptedItem(item_type, item_name, key, repository) - key = deep_copy(key) - repo = Pkg.SourceGeneralData(repository) - - description_text = Builtins.sformat( - if item_type == :package - # popup question, %1 stands for the package name, %2 for the complete description of the GnuPG key (multiline) - _( - "Package %1 from repository %2\n" \ - "%3\n" \ - "is signed with the following GnuPG key, but the integrity check failed: %4\n" \ - "\n" \ - "The package has been changed, either by accident or by an attacker,\n" \ - "since the repository creator signed it. Installing it is a big risk\n" \ - "for the integrity and security of your system.\n" \ - "\n" \ - "Install it anyway?\n" - ) - else - # popup question, %1 stands for the filename, %2 for the complete description of the GnuPG key (multiline) - _( - "File %1 from repository %2\n" \ - "%3\n" \ - "is signed with the following GnuPG key, but the integrity check failed: %4\n" \ - "\n" \ - "The file has been changed, either by accident or by an attacker,\n" \ - "since the repository creator signed it. Using it is a big risk\n" \ - "for the integrity and security of your system.\n" \ - "\n" \ - "Use it anyway?\n" - ) - end, - item_name, - Ops.get_locale(repo, "name", _("Unknown")), - Ops.get_locale(repo, "url", _("Unknown")), - Ops.add("\n\n", GPGKeyAsString(key)) + item_name = strip_download_prefix(item_name) + # popup question, %1 stands for the filename, %2 for the complete description of the GnuPG key (multiline) + _( + "File %1 from repository %2\n" \ + "%3\n" \ + "is signed with the following GnuPG key, but the integrity check failed: %4\n" \ + "\n" \ + "The file has been changed, either by accident or by an attacker,\n" \ + "since the repository creator signed it. Using it is a big risk\n" \ + "for the integrity and security of your system.\n" \ + "\n" \ + "Use it anyway?\n" + ) + end, + item_name, + Ops.get_locale(repo, "name", _("Unknown")), + Ops.get_locale(repo, "url", _("Unknown")), + Ops.add("\n\n", GPGKeyAsString(key)) ) UI.OpenDialog( Opt(:decorated), VBox( # popup heading - HBox( - VCenter(MessageIcon("error")), - VCenter(Heading(_("Validation Check Failed"))), - HStretch() - ), + Heading(_("Validation Check Failed")), MarginBox(0.5, 0.5, Label(description_text)), YesNoButtons(:no) ) @@ -802,6 +493,7 @@ "Install it anyway?" ) else + item_name = strip_download_prefix(item_name) # popup question, %1 stands for the filename, %2 for the complex multiline description of the GnuPG key _( "The file %1\n" \ @@ -830,12 +522,8 @@ UI.OpenDialog( Opt(:decorated), VBox( - HBox( - VCenter(MessageIcon("warning")), - # popup heading - VCenter(Heading(_("Unknown GnuPG Key"))), - HStretch() - ), + # popup heading + Heading(_("Unknown GnuPG Key")), MarginBox(0.5, 0.5, Label(description_text)), Left( MarginBox( @@ -896,6 +584,7 @@ "to skip the package.\n" ) else + item_name = strip_download_prefix(item_name) # popup question, %1 stands for the filename, %2 for the key ID, %3 for the key name _( "The file %1 is digitally signed\n" \ @@ -917,12 +606,8 @@ UI.OpenDialog( Opt(:decorated), VBox( - HBox( - VCenter(MessageIcon("warning")), - # popup heading - VCenter(Heading(_("Signed with Untrusted Public Key"))), - HStretch() - ), + # popup heading + Heading(_("Signed with Untrusted Public Key")), MarginBox(0.5, 0.5, Label(description_text)), ButtonBox( # push button @@ -1028,12 +713,8 @@ HWeight( 5, VBox( - HBox( - VCenter(MessageIcon("question")), - # popup heading - VCenter(Heading(_("Import Untrusted GnuPG Key"))), - HStretch() - ), + # popup heading + Heading(_("Import Untrusted GnuPG Key")), # dialog message MarginBox( 0.4, @@ -1068,50 +749,6 @@ ret == :trust end - def RunSimpleErrorPopup(heading, description_text, dont_show_dialog_ident, dont_show_dialog_param) - UI.OpenDialog( - Opt(:decorated), - VBox( - # popup heading - HBox( - VCenter(MessageIcon("error")), - # dialog heading - displayed in a big bold font - VCenter(Heading(heading)), - HStretch() - ), - MarginBox(0.5, 0.5, Label(description_text)), - Left( - MarginBox( - 0, - 1.2, - CheckBox( - Id(:dont_show_again), - Message.DoNotShowMessageAgain, - GetShowThisPopup(dont_show_dialog_ident, dont_show_dialog_param) ? false : true - ) - ) - ), - YesNoButtons(:no) - ) - ) - - ret = WaitForYesNoCancelUserInput() - # default value - ret = false if ret.nil? - - # Store the don't show value, store the default return value - HandleDoNotShowDialogAgain( - ret, - dont_show_dialog_ident, - :dont_show_again, - dont_show_dialog_param - ) - - UI.CloseDialog - - ret - end - # Ask user to accept wrong digest # @param [String] filename Name of the file # @param [String] requested_digest Expected checksum @@ -1119,6 +756,7 @@ # @param [String] dont_show_dialog_ident Uniq ID for "don't show again" # @return [Boolean] true when user accepts the file def UseFileWithWrongDigest(filename, requested_digest, found_digest, dont_show_dialog_ident) + filename = strip_download_prefix(filename) description_text = # popup question, %1 stands for the filename, %2 is expected checksum # %3 is the current checksum (e.g. "803a8ff00d00c9075a1bd223a480bcf92d2481c1") @@ -1156,6 +794,7 @@ # @param [String] dont_show_dialog_ident Uniq ID for "don't show again" # @return [Boolean] true when user accepts the file def UseFileWithUnknownDigest(filename, digest, dont_show_dialog_ident) + filename = strip_download_prefix(filename) description_text = # popup question, %1 stands for the filename, %2 is expected digest, %3 is the current digest Builtins.sformat( @@ -1197,6 +836,315 @@ publish function: :ImportGPGKeyIntoTrustedDialog, type: "boolean (map <string, any>, integer)" publish function: :UseFileWithWrongDigest, type: "boolean (string, string, string, string)" publish function: :UseFileWithUnknownDigest, type: "boolean (string, string, string)" + + private + + # helper to strip download path. It uses internal knowledge that download + # prefix ends in TmpDir.* zypp location + def strip_download_prefix(path) + path.sub(/\A\/.*\/TmpDir\.[^\/]+\//, "") + end + + def HandleDoNotShowDialogAgain(default_return, dont_show_dialog_ident, dont_show_dialog_checkboxid, dont_show_url) + dont_show_status = Convert.to_boolean( + UI.QueryWidget(Id(dont_show_dialog_checkboxid), :Value) + ) + # Widget doesn't exist + if dont_show_status.nil? + Builtins.y2warning( + "No such UI widget with ID: %1", + dont_show_dialog_checkboxid + ) + # Checkbox selected -> Don't show again + elsif dont_show_status == true + Builtins.y2debug( + "User decision -- don't show the dialog %1 again, setting default return %2", + dont_show_dialog_ident, + default_return + ) + SetShowThisPopup(dont_show_dialog_ident, false, dont_show_url) + SetDefaultDialogReturn( + dont_show_dialog_ident, + default_return, + dont_show_url + ) + # Checkbox not selected -> Show again + else + SetShowThisPopup(dont_show_dialog_ident, true, dont_show_url) + end + + nil + end + + # Function adds delimiter between after_chars characters in the string + # + # @param string to be splitted + # @param [String] delimiter + # @param integer after characters + # @return [String] with delimiters + def StringSplitter(whattosplit, delimiter, after_chars) + splittedstring = "" + after_chars_counter = 0 + max_size = Builtins.size(whattosplit) + + loop do + if Ops.greater_or_equal( + Ops.add(after_chars_counter, after_chars), + max_size + ) + splittedstring = Ops.add( + Ops.add(splittedstring, splittedstring == "" ? "" : delimiter), + Builtins.substring(whattosplit, after_chars_counter) + ) + break + else + splittedstring = Ops.add( + Ops.add(splittedstring, splittedstring == "" ? "" : delimiter), + Builtins.substring(whattosplit, after_chars_counter, after_chars) + ) + after_chars_counter = Ops.add(after_chars_counter, after_chars) + end + end + + splittedstring + end + + # Returns term of yes/no buttons + # + # @param symbol default button `yes or `no + # @return [Yast::Term] with buttons + def YesNoButtons(default_button) + yes_button = PushButton( + Id(:yes), + Opt(:okButton, :key_F10), + Label.YesButton + ) + no_button = PushButton( + Id(:no), + Opt(:cancelButton, :key_F9), + Label.NoButton + ) + + if default_button == :yes + yes_button = PushButton( + Id(:yes), + Opt(:default, :okButton, :key_F10), + Label.YesButton + ) + else + no_button = PushButton( + Id(:no), + Opt(:default, :cancelButton, :key_F9), + Label.NoButton + ) + end + + ButtonBox(yes_button, no_button) + end + + # Returns 'true' (yes), 'false' (no) or 'nil' (cancel) + # + # @return [Boolean] user input yes==true + def WaitForYesNoCancelUserInput + user_input = nil + ret = nil + + loop do + user_input = UI.UserInput + # yes button + if user_input == :yes + ret = true + break + # no button + elsif user_input == :no + ret = false + break + # closing window uisng [x] + elsif user_input == :cancel + ret = nil + break + else + Builtins.y2error("Unknown user input: '%1'", user_input) + next + end + end + + ret + end + + # Waits for user input and checks it agains accepted symbols. + # Returns the default symbol in case of `cancel (user closes the dialog). + # + # @param list <symbol> of accepted symbol by UserInput + # @param symbol default return for case of `cancel + def WaitForSymbolUserInput(list_of_accepted, default_symb) + list_of_accepted = deep_copy(list_of_accepted) + user_input = nil + ret = nil + + loop do + user_input = Convert.to_symbol(UI.UserInput) + if Builtins.contains(list_of_accepted, user_input) + ret = user_input + break + elsif user_input == :cancel + ret = default_symb + break + else + Builtins.y2error("Unknown user input: '%1'", user_input) + next + end + end + + ret + end + + # FIXME: add GPG class that have method to_string and to_term + def GPGKeyAsString(key) + key = deep_copy(key) + # Part of the GnuPG key description in popup, %1 is a GnuPG key ID + Ops.add( + Ops.add( + Ops.add( + Ops.add( + Ops.add( + Builtins.sformat(_("ID: %1"), Ops.get_string(key, "id", "")), + "\n" + ), + if Ops.get_string(key, "fingerprint", "").nil? || + Ops.get_string(key, "fingerprint", "") == "" + # Part of the GnuPG key description in popup, %1 is a GnuPG key fingerprint + "" + else + Builtins.sformat( + _("Fingerprint: %1") + "\n", + StringSplitter(Ops.get_string(key, "fingerprint", ""), " ", 4) + ) + end + ), + # Part of the GnuPG key description in popup, %1 is a GnuPG key name + Builtins.sformat(_("Name: %1"), Ops.get_string(key, "name", "")) + ), + if Ops.get_string(key, "created", "") != "" + Ops.add( + "\n", + Builtins.sformat( + _("Created: %1"), + Ops.get_string(key, "created", "") + ) + ) + else + "" + end + ), + if Ops.get_string(key, "expires", "") != "" + Ops.add( + "\n", + Builtins.sformat( + _("Expires: %1"), + Ops.get_string(key, "expires", "") + ) + ) + else + "" + end + ) + end + + # FIXME: add GPG class that have method to_string and to_term + def GPGKeyAsTerm(key) + key = deep_copy(key) + rt = Ops.add( + # GPG key property + Builtins.sformat( + "<b>%1</b>%2", + _("ID: "), + Ops.get_string(key, "id", "") + ), + # GPG key property + Builtins.sformat( + "<br><b>%1</b>%2", + _("Name: "), + Ops.get_string(key, "name", "") + ) + ) + if Ops.greater_than( + Builtins.size(Ops.get_string(key, "fingerprint", "")), + 0 + ) + # GPG key property + rt = Ops.add( + rt, + Builtins.sformat( + "<br><b>%1</b>%2", + _("Fingerprint: "), + StringSplitter(Ops.get_string(key, "fingerprint", ""), " ", 4) + ) + ) + end + if Ops.greater_than(Builtins.size(Ops.get_string(key, "created", "")), 0) + # GPG key property + rt = Ops.add( + rt, + Builtins.sformat( + "<br><b>%1</b>%2", + _("Created: "), + Ops.get_string(key, "created", "") + ) + ) + end + if Ops.greater_than(Builtins.size(Ops.get_string(key, "expires", "")), 0) + # GPG key property + rt = Ops.add( + rt, + Builtins.sformat( + "<br><b>%1</b>%2", + _("Expires: "), + Ops.get_string(key, "expires", "") + ) + ) + end + RichText(rt) + end + + def RunSimpleErrorPopup(heading, description_text, dont_show_dialog_ident, dont_show_dialog_param) + UI.OpenDialog( + Opt(:decorated), + VBox( + # dialog heading - displayed in a big bold font + Heading(heading), + MarginBox(0.5, 0.5, Label(description_text)), + Left( + MarginBox( + 0, + 1.2, + CheckBox( + Id(:dont_show_again), + Message.DoNotShowMessageAgain, + GetShowThisPopup(dont_show_dialog_ident, dont_show_dialog_param) ? false : true + ) + ) + ), + YesNoButtons(:no) + ) + ) + + ret = WaitForYesNoCancelUserInput() + # default value + ret = false if ret.nil? + + # Store the don't show value, store the default return value + HandleDoNotShowDialogAgain( + ret, + dont_show_dialog_ident, + :dont_show_again, + dont_show_dialog_param + ) + + UI.CloseDialog + + ret + end end SignatureCheckDialogs = SignatureCheckDialogsClass.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.2.2/package/yast2.changes new/yast2-3.2.3/package/yast2.changes --- old/yast2-3.2.2/package/yast2.changes 2016-10-19 09:16:01.000000000 +0200 +++ new/yast2-3.2.3/package/yast2.changes 2016-11-07 11:09:36.000000000 +0100 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Thu Nov 3 12:51:09 UTC 2016 - [email protected] + +- fix do not show again for packages downloaded to temporary + directory (bsc#481011) +- remove icons from signature check dialogs (bsc#875201) +- 3.2.3 + +------------------------------------------------------------------- Tue Oct 18 13:18:55 CEST 2016 - [email protected] - Add-on module: Do not escape characters like ":" in the path diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.2.2/package/yast2.spec new/yast2-3.2.3/package/yast2.spec --- old/yast2-3.2.2/package/yast2.spec 2016-10-19 09:16:01.000000000 +0200 +++ new/yast2-3.2.3/package/yast2.spec 2016-11-07 11:09:36.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.2.2 +Version: 3.2.3 Release: 0 Summary: YaST2 - Main Package License: GPL-2.0
