Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2014-07-23 22:05:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2014-07-15 16:25:55.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2014-07-23 22:05:37.000000000 +0200 @@ -1,0 +2,7 @@ +Tue Jul 22 13:08:32 CEST 2014 - loci...@suse.com + +- Added new ServicesProposal library to hold and export services + enabled/disabled during installation (bnc#887688) +- 3.1.86 + +------------------------------------------------------------------- Old: ---- yast2-3.1.85.tar.bz2 New: ---- yast2-3.1.86.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.X7mMdV/_old 2014-07-23 22:05:39.000000000 +0200 +++ /var/tmp/diff_new_pack.X7mMdV/_new 2014-07-23 22:05:39.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.1.85 +Version: 3.1.86 Release: 0 Url: https://github.com/yast/yast-yast2 ++++++ yast2-3.1.85.tar.bz2 -> yast2-3.1.86.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.85/library/runlevel/src/Makefile.am new/yast2-3.1.86/library/runlevel/src/Makefile.am --- old/yast2-3.1.85/library/runlevel/src/Makefile.am 2014-07-10 15:27:28.000000000 +0200 +++ new/yast2-3.1.86/library/runlevel/src/Makefile.am 2014-07-22 14:42:14.000000000 +0200 @@ -2,6 +2,7 @@ module_DATA = \ modules/Service.rb \ + modules/ServicesProposal.rb \ modules/Systemd.rb scrconf_DATA = \ @@ -12,4 +13,4 @@ EXTRA_DIST = $(module_DATA) $(scrconf_DATA) $(agent_SCRIPTS) -include $(top_srcdir)/Makefile.am.common \ No newline at end of file +include $(top_srcdir)/Makefile.am.common diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.85/library/runlevel/src/modules/ServicesProposal.rb new/yast2-3.1.86/library/runlevel/src/modules/ServicesProposal.rb --- old/yast2-3.1.85/library/runlevel/src/modules/ServicesProposal.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.1.86/library/runlevel/src/modules/ServicesProposal.rb 2014-07-22 14:42:14.000000000 +0200 @@ -0,0 +1,86 @@ +# *************************************************************************** +# +# Copyright (c) 2014 Novell, Inc. +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of version 2 of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, contact Novell, Inc. +# +# To contact Novell about this file by physical or electronic mail, +# you may find current contact information at www.novell.com +# +# *************************************************************************** +### + +# +# Holds information about services that were enabled or disabled during +# installation. At this time it's only used for exporting the configuration +# for AutoYast at the end of the installation. +# + +require "yast" + +module Yast + class ServicesProposalClass < Module + include Yast::Logger + + def initialize + @services = {} + end + + def reset + @services = {} + end + + # Marks the given service as enabled + # + # @param [String] service name + def enable_service(service) + check_service(service) + @services[service] = :enabled + end + + # Marks the given service as disabled + # + # @param [String] service name + def disable_service(service) + check_service(service) + @services[service] = :disabled + end + + # Returns all services currently marked as enabled + # + # @return [Array <String>] list of enabled services + def enabled_services + @services.select{|service, status| status == :enabled}.keys + end + + # Returns all services currently marked as disabled + # + # @return [Array <String>] list of disabled services + def disabled_services + @services.select{|service, status| status == :disabled}.keys + end + + private + + # Checks the given service + # Raises an exception in case of an error + def check_service(service) + if service.nil? || service.empty? + raise ArgumentError, "Wrong service name '#{service.inspect}'" + end + end + end + + ServicesProposal = ServicesProposalClass.new +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.85/library/runlevel/test/Makefile.am new/yast2-3.1.86/library/runlevel/test/Makefile.am --- old/yast2-3.1.85/library/runlevel/test/Makefile.am 2014-07-10 15:27:28.000000000 +0200 +++ new/yast2-3.1.86/library/runlevel/test/Makefile.am 2014-07-22 14:42:14.000000000 +0200 @@ -1,6 +1,6 @@ TESTS = \ - test_helper.rb \ - service_test.rb + service_test.rb \ + services_proposal_test.rb TEST_EXTENSIONS = .rb RB_LOG_COMPILER = rspec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.85/library/runlevel/test/services_proposal_test.rb new/yast2-3.1.86/library/runlevel/test/services_proposal_test.rb --- old/yast2-3.1.85/library/runlevel/test/services_proposal_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-3.1.86/library/runlevel/test/services_proposal_test.rb 2014-07-22 14:42:14.000000000 +0200 @@ -0,0 +1,75 @@ +#!/usr/bin/env rspec + +top_srcdir = File.expand_path("../../../..", __FILE__) +inc_dirs = Dir.glob("#{top_srcdir}/library/*/src") +ENV["Y2DIR"] = inc_dirs.join(":") + +require "yast" + +module Yast + Yast.import 'ServicesProposal' + + describe ServicesProposal do + before(:each) do + ServicesProposal.reset + end + + describe "#enable_service" do + it "marks service as enabled" do + ServicesProposal.enable_service('s1') + expect(ServicesProposal.enabled_services).to eq(['s1']) + + ServicesProposal.enable_service('s2') + expect(ServicesProposal.enabled_services.sort).to eq(['s1', 's2'].sort) + + ServicesProposal.enable_service('s5') + expect(ServicesProposal.enabled_services).to eq(['s1', 's2', 's5'].sort) + end + end + + describe "#disable_service" do + it "marks service as disabled" do + ServicesProposal.disable_service('s7') + expect(ServicesProposal.disabled_services).to eq(['s7']) + + ServicesProposal.disable_service('s8') + expect(ServicesProposal.disabled_services.sort).to eq(['s7', 's8'].sort) + + ServicesProposal.disable_service('s9') + expect(ServicesProposal.disabled_services.sort).to eq(['s7', 's8', 's9'].sort) + end + end + + describe "#enabled_services" do + it "returns all services marked as enabled" do + disable_services = ['1', 'd', 'e', 'f'] + disable_services.each do |service| + ServicesProposal.disable_service(service) + end + + enable_services = ['1', 'a', 'b', 'c'] + enable_services.each do |service| + ServicesProposal.enable_service(service) + end + + expect(ServicesProposal.enabled_services.sort).to eq(enable_services.sort) + end + end + + describe "#disabled_services" do + it "returns all services marked as disabled" do + enable_services = ['1', 'a', 'b', 'c'] + enable_services.each do |service| + ServicesProposal.enable_service(service) + end + + disable_services = ['1', 'd', 'e', 'f'] + disable_services.each do |service| + ServicesProposal.disable_service(service) + end + + expect(ServicesProposal.disabled_services.sort).to eq(disable_services.sort) + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.85/package/yast2.changes new/yast2-3.1.86/package/yast2.changes --- old/yast2-3.1.85/package/yast2.changes 2014-07-10 15:27:28.000000000 +0200 +++ new/yast2-3.1.86/package/yast2.changes 2014-07-22 14:42:14.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Jul 22 13:08:32 CEST 2014 - loci...@suse.com + +- Added new ServicesProposal library to hold and export services + enabled/disabled during installation (bnc#887688) +- 3.1.86 + +------------------------------------------------------------------- Thu Jul 10 12:56:20 UTC 2014 - lsle...@suse.cz - Product.rb: do not stop initialization on solver errors diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.85/package/yast2.spec new/yast2-3.1.86/package/yast2.spec --- old/yast2-3.1.85/package/yast2.spec 2014-07-10 15:27:28.000000000 +0200 +++ new/yast2-3.1.86/package/yast2.spec 2014-07-22 14:42:14.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.1.85 +Version: 3.1.86 Release: 0 URL: https://github.com/yast/yast-yast2 -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org