[yast-commit] [ci_new_pac] JFYI yast2-registration -> sle12
Script 'mail_helper' called by ro Hello packager, This is just FYI. Your package was checked in in distribution "sle12" by autobuild-member: ro. Here comes the log... ---------------------------%<------------------------------ Hi, here is the log from ci_new_pac /mounts/work_src_done/SLE12/yast2-registration -> sle12 Changes: -------- --- /work/SRC/SUSE:SLE-12:GA/yast2-registration/yast2-registration.changes 2014-02-27 16:15:59.000000000 +0100 +++ /mounts/work_src_done/SLE12/yast2-registration/yast2-registration.changes 2014-03-03 16:17:11.000000000 +0100 @@ -1,0 +2,7 @@ +Mon Mar 3 13:18:11 UTC 2014 - lslezak@suse.cz + +- allow changing the registration server URL in installation via + boot command line ("reg_url" option) (FATE#312433) +- 3.1.14 + +------------------------------------------------------------------- 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:33759 MAIL:yast-commit@opensuse.org) (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-registration", Maintainer is "yast-commit@opensuse.org" Old: ---- yast2-registration-3.1.13.tar.bz2 New: ---- yast2-registration-3.1.14.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-registration.spec ++++++ --- /var/tmp/diff_new_pack.Wfe9es/_old 2014-03-03 17:48:19.000000000 +0100 +++ /var/tmp/diff_new_pack.Wfe9es/_new 2014-03-03 17:48:19.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 3.1.13 +Version: 3.1.14 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -37,6 +37,7 @@ BuildRequires: yast2 >= 2.23.13 BuildRequires: update-desktop-files BuildRequires: yast2-devtools >= 3.1.6 +BuildRequires: rubygem-rspec BuildArch: noarch ++++++ yast2-registration-3.1.13.tar.bz2 -> yast2-registration-3.1.14.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.13/package/yast2-registration.changes new/yast2-registration-3.1.14/package/yast2-registration.changes --- old/yast2-registration-3.1.13/package/yast2-registration.changes 2014-02-27 14:14:53.000000000 +0100 +++ new/yast2-registration-3.1.14/package/yast2-registration.changes 2014-03-03 16:14:50.000000000 +0100 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Mar 3 13:18:11 UTC 2014 - lslezak@suse.cz + +- allow changing the registration server URL in installation via + boot command line ("reg_url" option) (FATE#312433) +- 3.1.14 + +------------------------------------------------------------------- Thu Feb 27 08:35:31 UTC 2014 - lslezak@suse.cz - Check for errors when adding/refreshing services diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.13/package/yast2-registration.spec new/yast2-registration-3.1.14/package/yast2-registration.spec --- old/yast2-registration-3.1.13/package/yast2-registration.spec 2014-02-27 14:14:53.000000000 +0100 +++ new/yast2-registration-3.1.14/package/yast2-registration.spec 2014-03-03 16:14:50.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 3.1.13 +Version: 3.1.14 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -37,6 +37,7 @@ BuildRequires: yast2 >= 2.23.13 BuildRequires: update-desktop-files BuildRequires: yast2-devtools >= 3.1.6 +BuildRequires: rubygem-rspec BuildArch: noarch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.13/src/clients/inst_scc.rb new/yast2-registration-3.1.14/src/clients/inst_scc.rb --- old/yast2-registration-3.1.13/src/clients/inst_scc.rb 2014-02-27 14:14:53.000000000 +0100 +++ new/yast2-registration-3.1.14/src/clients/inst_scc.rb 2014-03-03 16:14:50.000000000 +0100 @@ -111,6 +111,13 @@ # set the current language to receive translated error messages scc.language = Registration::Helpers.language + reg_url = Registration::Helpers.registration_url + + if reg_url + log.info "Using custom registration URL: #{reg_url.inspect}" + scc.url = reg_url + end + # announce (register the system) first credentials = run_with_feedback(_("Registering the System..."), _("Contacting the SUSE Customer Center server")) do scc.announce diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.13/src/lib/registration/helpers.rb new/yast2-registration-3.1.14/src/lib/registration/helpers.rb --- old/yast2-registration-3.1.13/src/lib/registration/helpers.rb 2014-02-27 14:14:53.000000000 +0100 +++ new/yast2-registration-3.1.14/src/lib/registration/helpers.rb 2014-03-03 16:14:50.000000000 +0100 @@ -28,6 +28,12 @@ class Helpers include Yast::Logger + Yast.import "Linuxrc" + Yast.import "Mode" + + # name of the boot parameter + BOOT_PARAM = "reg_url" + # Get the language for using in HTTP requests (in "Accept-Language" header) def self.language lang = Yast::WFM.GetLanguage @@ -48,5 +54,39 @@ lang end + + # Evaluate the registration URL to use + # @see https://github.com/yast/yast-registration/wiki/Changing-the-Registration-Ser... + # for details + # @return [String,nil] registration URL, nil means use the default + def self.registration_url + if Yast::Mode.installation + # boot command line if present + boot_url = boot_reg_url + return boot_url if boot_url + end + + # TODO FIXME: add SLP discovery + + # no custom URL, use the default + nil + end + + private + + # return the boot command line parameter + def self.boot_reg_url + parameters = Yast::Linuxrc.InstallInf("Cmdline") + return nil unless parameters + + registration_param = parameters.split.grep(/\A#{BOOT_PARAM}=/i).last + return nil unless registration_param + + reg_url = registration_param.split('=', 2).last + log.info "Boot reg_url option: #{reg_url.inspect}" + + reg_url + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.13/test/Makefile.am new/yast2-registration-3.1.14/test/Makefile.am --- old/yast2-registration-3.1.13/test/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-registration-3.1.14/test/Makefile.am 2014-03-03 16:14:50.000000000 +0100 @@ -0,0 +1,7 @@ +TESTS = \ + helpers_spec.rb + +TEST_EXTENSIONS = .rb +RB_LOG_COMPILER = rspec --format doc +VERBOSE = 1 +EXTRA_DIST = $(TESTS) spec_helper.rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.13/test/helpers_spec.rb new/yast2-registration-3.1.14/test/helpers_spec.rb --- old/yast2-registration-3.1.13/test/helpers_spec.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-registration-3.1.14/test/helpers_spec.rb 2014-03-03 16:14:50.000000000 +0100 @@ -0,0 +1,52 @@ +#! /usr/bin/env rspec + +require_relative "spec_helper" + +require "registration/helpers" + +describe Registration::Helpers do + + describe ".registration_url" do + context "at installation" do + before do + expect(Yast::Mode).to receive(:installation).and_return(true) + end + + it "returns 'reg_url' boot parameter from Linuxrc" do + url = "https://example.com/register" + expect(Yast::Linuxrc).to receive(:InstallInf).with("Cmdline").and_return("splash=silent reg_url=#{url} vga=0x314") + expect(Registration::Helpers.registration_url).to eq(url) + end + + it "uses the last 'reg_url' boot parameter from Linuxrc" do + url1 = "https://example.com/register" + url2 = "https://foo.org/registration" + expect(Yast::Linuxrc).to receive(:InstallInf).with("Cmdline").and_return("splash=silent reg_url=#{url1} reg_url=#{url2} vga=0x314") + expect(Registration::Helpers.registration_url).to eq(url2) + end + + it "returns nil when no custom URL is required in Linuxrc" do + expect(Yast::Linuxrc).to receive(:InstallInf).with("Cmdline").and_return("splash=silent vga=0x314") + expect(Registration::Helpers.registration_url).to be_nil + end + + it "returns nil when no boot command line is defined in Linuxrc" do + expect(Yast::Linuxrc).to receive(:InstallInf).with("Cmdline").and_return(nil) + expect(Registration::Helpers.registration_url).to be_nil + end + end + + context "at installed system" do + before do + expect(Yast::Mode).to receive(:installation).and_return(false) + end + + it "ignores Linuxrc boot parameters" do + # must not ask Linuxrc at all + expect(Yast::Linuxrc).to receive(:InstallInf).never + expect(Registration::Helpers.registration_url).to be_nil + end + end + end + +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.13/test/spec_helper.rb new/yast2-registration-3.1.14/test/spec_helper.rb --- old/yast2-registration-3.1.13/test/spec_helper.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-registration-3.1.14/test/spec_helper.rb 2014-03-03 16:14:50.000000000 +0100 @@ -0,0 +1,6 @@ +if ENV["COVERAGE"] + require "simplecov" + SimpleCov.start +end + +$:.unshift(File.expand_path("../../src/lib", __FILE__)) continue with "q"... Checked in at Mon Mar 3 17:48:47 CET 2014 by ro 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)
-
ro