Skip to content

Commit

Permalink
Merge 7dc8f84 into 1588331
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Dec 31, 2019
2 parents 1588331 + 7dc8f84 commit 884e567
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 31 deletions.
7 changes: 7 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Dec 31 11:43:56 UTC 2019 - Josef Reidinger <jreidinger@suse.com>

- Fix cloning patterns (regression from 4.2.22)
(bsc#1159269, bsc#1159472)
- 4.2.26

-------------------------------------------------------------------
Tue Dec 17 16:19:57 UTC 2019 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -22,7 +22,7 @@
%endif

Name: autoyast2
Version: 4.2.25
Version: 4.2.26
Release: 0
Summary: YaST2 - Automated Installation
License: GPL-2.0-only
Expand Down
60 changes: 30 additions & 30 deletions src/modules/AutoinstSoftware.rb
Expand Up @@ -1025,20 +1025,22 @@ def ReadHelper
Pkg.SourceStartManager(true)
Pkg.PkgSolve(false)

@all_xpatterns = Y2Packager::Resolvable.find(kind: :pattern)
@all_xpatterns = Y2Packager::Resolvable.find(
{ kind: :pattern, status: :installed },
[:dependencies]
)
to_install_packages = install_packages
patterns = []

@all_xpatterns.each do |p|
if p.status == :installed &&
!patterns.include?(p.name)
(patterns << p.name.empty?) ? "no name" : p.name
if !patterns.include?(p.name)
patterns << (p.name.empty? ? "no name" : p.name)
end
end
Pkg.TargetFinish

tmproot = AutoinstConfig.tmpDir
SCR.Execute(path(".target.mkdir"), Ops.add(tmproot, "/rootclone"))
SCR.Execute(path(".target.mkdir"), ::File.join(tmproot, "rootclone"))
Pkg.TargetInit(Ops.add(tmproot, "/rootclone"), true)
Builtins.y2debug("SourceStartCache: %1", Pkg.SourceStartCache(false))

Expand All @@ -1047,38 +1049,36 @@ def ReadHelper

new_p = []
Builtins.foreach(patterns) do |tmp_pattern|
xpattern = Builtins.filter(@all_xpatterns) do |p|
p.name == tmp_pattern
end
found = Ops.get(xpattern, 0, {})
found = @all_xpatterns.find { |p| p.name == tmp_pattern }
log.info "xpattern #{found} for pattern #{tmp_pattern}"
next unless found

req = false
# kick out hollow patterns (always fullfilled patterns)
Builtins.foreach(Ops.get_list(found, "dependencies", [])) do |d|
if Ops.get_string(d, "res_kind", "") == "package" &&
(Ops.get_string(d, "dep_kind", "") == "requires" ||
Ops.get_string(d, "dep_kind", "") == "recommends")
req = true
end
(found.dependencies || []).each do |d|
next unless Ops.get_string(d, "res_kind", "") == "package" &&
(Ops.get_string(d, "dep_kind", "") == "requires" ||
Ops.get_string(d, "dep_kind", "") == "recommends")

req = true
end
# workaround for our pattern design
# a pattern with no requires at all is always fullfilled of course
# you can fullfill the games pattern with no games installed at all
new_p = Builtins.add(new_p, tmp_pattern) if req == true
new_p << tmp_pattern if req
end
patterns = deep_copy(new_p)

software = {}

Ops.set(software, "patterns", Builtins.sort(patterns))
# Currently we do not have any information about user deleted packages in
# the installed system.
# In order to prevent a reinstallation we can take the locked packages at least.
# (bnc#888296)
software["remove-packages"] = locked_packages

software["packages"] = to_install_packages

deep_copy(software)
patterns = new_p
log.info "found patterns #{patterns}"

{
"patterns" => patterns.sort,
# Currently we do not have any information about user deleted packages in
# the installed system.
# In order to prevent a reinstallation we can take the locked packages at least.
# (bnc#888296)
"remove-packages" => locked_packages,
"packages" => to_install_packages
}
end

# Return list of software packages, patterns which have been selected
Expand Down

0 comments on commit 884e567

Please sign in to comment.