Hello community, here is the log from the commit of package yast2-product-creator for openSUSE:Factory checked in at 2017-03-29 13:25:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-product-creator (Old) and /work/SRC/openSUSE:Factory/.yast2-product-creator.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-product-creator" Wed Mar 29 13:25:03 2017 rev:117 rq:483257 version:3.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-product-creator/yast2-product-creator.changes 2016-06-07 23:48:41.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-product-creator.new/yast2-product-creator.changes 2017-03-29 13:25:04.580168166 +0200 @@ -1,0 +2,14 @@ +Wed Mar 29 07:09:03 UTC 2017 - mfilka@suse.com + +- bnc#1026027 + - removed calls to insserv +- 3.2.0 + +------------------------------------------------------------------- +Fri Mar 17 12:07:40 UTC 2017 - igonzalezsosa@suse.com + +- Fix patterns list initialization (bsc#1028661) +- Fix 'Next' button behaviour in pattern selection +- 3.1.9 + +------------------------------------------------------------------- Old: ---- yast2-product-creator-3.1.8.tar.bz2 New: ---- yast2-product-creator-3.2.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-product-creator.spec ++++++ --- /var/tmp/diff_new_pack.EU5L7B/_old 2017-03-29 13:25:05.847988862 +0200 +++ /var/tmp/diff_new_pack.EU5L7B/_new 2017-03-29 13:25:05.851988296 +0200 @@ -1,7 +1,7 @@ # # spec file for package yast2-product-creator # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: yast2-product-creator -Version: 3.1.8 +Version: 3.2.0 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-product-creator-3.1.8.tar.bz2 -> yast2-product-creator-3.2.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-3.1.8/.travis.yml new/yast2-product-creator-3.2.0/.travis.yml --- old/yast2-product-creator-3.1.8/.travis.yml 2016-06-06 09:50:48.707267516 +0200 +++ new/yast2-product-creator-3.2.0/.travis.yml 2017-03-29 10:29:07.182185430 +0200 @@ -1,16 +1,11 @@ -language: cpp -compiler: - - gcc +sudo: required +language: bash +services: + - docker + before_install: - # disable rvm, use system Ruby - - rvm reset - - wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/tra... - - sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2" -g "yast-rake gettext" + - docker build -t yast-product-creator-image . script: - - rake check:syntax - - rake check:pot - - make -f Makefile.cvs - - make - - sudo make install - - make check - + # the "yast-travis-ruby" script is included in the base yastdevel/ruby image + # see https://github.com/yast/docker-yast-ruby/blob/master/yast-travis-ruby + - docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" yast-product-creator-image yast-travis-ruby diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-3.1.8/CONTRIBUTING.md new/yast2-product-creator-3.2.0/CONTRIBUTING.md --- old/yast2-product-creator-3.1.8/CONTRIBUTING.md 2016-06-06 09:50:48.715267516 +0200 +++ new/yast2-product-creator-3.2.0/CONTRIBUTING.md 2017-03-29 10:29:07.190185430 +0200 @@ -3,7 +3,7 @@ YaST is an open source project and as such it welcomes all kinds of contributions. If you decide to contribute, please follow these guidelines to -ensure the process is effective and pleasant both for you and YaST maintainers. +ensure the process is effective and pleasant both for you and the YaST maintainers. There are two main forms of contribution: reporting bugs and performing code changes. @@ -17,13 +17,11 @@ registration](https://secure-www.novell.com/selfreg/jsp/createSimpleAccount.jsp) if you don't have an account yet.) -If you find a problem, please report it either using -[Bugzilla](https://bugzilla.suse.com/) or GitHub issues. We can't guarantee -that every bug will be fixed, but we'll try. - When creating a bug report, please follow our [bug reporting guidelines](http://en.opensuse.org/openSUSE:Report_a_YaST_bug). +We can't guarantee that every bug will be fixed, but we'll try. + Code Changes ------------ @@ -44,15 +42,22 @@ to the [Ruby style guide](https://github.com/SUSE/style-guides/blob/master/Ruby.md). - 4. Make sure your change didn't break anything by building the RPM package + 4. Update the package version (in `packages/*.spec`, usually by + `rake version:bump`) and add a new entry to the `package/*.changes` file + (by `osc vc package`). + For bigger changes or changes which need longer discussion it is advised to + add this as a separate last commit so it can be easily updated when another + change is merged in the meantime. + + 5. Make sure your change didn't break anything by building the RPM package (`rake osc:build`). The build process includes running the full testsuite. - 5. Publish the branch and create a pull request. + 6. Publish the branch and create a pull request. - 6. YaST developers will review your change and possibly point out issues. + 7. YaST developers will review your change and possibly point out issues. Adapt the code under their guidance until they are all resolved. - 7. Finally, the pull request will get merged or rejected. + 8. Finally, the pull request will get merged or rejected. See also [GitHub's guide on contributing](https://help.github.com/articles/fork-a-repo). @@ -60,9 +65,6 @@ If you want to do multiple unrelated changes, use separate branches and pull requests. -Do not change the `VERSION` and `*.changes` files as this could lead to -conflicts. - ### Commits Each commit in the pull request should do only one thing, which is clearly diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-3.1.8/Dockerfile new/yast2-product-creator-3.2.0/Dockerfile --- old/yast2-product-creator-3.1.8/Dockerfile 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-product-creator-3.2.0/Dockerfile 2017-03-29 10:29:07.202185430 +0200 @@ -0,0 +1,5 @@ +FROM yastdevel/ruby +RUN zypper --gpg-auto-import-keys --non-interactive in --no-recommends \ + yast2-add-on-creator +COPY . /usr/src/app + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-3.1.8/data/kiwi_templates/iso/config.sh new/yast2-product-creator-3.2.0/data/kiwi_templates/iso/config.sh --- old/yast2-product-creator-3.1.8/data/kiwi_templates/iso/config.sh 2016-06-06 09:50:48.779267516 +0200 +++ new/yast2-product-creator-3.2.0/data/kiwi_templates/iso/config.sh 2017-03-29 10:29:07.250185430 +0200 @@ -51,8 +51,6 @@ patch -p0 < /tmp/config.patch rm /tmp/config.patch -insserv - rm -rf /var/cache/zypp/raw/* zypper addrepo -d http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/ factory-oss diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-3.1.8/package/yast2-product-creator.changes new/yast2-product-creator-3.2.0/package/yast2-product-creator.changes --- old/yast2-product-creator-3.1.8/package/yast2-product-creator.changes 2016-06-06 09:50:48.791267516 +0200 +++ new/yast2-product-creator-3.2.0/package/yast2-product-creator.changes 2017-03-29 10:29:07.258185430 +0200 @@ -1,4 +1,18 @@ ------------------------------------------------------------------- +Wed Mar 29 07:09:03 UTC 2017 - mfilka@suse.com + +- bnc#1026027 + - removed calls to insserv +- 3.2.0 + +------------------------------------------------------------------- +Fri Mar 17 12:07:40 UTC 2017 - igonzalezsosa@suse.com + +- Fix patterns list initialization (bsc#1028661) +- Fix 'Next' button behaviour in pattern selection +- 3.1.9 + +------------------------------------------------------------------- Mon Jun 6 07:25:59 UTC 2016 - igonzalezsosa@suse.com - Stop generating autodocs (fate#320356) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-3.1.8/package/yast2-product-creator.spec new/yast2-product-creator-3.2.0/package/yast2-product-creator.spec --- old/yast2-product-creator-3.1.8/package/yast2-product-creator.spec 2016-06-06 09:50:48.791267516 +0200 +++ new/yast2-product-creator-3.2.0/package/yast2-product-creator.spec 2017-03-29 10:29:07.258185430 +0200 @@ -17,7 +17,7 @@ Name: yast2-product-creator -Version: 3.1.8 +Version: 3.2.0 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-3.1.8/src/include/product-creator/dialogs.rb new/yast2-product-creator-3.2.0/src/include/product-creator/dialogs.rb --- old/yast2-product-creator-3.1.8/src/include/product-creator/dialogs.rb 2016-06-06 09:50:48.807267516 +0200 +++ new/yast2-product-creator-3.2.0/src/include/product-creator/dialogs.rb 2017-03-29 10:29:07.278185430 +0200 @@ -794,13 +794,14 @@ false end - # Dialog for selecting the sources # @return [Symbol] def sourceDialog # dialog caption caption = _("Source Selection") + ProductCreator.restore_repos_state + SourceManager.ReadSources sources = fillSourceTable([], true, "") Builtins.y2debug("sources: %1", sources) @@ -1028,6 +1029,8 @@ # finish the target Pkg.TargetFinish + else + ProductCreator.enable_needed_repos(selected_items) end @going_back = false @@ -1464,7 +1467,7 @@ result = nil end end - end until result == :cancel || result == :accept + end until result == :cancel || result == :accept || result == :next result = :next if result == :accept diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-3.1.8/src/modules/ProductCreator.rb new/yast2-product-creator-3.2.0/src/modules/ProductCreator.rb --- old/yast2-product-creator-3.1.8/src/modules/ProductCreator.rb 2016-05-03 15:44:02.006151399 +0200 +++ new/yast2-product-creator-3.2.0/src/modules/ProductCreator.rb 2017-03-29 10:29:07.282185430 +0200 @@ -32,6 +32,11 @@ module Yast class ProductCreatorClass < Module + include Yast::Logger + + # @return [Array<Integer>] Temporarily enabled repositories + attr_accessor :tmp_enabled + def main Yast.import "UI" Yast.import "Pkg" @@ -126,6 +131,10 @@ # map additional products to "Addon" directory @product_map = {} + + # temporarily enabled repositories + @tmp_enabled = [] + ProductCreator() end @@ -3729,6 +3738,40 @@ true end + # Enable needed repositories + # + # The idea is to make patterns/packages available during selection + # (bsc#1028661). The list of enabled repositories is stored at + # ProductCreator.Config. + # + # @param selected [Array<Integer>] Selected sources + # @see restore_repos_state + def enable_needed_repos(selected) + self.tmp_enabled = selected.each_with_object([]) do |src, list| + general_info = Pkg.SourceGeneralData(src) + list << src unless general_info["enabled"] + end + + tmp_enabled.each do |src| + log.info "Enabling and refreshing repository #{src}" + Pkg.SourceSetEnabled(src, true) + Pkg.SourceRefreshNow(src) + end + end + + # Restore repositories state + # + # Undo changes introduced by #enabled_needed_repos. + # + # @see enable_needed_repos + def restore_repos_state + tmp_enabled.each do |src| + log.info "Disabling repository #{src}" + Pkg.SourceSetEnabled(src, false) + end + tmp_enabled.clear + end + # Constructor def ProductCreator configSetup diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-3.1.8/test/product_creator_test.rb new/yast2-product-creator-3.2.0/test/product_creator_test.rb --- old/yast2-product-creator-3.1.8/test/product_creator_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-product-creator-3.2.0/test/product_creator_test.rb 2017-03-29 10:29:07.282185430 +0200 @@ -0,0 +1,64 @@ +#!/usr/bin/env rspec + +require_relative "test_helper" + +Yast.import "Pkg" +Yast.import "ProductCreator" +Yast.import "AddOnCreator" + +describe Yast::ProductCreator do + subject { Yast::ProductCreator } + + before { Yast::ProductCreator.main } + + describe "#enable_needed_repos" do + REPOS = { + 1 => { "id" => 1, "enabled" => true }, + 2 => { "id" => 2, "enabled" => false } + } + + before do + allow(Yast::Pkg).to receive(:SourceGeneralData) { |i| REPOS[i] } + end + + it "enables disabled repositories" do + expect(Yast::Pkg).to receive(:SourceSetEnabled).with(2, true) + expect(Yast::Pkg).to receive(:SourceRefreshNow).with(2) + expect(Yast::Pkg).to_not receive(:SourceRefreshNow).with(1) + subject.enable_needed_repos([1, 2]) + end + + it "register repositories to restore their state later" do + subject.enable_needed_repos([1, 2]) + expect(subject.tmp_enabled).to eq([2]) + end + end + + describe "#restore_repos_state" do + before do + allow(Yast::Pkg).to receive(:SourceGeneralData).and_return("id" => 1, "enabled" => false) + allow(Yast::Pkg).to receive(:SourceSetEnabled) + allow(Yast::Pkg).to receive(:SourceRefreshNow) + end + + context "when some repositories were enabled" do + let(:source) { 1 } + + before do + subject.enable_needed_repos([source]) + end + + it "it disables previously enabled repositories" do + expect(Yast::Pkg).to receive(:SourceSetEnabled).with(source, false) + subject.restore_repos_state + end + end + + context "when no repositories were enabled" do + it "does not disable any repository" do + expect(Yast::Pkg).to_not receive(:SourceSetEnabled) + subject.restore_repos_state + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-product-creator-3.1.8/test/test_helper.rb new/yast2-product-creator-3.2.0/test/test_helper.rb --- old/yast2-product-creator-3.1.8/test/test_helper.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-product-creator-3.2.0/test/test_helper.rb 2017-03-29 10:29:07.282185430 +0200 @@ -0,0 +1,59 @@ +# Copyright (c) 2017 SUSE LLC. +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of version 2 or 3 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 SUSE LLC. +# +# To contact SUSE about this file by physical or electronic mail, +# you may find current contact information at www.suse.com +# +# Set the paths +src_path = File.expand_path("../../src", __FILE__) +ENV["Y2DIR"] = src_path + +require "yast" +require "yast/rspec" +require "pathname" + +if ENV["COVERAGE"] + require "simplecov" + SimpleCov.start do + add_filter "/test/" + end + + # Files to track for code coverage + SimpleCov.track_files("#{src_path}/**/*.rb") + + # use coveralls for on-line code coverage reporting at Travis CI + if ENV["TRAVIS"] + require "coveralls" + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter + ] + end +end + +# configure RSpec +RSpec.configure do |config| + config.mock_with :rspec do |c| + # https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/verifying-doubles/partial... + c.verify_partial_doubles = true + + config.extend Yast::I18n # available in context/describe + config.include Yast::I18n # available in it/let/before/... + end +end + +TESTS_PATH = Pathname.new(File.dirname(__FILE__)) +FIXTURES_PATH = TESTS_PATH.join("fixtures")