Skip to content

Commit

Permalink
next refactoring round
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Aug 6, 2014
1 parent 97a49b8 commit cfc2647
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/modules/AutoinstSoftware.rb
Expand Up @@ -941,7 +941,7 @@ def addPostPackages(calcpost)

def locked_packages
packages = Pkg.ResolvableProperties("", :package, "").select do |package|
# hard AND weak locks
# hard AND soft locks
package["transact_by"] == :user && (package["locked"] || package["status"] == :available)
end
packages.map! {|p| p["name"] }
Expand Down Expand Up @@ -989,7 +989,6 @@ def ReadHelper
userpackages = Pkg.FilterPackages(false, false, true, true)
Pkg.TargetFinish
# Remove kernel packages
removepackages = []

patternPackages = []
new_p = []
Expand Down Expand Up @@ -1059,11 +1058,6 @@ def ReadHelper
end
end
end
# 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)
removepackages = self.locked_packages

Ops.set(
software,
Expand All @@ -1073,7 +1067,11 @@ def ReadHelper
end)
)
Ops.set(software, "patterns", Builtins.sort(patterns))
Ops.set(software, "remove-packages", Builtins.toset(removepackages))
# 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
deep_copy(software)
end

Expand Down Expand Up @@ -1101,12 +1099,10 @@ def read_initial_stage
user_selected = true,
name_only = true)

remove_packages = self.locked_packages

software = {}
software["packages"] = install_packages
software["patterns"] = install_patterns.compact
software["remove-packages"] = remove_packages.compact
software["remove-packages"] = locked_packages
Builtins.y2milestone("autoyast software selection: %1", software)
deep_copy(software)
end
Expand Down

0 comments on commit cfc2647

Please sign in to comment.