Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PackageSystem.Installed: Improve loging details #938

Merged
merged 3 commits into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions library/packages/src/modules/PackageSystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

module Yast
class PackageSystemClass < Module
include Yast::Logger

def main
Yast.import "Pkg"
textdomain "base"
Expand Down Expand Up @@ -335,22 +337,23 @@ def InitRPMQueryBinary
end

# Is a package provided in the system? Is there any installed package providing 'package'?
# @return true if yes
#
# @param package [String] name of the package to check if provided
# @return [Boolean] whether the package is provided in the system or not
def Installed(package)
# This is a most commonly called function and so it's
# important that it's fast, especially in the common
# case, where all dependencies are satisfied.
# Unfortunately, initializing Pkg reads the RPM database...
# so we must avoid it.
# added --whatprovides due to bug #76181
0 ==
Convert.to_integer(
SCR.Execute(
path(".target.bash"),
Ops.add("/usr/bin/rpm -q --whatprovides ", package.shellescape)
)
)
rpm_command = "/usr/bin/rpm -q --whatprovides #{package.shellescape}"
log.debug("Starting RPM query: #{rpm_command}")
output = SCR.Execute(path(".target.bash_output"), rpm_command)
log.debug("result of the query: #{output}")
teclator marked this conversation as resolved.
Show resolved Hide resolved

# return Pkg::IsProvided (package);
output["exit"] == 0
end

# Is a package installed? Checks only the package name in contrast to Installed() function.
Expand Down
7 changes: 7 additions & 0 deletions package/yast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jun 13 11:56:37 UTC 2019 - Knut Anderssen <kanderssen@suse.com>

- bsc#1137992
- PackageSystem.Installed: Increase the logs details.
- 4.2.7

-------------------------------------------------------------------
Wed Jun 5 10:44:18 UTC 2019 - Knut Anderssen <kanderssen@suse.de>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 4.2.6
Version: 4.2.7
Release: 0
Summary: YaST2 Main Package
License: GPL-2.0-only
Expand Down