Class: Y2Packager::SelfUpdateAddonFilter

Inherits:
Object
  • Object
show all
Extended by:
Yast::Logger
Defined in:
src/lib/y2packager/self_update_addon_filter.rb

Overview

filter the packages from a self-update repository which should be used as an add-on instead of applying into the inst-sys

Constant Summary collapse

PROVIDES =
[
  # skelcd-* packages providing installation.xml for base products
  "system-installation()",
  # the *-release packages providing a product
  "product()",
  # used by roles-* packages providing installation.xml for roles
  "installer_module_extension()"
].freeze

Class Method Summary collapse

Class Method Details

.packages(repo_id) ⇒ Array<String>

Returns package name from the selected repository which should be used in an update repository instead of applying to the ins-sys.

Parameters:

  • repo_id (Integer)

    the self-update repository ID

Returns:

  • (Array<String>)

    the list of packages which should be used in an addon repository


47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'src/lib/y2packager/self_update_addon_filter.rb', line 47

def self.packages(repo_id)
  # returns list like [["skelcd-control-SLED", :CAND, :NONE],
  # ["skelcd-control-SLES", :CAND, :NONE],...]
  package_data = PROVIDES.reduce([]) do |memo, p|
    memo.concat(Yast::Pkg.PkgQueryProvides(p))
  end

  pkgs = package_data.map(&:first).uniq

  # there should not be present any other repository except the self update at this point,
  # but rather be safe than sorry...

  pkgs.select! do |pkg|
    props = Yast::Pkg.ResolvableProperties(pkg, :package, "")
    props.any? { |p| p["source"] == repo_id }
  end

  log.info "Found addon packages in the self update repository: #{pkgs}"

  pkgs
end