[yast-commit] [ci_new_pac] JFYI yast2-registration -> sle12
![](https://seccdn.libravatar.org/avatar/c832a8d3457e1cacf4f28b56b637136d.jpg?s=120&d=mm&r=g)
Script 'mail_helper' called by bg Hello packager, This is just FYI. Your package was checked in in distribution "sle12" by autobuild-member: bg. Here comes the log... ---------------------------%<------------------------------ Hi, here is the log from ci_new_pac /mounts/work_src_done/SLE12/yast2-registration -> sle12 ## BNC# 880504 : "German EULA not offered for SDK" (RESOLVED/FIXED) ## BNC# 878976 : "Inconsistent EULA dialog for extension" (ASSIGNED/) Changes: -------- --- /work/SRC/SUSE:SLE-12:GA/yast2-registration/yast2-registration.changes 2014-05-26 14:03:08.000000000 +0200 +++ /mounts/work_src_done/SLE12/yast2-registration/yast2-registration.changes 2014-06-02 13:44:11.000000000 +0200 @@ -1,0 +2,7 @@ +Fri May 30 11:43:18 UTC 2014 - lslezak@suse.cz + +- fixed displaying EULA translations (bnc#880504) +- removed EULA printing text (part of bnc#878976) +- 3.1.61 + +------------------------------------------------------------------- calling whatdependson for sle12-i586 Packages directly triggered for rebuild: - yast2-registration ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/SUSE:SLE-12:GA/yast2-registration (Old) and /mounts/work_src_done/SLE12/yast2-registration (BS:build ID:38809 MAIL:yast-commit@opensuse.org) (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-registration", Maintainer is "yast-commit@opensuse.org" Old: ---- yast2-registration-3.1.60.tar.bz2 New: ---- yast2-registration-3.1.61.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-registration.spec ++++++ --- /var/tmp/diff_new_pack.Qt53Cj/_old 2014-06-02 15:21:37.000000000 +0200 +++ /var/tmp/diff_new_pack.Qt53Cj/_new 2014-06-02 15:21:37.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 3.1.60 +Version: 3.1.61 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -34,7 +34,7 @@ Requires: rubygem-suse-connect >= 0.0.16 Requires: yast2-slp >= 3.1.2 Requires: yast2-add-on >= 3.1.3 -Requires: yast2-packager >= 3.1.16 +Requires: yast2-packager >= 3.1.21 BuildRequires: yast2 >= 3.1.26 BuildRequires: update-desktop-files @@ -42,7 +42,7 @@ BuildRequires: rubygem-rspec BuildRequires: rubygem-suse-connect >= 0.0.16 BuildRequires: yast2-slp >= 3.1.2 -BuildRequires: yast2-packager >= 3.1.16 +BuildRequires: yast2-packager >= 3.1.21 BuildArch: noarch ++++++ yast2-registration-3.1.60.tar.bz2 -> yast2-registration-3.1.61.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.60/Gemfile new/yast2-registration-3.1.61/Gemfile --- old/yast2-registration-3.1.60/Gemfile 2014-05-26 13:20:31.000000000 +0200 +++ new/yast2-registration-3.1.61/Gemfile 2014-06-02 13:40:30.000000000 +0200 @@ -4,7 +4,7 @@ group :test do gem "rake" - gem "rspec" + gem "rspec", "~> 2.14.0" gem "simplecov", :require => false gem "coveralls", :require => false if ENV["TRAVIS"] end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.60/package/yast2-registration.changes new/yast2-registration-3.1.61/package/yast2-registration.changes --- old/yast2-registration-3.1.60/package/yast2-registration.changes 2014-05-26 13:20:31.000000000 +0200 +++ new/yast2-registration-3.1.61/package/yast2-registration.changes 2014-06-02 13:40:30.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri May 30 11:43:18 UTC 2014 - lslezak@suse.cz + +- fixed displaying EULA translations (bnc#880504) +- removed EULA printing text (part of bnc#878976) +- 3.1.61 + +------------------------------------------------------------------- Mon May 26 11:15:39 UTC 2014 - jreidinger@suse.com - empty eula url mean no eula (Bnc#879456) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.60/package/yast2-registration.spec new/yast2-registration-3.1.61/package/yast2-registration.spec --- old/yast2-registration-3.1.60/package/yast2-registration.spec 2014-05-26 13:20:31.000000000 +0200 +++ new/yast2-registration-3.1.61/package/yast2-registration.spec 2014-06-02 13:40:30.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 3.1.60 +Version: 3.1.61 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -34,7 +34,7 @@ Requires: rubygem-suse-connect >= 0.0.16 Requires: yast2-slp >= 3.1.2 Requires: yast2-add-on >= 3.1.3 -Requires: yast2-packager >= 3.1.16 +Requires: yast2-packager >= 3.1.21 BuildRequires: yast2 >= 3.1.26 BuildRequires: update-desktop-files @@ -42,7 +42,7 @@ BuildRequires: rubygem-rspec BuildRequires: rubygem-suse-connect >= 0.0.16 BuildRequires: yast2-slp >= 3.1.2 -BuildRequires: yast2-packager >= 3.1.16 +BuildRequires: yast2-packager >= 3.1.21 BuildArch: noarch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.60/src/lib/registration/ui/addon_eula_dialog.rb new/yast2-registration-3.1.61/src/lib/registration/ui/addon_eula_dialog.rb --- old/yast2-registration-3.1.60/src/lib/registration/ui/addon_eula_dialog.rb 2014-05-26 13:20:31.000000000 +0200 +++ new/yast2-registration-3.1.61/src/lib/registration/ui/addon_eula_dialog.rb 2014-06-02 13:40:31.000000000 +0200 @@ -1,6 +1,7 @@ require "yast" require "registration/eula_downloader" +require "registration/helpers" module Registration module UI @@ -9,8 +10,9 @@ include Yast::Logger include Yast::I18n include Yast::UIShortcuts + include Yast - attr_accessor :addons + attr_reader :addons Yast.import "Popup" Yast.import "ProductLicense" @@ -58,6 +60,9 @@ private + # ask user to accept an addon EULA + # @param addon [SUSE::Connect::Product] the addon + # @return [Boolean] true if the EULA has been accepted def accept_eula(addon) Dir.mktmpdir("extension-eula-") do |tmpdir| begin @@ -79,23 +84,71 @@ return true end - Yast::ProductLicense.AskLicensesAgreementWithHeading( - [tmpdir], - Yast::ProductLicense.license_patterns, - # do not continue if not accepted - "abort", - # enable [Back] - true, - # base product - false, - # require agreement - true, - # dialog title - _("Extension and Module License Agreement"), - # %s is an extension name, e.g. "SUSE Linux Enterprise Software Development Kit" - _("%s License Agreement") % addon.short_name - ) == :accepted + id = "#{addon.short_name} extension EULA" + Yast::ProductLicense.SetAcceptanceNeeded(id, true) + # TODO reset ProductLicense::license_file_print attribute + + # %s is an extension name, e.g. "SUSE Linux Enterprise Software Development Kit" + title = _("%s License Agreement") % addon.short_name + eulas = read_downloaded_eulas(tmpdir) + enable_back = true + + Yast::ProductLicense.DisplayLicenseDialogWithTitle(eulas.keys, enable_back, + eula_lang(eulas.keys), arg_ref(eulas), id, title) + + base_product = false + action = "abort" + ret = Yast::ProductLicense.HandleLicenseDialogRet(arg_ref(eulas), base_product, action) + log.debug "EULA dialog result: #{ret}" + + accepted = ret == :accepted + log.info "EULA accepted: #{accepted}" + accepted + end + end + + # get the EULA translation to display + def eula_lang(eula_langs) + current_language = Helpers.language || "en_US" + current_language.tr!("-", "_") + + # exact match + if eula_langs.include?(current_language) + return current_language + end + + # partial match or English fallback + eula_langs.find { |eula_lang| remove_country_suffix(eula_lang) == current_language } || "en_US" + end + + # read downloaded EULAs + # @param dir [String] directly with EULA files + # @return [Hash<String,String>] mapping { <locale> => <file_name> } + def read_downloaded_eulas(dir) + eulas = {} + + Dir["#{dir}/license.*"].each do |license| + file = File.basename(license) + + case file + when "license.txt" + eulas["en_US"] = license + when /\Alicense\.(.*)\.txt\z/ + eulas[$1] = license + else + log.warn "Ignoring unknown file: #{file}" + end end + + log.info "EULA files in #{dir}: #{eulas}" + eulas + end + + # helper for removing the country suffix, e.g. "de_DE" => "de" + # @param code [String] input locale name + # @return [String] result locale name + def remove_country_suffix(code) + code.sub(/_.*\z/, "") end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.60/test/eula_downloader_spec.rb new/yast2-registration-3.1.61/test/eula_downloader_spec.rb --- old/yast2-registration-3.1.60/test/eula_downloader_spec.rb 2014-05-26 13:20:31.000000000 +0200 +++ new/yast2-registration-3.1.61/test/eula_downloader_spec.rb 2014-06-02 13:40:31.000000000 +0200 @@ -17,13 +17,13 @@ de_eula = "Deutsch EULA" index = Net::HTTPSuccess.new("1.1", 200, "OK") - index.should_receive(:body).and_return("directory.yast\nlicense.txt\nlicense.de.txt") + expect(index).to receive(:body).and_return("directory.yast\nlicense.txt\nlicense.de.txt") license = Net::HTTPSuccess.new("1.1", 200, "OK") - license.should_receive(:body).and_return(en_eula) + expect(license).to receive(:body).and_return(en_eula) license_de = Net::HTTPSuccess.new("1.1", 200, "OK") - license_de.should_receive(:body).and_return(de_eula) + expect(license_de).to receive(:body).and_return(de_eula) # mock the responses for respective URL paths Net::HTTP.any_instance.stub(:request) do |request| @@ -58,10 +58,10 @@ with(an_instance_of(Net::HTTP::Get)).and_return(index) Dir.mktmpdir do |tmpdir| - loader = Registration::EulaDownloader.new("https://example.com/eula", tmpdir) + loader = Registration::EulaDownloader.new("http://example.com/eula", tmpdir) expect{loader.download}.to raise_error RuntimeError, - "Downloading https://example.com/eula/directory.yast failed: Not Found" + "Downloading http://example.com/eula/directory.yast failed: Not Found" # nothing saved expect(Dir.entries(tmpdir)).to match_array([".", ".."]) continue with "q"... Checked in at Mon Jun 2 15:22:02 CEST 2014 by bg Remember to have fun... -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
bg