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-05 17:48:28.000000000 +0100 +++ /mounts/work_src_done/SLE12/yast2-registration/yast2-registration.changes 2014-02-12 16:37:10.000000000 +0100 @@ -1,0 +2,7 @@ +Wed Feb 12 14:12:23 UTC 2014 - lslezak@suse.cz + +- pass the repository services returned by SCC to libzypp +- make /etc/zypp writable during installation +- 3.1.4 + +------------------------------------------------------------------- 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:32541 MAIL:yast-commit@opensuse.org) (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-registration", Maintainer is "yast-commit@opensuse.org" Old: ---- yast2-registration-3.1.3.tar.bz2 New: ---- yast2-registration-3.1.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-registration.spec ++++++ --- /var/tmp/diff_new_pack.pjvVDh/_old 2014-02-12 17:59:30.000000000 +0100 +++ /var/tmp/diff_new_pack.pjvVDh/_new 2014-02-12 17:59:30.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 3.1.3 +Version: 3.1.4 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-registration-3.1.3.tar.bz2 -> yast2-registration-3.1.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.3/package/yast2-registration.changes new/yast2-registration-3.1.4/package/yast2-registration.changes --- old/yast2-registration-3.1.3/package/yast2-registration.changes 2014-02-04 18:10:36.000000000 +0100 +++ new/yast2-registration-3.1.4/package/yast2-registration.changes 2014-02-12 16:35:22.000000000 +0100 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Feb 12 14:12:23 UTC 2014 - lslezak@suse.cz + +- pass the repository services returned by SCC to libzypp +- make /etc/zypp writable during installation +- 3.1.4 + +------------------------------------------------------------------- Mon Feb 3 20:00:19 UTC 2014 - lslezak@suse.cz - use scc_api gem for communication with SCC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.3/package/yast2-registration.spec new/yast2-registration-3.1.4/package/yast2-registration.spec --- old/yast2-registration-3.1.3/package/yast2-registration.spec 2014-02-04 18:10:36.000000000 +0100 +++ new/yast2-registration-3.1.4/package/yast2-registration.spec 2014-02-12 16:35:22.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 3.1.3 +Version: 3.1.4 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.3/src/clients/inst_scc.rb new/yast2-registration-3.1.4/src/clients/inst_scc.rb --- old/yast2-registration-3.1.3/src/clients/inst_scc.rb 2014-02-04 18:10:36.000000000 +0100 +++ new/yast2-registration-3.1.4/src/clients/inst_scc.rb 2014-02-12 16:35:22.000000000 +0100 @@ -25,10 +25,15 @@ # use external rubygem for SCC communication require "scc_api" +require "tmpdir" +require "fileutils" + module Yast class InstSccClient < Client include Yast::Logger + ZYPP_DIR = "/etc/zypp" + def main Yast.import "UI" Yast.import "Pkg" @@ -80,28 +85,46 @@ scc = SccApi::Connection.new(email, reg_code) # announce (register the system) first - begin - Popup.ShowFeedback(_("Registering the System..."), _("Contacting the SUSE Customer Center server")) - result = scc.announce - ensure - Popup.ClearFeedback + credentials = run_with_feedback(_("Registering the System..."), _("Contacting the SUSE Customer Center server")) do + scc.announce end - # then register the product(s) - begin - Popup.ShowFeedback(_("Registering the Product..."), _("Contacting the SUSE Customer Center server")) + # ensure the zypp config directories are writable in inst-sys + ensure_zypp_config_writable + + # write the global credentials + credentials.write + # then register the product(s) + product_services = run_with_feedback(_("Registering the Product..."), _("Contacting the SUSE Customer Center server")) do # there will be just one base product, but theoretically there can be more... - selected_base_products.each do |base_product| + selected_base_products.map do |base_product| log.info("Registering base product: #{base_product.inspect}") - result = scc.register(base_product) + scc.register(base_product) + end + end - # TODO: remove this - # Popup.Message("SCC response:\n#{JSON.pretty_generate(result)}") - Popup.Message("The system has been registered.") + add_services(product_services, credentials) + end + + # add the services to libzypp and load (refresh) them + def add_services(product_services, credentials) + # each registered product + product_services.each do |product_service| + # services for the each product + product_service.services.each do |service| + log.info "Adding service #{service.name.inspect} (#{service.url})" + + # TODO FIXME: SCC currenly does not return credentials for the service, + # just reuse the global credentials and save to a different file + credentials.file = service.name + "_credentials" + credentials.write + + Pkg.ServiceAdd(service.name, service.url.to_s) + # refresh works only for saved services + Pkg.ServiceSave(service.name) + Pkg.ServiceRefresh(service.name) end - ensure - Popup.ClearFeedback end end @@ -137,7 +160,8 @@ end def selected_base_products - # just for debugging: return [{"name" => "SUSE_SLES", "arch" => "x86_64", "version" => "12"}] + # just for debugging: + # return [{"name" => "SUSE_SLES", "arch" => "x86_64", "version" => "12-"}] # source 0 is the base installation repo, the repos added later are considered as add-ons # although they can also contain a different base product @@ -153,6 +177,32 @@ product_info end + def run_with_feedback(header, label, &block) + Popup.ShowFeedback(header, label) + yield + ensure + Popup.ClearFeedback + end + + # during installation /etc/zypp directory is not writable (mounted on + # a read-only file system), the workaround is to copy the whole directory + # structure into a writable temporary directory and override the original + # location by "mount -o bind" + def ensure_zypp_config_writable + if Mode.installation && !File.writable?(ZYPP_DIR) + log.info "Copying libzypp config to a writable place" + + # create writable zypp directory structure in /tmp + tmpdir = Dir.mktmpdir + + log.info "Copying #{ZYPP_DIR} to #{tmpdir} ..." + ::FileUtils.cp_r ZYPP_DIR, tmpdir + + log.info "Mounting #{tmpdir} to #{ZYPP_DIR}" + `mount -o bind #{tmpdir} #{ZYPP_DIR}` + end + end + end end continue with "q"... Checked in at Wed Feb 12 17:59:37 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