Hello community,
here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2016-05-19 12:04:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old)
and /work/SRC/openSUSE:Factory/.yast2-packager.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-packager"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2016-04-28 20:30:38.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2016-05-19 12:04:28.000000000 +0200
@@ -1,0 +2,21 @@
+Thu May 12 11:24:25 UTC 2016 - lslezak@suse.cz
+
+- Select the new default product patterns also when adding an
+ add-on from media in installed system (FATE#320199)
+- 3.1.100
+
+-------------------------------------------------------------------
+Wed May 11 15:49:26 CEST 2016 - schubi@suse.de
+
+- Showing location of installed licenses.
+ (fate#219341)
+- 3.1.99
+
+-------------------------------------------------------------------
+Tue May 10 12:31:13 UTC 2016 - igonzalezsosa@suse.com
+
+- Local repositories are disabled at the end of the installation
+ if there is an online replacement available (FATE#320494)
+- 3.1.98
+
+-------------------------------------------------------------------
Old:
----
yast2-packager-3.1.97.tar.bz2
New:
----
yast2-packager-3.1.100.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.cxu8Xh/_old 2016-05-19 12:04:29.000000000 +0200
+++ /var/tmp/diff_new_pack.cxu8Xh/_new 2016-05-19 12:04:29.000000000 +0200
@@ -17,7 +17,7 @@
Name: yast2-packager
-Version: 3.1.97
+Version: 3.1.100
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -33,8 +33,8 @@
BuildRequires: yast2_theme
BuildRequires: rubygem(rspec)
-# PackagesUI.show_update_messages; uptime call
-BuildRequires: yast2 >= 3.1.182
+# Packages::Repository and Packages::Product classes
+BuildRequires: yast2 >= 3.1.187
# Pkg::SourceRawURL() and Pkg:ExpandedUrl()
BuildRequires: yast2-pkg-bindings >= 3.1.30
@@ -45,8 +45,8 @@
# Pkg::SourceRawURL() and Pkg:ExpandedUrl()
Requires: yast2-pkg-bindings >= 3.1.30
-# Fixed .proc.cmdline agent; uptime call
-Requires: yast2 >= 3.1.182
+# Packages::Repository and Packages::Product classes
+Requires: yast2 >= 3.1.187
# unzipping license file
Requires: unzip
++++++ yast2-packager-3.1.97.tar.bz2 -> yast2-packager-3.1.100.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.97/package/yast2-packager.changes new/yast2-packager-3.1.100/package/yast2-packager.changes
--- old/yast2-packager-3.1.97/package/yast2-packager.changes 2016-04-25 11:47:26.000000000 +0200
+++ new/yast2-packager-3.1.100/package/yast2-packager.changes 2016-05-17 09:02:08.000000000 +0200
@@ -1,4 +1,25 @@
-------------------------------------------------------------------
+Thu May 12 11:24:25 UTC 2016 - lslezak@suse.cz
+
+- Select the new default product patterns also when adding an
+ add-on from media in installed system (FATE#320199)
+- 3.1.100
+
+-------------------------------------------------------------------
+Wed May 11 15:49:26 CEST 2016 - schubi@suse.de
+
+- Showing location of installed licenses.
+ (fate#219341)
+- 3.1.99
+
+-------------------------------------------------------------------
+Tue May 10 12:31:13 UTC 2016 - igonzalezsosa@suse.com
+
+- Local repositories are disabled at the end of the installation
+ if there is an online replacement available (FATE#320494)
+- 3.1.98
+
+-------------------------------------------------------------------
Fri Apr 22 16:23:17 UTC 2016 - lslezak@suse.cz
- Move the default pattern selection to a different place to not
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.97/package/yast2-packager.spec new/yast2-packager-3.1.100/package/yast2-packager.spec
--- old/yast2-packager-3.1.97/package/yast2-packager.spec 2016-04-25 11:47:26.000000000 +0200
+++ new/yast2-packager-3.1.100/package/yast2-packager.spec 2016-05-17 09:02:08.000000000 +0200
@@ -17,7 +17,7 @@
Name: yast2-packager
-Version: 3.1.97
+Version: 3.1.100
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -32,8 +32,8 @@
BuildRequires: yast2_theme
BuildRequires: rubygem(rspec)
-# PackagesUI.show_update_messages; uptime call
-BuildRequires: yast2 >= 3.1.182
+# Packages::Repository and Packages::Product classes
+BuildRequires: yast2 >= 3.1.187
# Pkg::SourceRawURL() and Pkg:ExpandedUrl()
BuildRequires: yast2-pkg-bindings >= 3.1.30
@@ -44,8 +44,8 @@
# Pkg::SourceRawURL() and Pkg:ExpandedUrl()
Requires: yast2-pkg-bindings >= 3.1.30
-# Fixed .proc.cmdline agent; uptime call
-Requires: yast2 >= 3.1.182
+# Packages::Repository and Packages::Product classes
+Requires: yast2 >= 3.1.187
# unzipping license file
Requires: unzip
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.97/src/Makefile.am new/yast2-packager-3.1.100/src/Makefile.am
--- old/yast2-packager-3.1.97/src/Makefile.am 2016-04-25 11:47:26.000000000 +0200
+++ new/yast2-packager-3.1.100/src/Makefile.am 2016-05-17 09:02:08.000000000 +0200
@@ -70,6 +70,10 @@
desktop/sw_single.desktop \
desktop/checkmedia.desktop
-EXTRA_DIST = $(module_DATA) $(client_DATA) $(ynclude_DATA) $(ynclude1_DATA) $(scrconf_DATA) $(agent_SCRIPTS) $(desktop_DATA)
+ylibclientdir = "${yast2dir}/lib/packager/clients"
+ylibclient_DATA = \
+ lib/packager/clients/pkg_finish.rb
+
+EXTRA_DIST = $(module_DATA) $(client_DATA) $(ynclude_DATA) $(ynclude1_DATA) $(scrconf_DATA) $(agent_SCRIPTS) $(desktop_DATA) $(ylibclient_DATA) $(ylib_DATA)
include $(top_srcdir)/Makefile.am.common
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.97/src/clients/pkg_finish.rb new/yast2-packager-3.1.100/src/clients/pkg_finish.rb
--- old/yast2-packager-3.1.97/src/clients/pkg_finish.rb 2016-04-25 11:47:26.000000000 +0200
+++ new/yast2-packager-3.1.100/src/clients/pkg_finish.rb 2016-05-17 09:02:08.000000000 +0200
@@ -11,187 +11,5 @@
#
# $Id$
#
-module Yast
- class PkgFinishClient < Client
- def main
- Yast.import "Pkg"
-
- textdomain "packager"
-
- Yast.import "Installation"
- Yast.import "Mode"
- Yast.import "Stage"
- Yast.import "String"
- Yast.import "FileUtils"
- Yast.import "Packages"
-
- @ret = nil
- @func = ""
- @param = {}
-
- # Check arguments
- if Ops.greater_than(Builtins.size(WFM.Args), 0) &&
- Ops.is_string?(WFM.Args(0))
- @func = Convert.to_string(WFM.Args(0))
- if Ops.greater_than(Builtins.size(WFM.Args), 1) &&
- Ops.is_map?(WFM.Args(1))
- @param = Convert.to_map(WFM.Args(1))
- end
- end
-
- Builtins.y2milestone("starting pkg_finish")
- Builtins.y2debug("func=%1", @func)
- Builtins.y2debug("param=%1", @param)
-
- if @func == "Info"
- return {
- "steps" => 1,
- # progress step title
- "title" => _(
- "Saving the software manager configuration..."
- ),
- "when" => [:installation, :update, :autoinst]
- }
- elsif @func == "Write"
- # File "/openSUSE-release.prod" is no more on the media
- # but directly in the RPM. Don't create the directory
- # and don't copy the file manually anymore.
- #
- # (since evrsion 2.17.5)
- #
- # // Copy information about product (bnc#385868)
- # // FIXME: this is a temporary hack containing a hardcoded file name
- # string media_prod = Pkg::SourceProvideOptionalFile (
- # Packages::theSources[0]:0, 1,
- # "/openSUSE-release.prod");
- # if (media_prod != nil)
- # {
- # WFM::Execute (.local.bash, sformat ("test -d %1%2 || mkdir %1%2",
- # Installation::destdir, "/etc/zypp/products.d"));
- # WFM::Execute (.local.bash, sformat ("test -d %3%2 && /bin/cp %1 %3%2",
- # media_prod, "/etc/zypp/products.d", Installation::destdir));
- # }
-
- # Remove (backup) all sources not used during the update
- # BNC #556469: Backup and remove all the old repositories before any Pkg::SourceSaveAll call
- BackUpAllTargetSources() if Stage.initial && Mode.update
-
- # See bnc #384827, #381360
- if Mode.update
- Builtins.y2milestone("Adding default repositories")
- WFM.call("inst_extrasources")
- end
-
-
- # save all repositories and finish target
- Pkg.SourceSaveAll
- Pkg.TargetFinish
-
- # save repository metadata cache to the installed system
- # (needs to be done _after_ saving repositories, see bnc#700881)
- Pkg.SourceCacheCopyTo(Installation.destdir)
-
- # copy list of failed packages to installed system
- WFM.Execute(
- path(".local.bash"),
- Builtins.sformat(
- "test -f %1 && /bin/cp -a %1 '%2%1'",
- "/var/lib/YaST2/failed_packages",
- String.Quote(Installation.destdir)
- )
- )
- else
- Builtins.y2error("unknown function: %1", @func)
- @ret = nil
- end
-
- Builtins.y2debug("ret=%1", @ret)
- Builtins.y2milestone("pkg_finish finished")
- deep_copy(@ret)
- end
-
- # During upgrade, old sources are reinitialized
- # either as enabled or disabled.
- # The old sources from targed should go away.
- def BackUpAllTargetSources
- Yast.import "Directory"
-
- repos_dir = "/etc/zypp/repos.d"
-
- if !FileUtils.Exists(repos_dir)
- Builtins.y2error("Directory %1 doesn't exist!", repos_dir)
- return
- end
-
- current_repos = Convert.convert(
- SCR.Read(path(".target.dir"), repos_dir),
- :from => "any",
- :to => "list <string>"
- )
-
- if current_repos == nil || Builtins.size(current_repos) == 0
- Builtins.y2warning(
- "There are currently no repos in %1 conf dir",
- repos_dir
- )
- return
- else
- Builtins.y2milestone(
- "These repos currently exist on a target: %1",
- current_repos
- )
- end
-
- cmd = Convert.to_map(
- WFM.Execute(path(".local.bash_output"), "date +%Y%m%d-%H%M%S")
- )
- a_name_list = Builtins.splitstring(
- Ops.get_string(cmd, "stdout", "the_latest"),
- "\n"
- )
- archive_name = Ops.add(
- Ops.add("repos_", Ops.get(a_name_list, 0, "")),
- ".tgz"
- )
-
- shellcommand = Builtins.sformat(
- "mkdir -p '%1' && cd '%1' && /bin/tar -czf '%2' '%3'",
- String.Quote(Ops.add(Directory.vardir, "/repos.d_backup/")),
- String.Quote(archive_name),
- String.Quote(repos_dir)
- )
- cmd = Convert.to_map(
- SCR.Execute(path(".target.bash_output"), shellcommand)
- )
-
- if Ops.get_integer(cmd, "exit", -1) != 0
- Builtins.y2error(
- "Unable to backup current repos; Command >%1< returned: %2",
- shellcommand,
- cmd
- )
- end
-
- success = nil
-
- Builtins.foreach(current_repos) do |one_repo|
- one_repo = Ops.add(Ops.add(repos_dir, "/"), one_repo)
- Builtins.y2milestone("Removing target repository %1", one_repo)
- success = Convert.to_boolean(
- SCR.Execute(path(".target.remove"), one_repo)
- )
- Builtins.y2error("Cannot remove %1 file", one_repo) if success != true
- end
-
- Builtins.y2milestone("All old repositories were removed from the target")
-
- # reload the target to sync the removed repositories with libzypp repomanager
- Pkg.TargetFinish
- Pkg.TargetInitialize("/mnt")
-
- nil
- end
- end
-end
-
-Yast::PkgFinishClient.new.main
+require "packager/clients/pkg_finish"
+Yast::PkgFinishClient.new.run
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.97/src/lib/packager/clients/pkg_finish.rb new/yast2-packager-3.1.100/src/lib/packager/clients/pkg_finish.rb
--- old/yast2-packager-3.1.97/src/lib/packager/clients/pkg_finish.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-packager-3.1.100/src/lib/packager/clients/pkg_finish.rb 2016-05-17 09:02:08.000000000 +0200
@@ -0,0 +1,198 @@
+# encoding: utf-8
+
+# ------------------------------------------------------------------------------
+# Copyright (c) 2016 SUSE LLC
+#
+# 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.
+#
+# ------------------------------------------------------------------------------
+
+require "installation/finish_client"
+require "packages/repository"
+
+module Yast
+ class PkgFinishClient < ::Installation::FinishClient
+ include Yast::I18n
+ include Yast::Logger
+
+ # Path to libzypp repositories
+ REPOS_DIR = "/etc/zypp/repos.d"
+ # Path to failed_packages file
+ FAILED_PKGS_PATH = "/var/lib/YaST2/failed_packages"
+ # Command to create a tar.gz to back-up old repositories
+ TAR_CMD = "mkdir -p '%<target>s' && cd '%<target>s' "\
+ "&& /bin/tar -czf '%<archive>s' '%<source>s'"
+ # Format of the timestamp to be used as repositories backup
+ BACKUP_TIMESTAMP_FORMAT = "%Y%m%d-%H%M%S"
+
+ # Constructor
+ def initialize
+ textdomain "packager"
+
+ Yast.import "Pkg"
+ Yast.import "Installation"
+ Yast.import "Mode"
+ Yast.import "Stage"
+ Yast.import "String"
+ Yast.import "FileUtils"
+ Yast.import "Packages"
+ Yast.import "Directory"
+ end
+
+ # @see Implements ::Installation::FinishClient#modes
+ def modes
+ [:installation, :update, :autoinst]
+ end
+
+ # @see Implements ::Installation::FinishClient#title
+ def title
+ _("Saving the software manager configuration...")
+ end
+
+ # @see Implements ::Installation::FinishClient#write
+ def write
+ # Remove (backup) all sources not used during the update
+ # BNC #556469: Backup and remove all the old repositories before any Pkg::SourceSaveAll call
+ backup_all_target_sources if Stage.initial && Mode.update
+
+ # See bnc #384827, #381360
+ if Mode.update
+ log.info("Adding default repositories")
+ WFM.call("inst_extrasources")
+ end
+
+ # If repositories weren't load during installation (for example, in openSUSE
+ # if online repositories were not enabled), resolvables should be loaded now.
+ Pkg.SourceLoad
+ disable_local_repos
+
+ # save all repositories and finish target
+ Pkg.SourceSaveAll
+ Pkg.TargetFinish
+
+ # save repository metadata cache to the installed system
+ # (needs to be done _after_ saving repositories, see bnc#700881)
+ Pkg.SourceCacheCopyTo(Installation.destdir)
+
+ # copy list of failed packages to installed system
+ if File.exist?(FAILED_PKGS_PATH)
+ ::FileUtils.cp(FAILED_PKGS_PATH, File.join(Installation.destdir, FAILED_PKGS_PATH),
+ preserve: true)
+ end
+ end
+
+ private
+
+ # Backup old sources
+ #
+ # During upgrade, old sources are reinitialized
+ # either as enabled or disabled.
+ # The old sources from target should go away.
+ def backup_all_target_sources
+ if !File.exist?(REPOS_DIR)
+ log.error("Directory #{REPOS_DIR} doesn't exist!")
+ return
+ end
+
+ current_repos = SCR.Read(path(".target.dir"), REPOS_DIR)
+
+ if current_repos.nil? || current_repos.empty?
+ log.warn("There are currently no repos in #{REPOS_DIR} conf dir")
+ return
+ else
+ log.info("These repos currently exist on a target: #{current_repos}")
+ end
+
+ # Backup repos.d
+ repos_backup_dir = File.join(Directory.vardir, "repos.d_backup")
+ backup_old_sources(REPOS_DIR, repos_backup_dir).nil?
+
+ # Clean old repositories
+ remove_old_sources(current_repos)
+
+ # Sync sources
+ sync_target_sources
+
+ nil
+ end
+
+ # Disable given repositories if needed
+ #
+ # Given a local repository:
+ #
+ # * if all products it contains are available through another repository,
+ # then it will be disabled;
+ # * if some product contained is not available through another
+ # repository, then it will be left untouched.
+ #
+ # @return [ArrayPackages::Repository] List of disabled repositories
+ def disable_local_repos
+ candidates_repos, other_repos = *::Packages::Repository.enabled.partition(&:local?)
+ products = other_repos.map(&:products).flatten.uniq
+ candidates_repos.each_with_object([]) do |repo, disabled|
+ if repo.products.empty?
+ log.info("Repo #{repo.repo_id} (#{repo.name}) does not have products; ignored")
+ next
+ end
+ uncovered = repo.products.reject { |p| products.include?(p) }
+ if uncovered.empty?
+ log.info("Repo #{repo.repo_id} (#{repo.name}) will be disabled because products " \
+ "are present in other repositories")
+ repo.disable!
+ disabled << repo
+ else
+ log.info("Repo #{repo.repo_id} (#{repo.name}) cannot be disabled because these " \
+ "products are not available through other repos: #{uncovered.map(&:name)}")
+ end
+ end
+ end
+
+ # Backup sources
+ #
+ # @param source [String] Path of sources to backup
+ # @param target [String] Directory to store backup
+ # @return [String,nil] Name of the backup archive (locate in the given target directory);
+ # nil if the backup failed
+ def backup_old_sources(source, target)
+ archive_name = "repos_#{Time.now.strftime(BACKUP_TIMESTAMP_FORMAT)}.tgz"
+ compress_cmd = format(TAR_CMD,
+ target: String.Quote(target),
+ archive: archive_name,
+ source: String.Quote(source))
+ cmd = SCR.Execute(path(".target.bash_output"), compress_cmd)
+ if !cmd["exit"].zero?
+ log.error("Unable to backup current repos; Command >#{compress_cmd}< returned: #{cmd}")
+ nil
+ else
+ archive_name
+ end
+ end
+
+ # Remove old sources
+ #
+ # @param [Array<String>] List of repositories to remove
+ def remove_old_sources(repos)
+ repos.each do |repo|
+ file = File.join(REPOS_DIR, repo)
+ log.info("Removing target repository #{file}")
+ if !SCR.Execute(path(".target.remove"), file)
+ log.error("Cannot remove #{repo} file")
+ end
+ end
+ log.info("All old repositories were removed from the target")
+ end
+
+ # Reload the target to sync the removed repositories with libzypp
+ # repomanager
+ def sync_target_sources
+ Pkg.TargetFinish
+ Pkg.TargetInitialize(Installation.destdir)
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.97/src/lib/packager/product_patterns.rb new/yast2-packager-3.1.100/src/lib/packager/product_patterns.rb
--- old/yast2-packager-3.1.97/src/lib/packager/product_patterns.rb 2016-04-25 11:47:26.000000000 +0200
+++ new/yast2-packager-3.1.100/src/lib/packager/product_patterns.rb 2016-05-17 09:02:08.000000000 +0200
@@ -20,8 +20,14 @@
class ProductPatterns
include Yast::Logger
- def initialize
+ attr_reader :src
+
+ # optionally evaluate only the products in the specified repository
+ # (by default use all repositories)
+ # @param [Integer,nil] src repository id
+ def initialize(src: nil)
Yast.import "Pkg"
+ @src = src
end
# Find the default patterns for all selected products.
@@ -78,6 +84,7 @@
resolvables = Yast::Pkg.ResolvableProperties(product, :product, "")
remove_unselected(resolvables)
+ remove_other_repos(resolvables) if src
resolvables.each do |resolvable|
prod_pkg = resolvable["product_package"]
@@ -96,6 +103,7 @@
product_dependencies
end
+
# Remove not selected resolvables from the list
# @param [Array<Hash>] resolvables only the Hashes where the key "status"
# maps to :selected value are kept, the rest is removed
@@ -103,6 +111,13 @@
resolvables.select! { |p| p["status"] == :selected }
end
+ # Remove the resolvables from other repositories than in 'src'
+ # @param [Array<Hash>] resolvables only the Hashes where the key "status"
+ # is equal to `src` are kept, the rest is removed
+ def remove_other_repos(resolvables)
+ resolvables.select! { |p| p["source"] == src }
+ end
+
# Collect "provides" dependencies from the list.
# @param [Array<Hash>] dependencies all dependencies
# @return [Array<String>] only the "provides" dependencies
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.97/src/modules/AddOnProduct.rb new/yast2-packager-3.1.100/src/modules/AddOnProduct.rb
--- old/yast2-packager-3.1.97/src/modules/AddOnProduct.rb 2016-04-25 11:47:26.000000000 +0200
+++ new/yast2-packager-3.1.100/src/modules/AddOnProduct.rb 2016-05-17 09:02:08.000000000 +0200
@@ -14,6 +14,8 @@
# Lukas Ocilka