Skip to content

Commit

Permalink
Display more details when the package solver fails
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jan 19, 2018
1 parent b65853c commit ecb4967
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
5 changes: 5 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jan 19 14:02:32 UTC 2018 - lslezak@suse.cz

- Display more details when the package solver fails

-------------------------------------------------------------------
Thu Jan 18 14:37:15 CET 2018 - schubi@suse.de

Expand Down
26 changes: 19 additions & 7 deletions src/modules/AutoinstSoftware.rb
Expand Up @@ -14,6 +14,11 @@
module Yast
class AutoinstSoftwareClass < Module
include Yast::Logger

# This file is created by pkg-bindings when the package solver fails,
# it contains some details of the failure
BAD_LIST_FILE = "/var/log/YaST2/badlist".freeze

def main
Yast.import "UI"
Yast.import "Pkg"
Expand Down Expand Up @@ -842,12 +847,12 @@ def Write

Packages.Init(true)
# Resetting package selection of previous runs. This is needed
# because it could be that additional repositories
# because it could be that additional repositories
# are available meanwhile. (bnc#979691)
Pkg.PkgApplReset

sw_settings = Profile.current.fetch("software",{})
Pkg.SetSolverFlags({ "ignoreAlreadyRecommended" => Mode.normal,
Pkg.SetSolverFlags({ "ignoreAlreadyRecommended" => Mode.normal,
"onlyRequires" => !sw_settings.fetch("install_recommended",true) })

failed = []
Expand Down Expand Up @@ -929,11 +934,18 @@ def Write
# Solve dependencies
#
if !Pkg.PkgSolve(false)
Report.Error(
_(
"The package resolver run failed. Please check your software section in the autoyast profile."
)
)
msg = _("The package resolver run failed. Please check your software " \
"section in the autoyast profile.")
msg += "\n" + _("Additional details can be found in the %s file.") %
"/var/log/YaST2/y2log"

# read the details saved by pkg-bindings
if File.exist?(BAD_LIST_FILE)
msg += "\n\n"
msg += File.read(BAD_LIST_FILE)
end

Report.LongError(msg)
end

SpaceCalculation.ShowPartitionWarning
Expand Down

0 comments on commit ecb4967

Please sign in to comment.