• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yast / yast-yast2 / 13440235285

20 Feb 2025 04:40PM UTC coverage: 41.869% (-0.02%) from 41.889%
13440235285

push

github

web-flow
Merge pull request #1316 from yast/agama_kernel_conf

Respect Agama kernel parameters

2 of 4 new or added lines in 1 file covered. (50.0%)

265 existing lines in 40 files now uncovered.

12605 of 30106 relevant lines covered (41.87%)

10.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.67
/library/packages/src/modules/PackageKit.rb
1
# ***************************************************************************
2
#
3
# Copyright (c) 2002 - 2012 Novell, Inc.
4
# All Rights Reserved.
5
#
6
# This program is free software; you can redistribute it and/or
7
# modify it under the terms of version 2 of the GNU General Public License as
8
# published by the Free Software Foundation.
9
#
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, contact Novell, Inc.
17
#
18
# To contact Novell about this file by physical or electronic mail,
19
# you may find current contact information at www.novell.com
20
#
21
# ***************************************************************************
22
# File:  modules/PackageKit.ycp
23
# Package:  yast2
24
# Summary:  PackageKit access functions
25
# Authors:  Ladislav Slezak <lslezak@suse.cz>
26
#
27
# $Id:$
28
#
29
# This is a wrrapper around PackageKit DBus interface.
30
require "yast"
1✔
31

32
module Yast
1✔
33
  class PackageKitClass < Module
1✔
34
    def main; end
1✔
35

36
    # Check whether PackageKit daemon is running
37
    # @return [Boolean] return true if PackageKit is currently running
38
    def IsRunning
1✔
39
      cmd = "/usr/bin/dbus-send --system --dest=org.freedesktop.DBus --type=method_call --print-reply " \
×
40
            "--reply-timeout=200 / org.freedesktop.DBus.NameHasOwner string:org.freedesktop.PackageKit"
41
      Builtins.y2milestone("Checking PackageKit status: %1", cmd)
×
42

43
      out = Convert.to_map(SCR.Execute(path(".target.bash_output"), cmd))
×
44

45
      ret = false
×
46
      lines = Builtins.splitstring(Ops.get_string(out, "stdout", ""), "\n")
×
47

48
      Builtins.foreach(lines) do |line|
×
49
        ret = true if Builtins.regexpmatch(line, "boolean.*true")
×
50
      end
51

52
      Builtins.y2milestone("PackageKit is running: %1", ret)
×
53

54
      ret
×
55
    end
56

57
    # Ask the PackageKit daemon to quit
58
    # If a transaction is in progress the daemon will not quit,
59
    # you have to check the current status using isRunning() function.
60
    def SuggestQuit
1✔
61
      cmd = "/usr/bin/dbus-send --system --dest=org.freedesktop.PackageKit --type=method_call " \
×
62
            "/org/freedesktop/PackageKit org.freedesktop.PackageKit.SuggestDaemonQuit"
63
      Builtins.y2milestone("Asking PackageKit to quit: %1", cmd)
×
64

65
      ret = Convert.to_integer(SCR.Execute(path(".target.bash"), cmd))
×
66

67
      Builtins.y2error("dbus-send failed!") if ret != 0
×
68

UNCOV
69
      nil
×
70
    end
71

72
    publish function: :IsRunning, type: "boolean ()"
1✔
73
    publish function: :SuggestQuit, type: "void ()"
1✔
74
  end
75

76
  PackageKit = PackageKitClass.new
1✔
77
  PackageKit.main
1✔
78
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc