Skip to content

Commit

Permalink
Ruby debugger integration (FATE#318421) (#379)
Browse files Browse the repository at this point in the history
* "byebug" debugger integration (FATE#318421)

* move to a seprate method
  • Loading branch information
lslezak committed May 25, 2016
1 parent a99a7bb commit 6deb417
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package/yast2-installation.spec
Expand Up @@ -26,7 +26,8 @@ Source0: %{name}-%{version}.tar.bz2
Group: System/YaST
License: GPL-2.0
Url: http://github.com/yast/yast-installation
Requires: yast2-ruby-bindings >= 3.1.8
# yast/debugger
Requires: yast2-ruby-bindings >= 3.1.47

Summary: YaST2 - Installation Parts

Expand Down
24 changes: 24 additions & 0 deletions src/lib/installation/clients/installation.rb
Expand Up @@ -30,19 +30,26 @@
# $Id$
module Yast
class InstallationClient < Client
include Yast::Logger

def main
textdomain "installation"

Yast.import "Wizard"
Yast.import "Stage"
Yast.import "Report"
Yast.import "Hooks"
Yast.import "Linuxrc"

Hooks.search_path.join!("installation")

# Initialize the UI
UI.SetProductLogo(true)
Wizard.OpenLeftTitleNextBackDialog

# start the debugger if requested (FATE#318421)
start_debugger

Wizard.SetContents(
# title
"",
Expand Down Expand Up @@ -97,5 +104,22 @@ def main

deep_copy(@ret)
end

private

# start the Ruby debugger if booted with the Y2DEBUGGER option
def start_debugger
return unless (Linuxrc.InstallInf("Cmdline") || "").match(/\bY2DEBUGGER=(.*)\b/i)

option = Regexp.last_match[1]
log.info "Y2DEBUGGER option: #{option}"

if option == "1" || option == "remote" || option == "manual"
require "yast/debugger"
Debugger.start(remote: option == "remote", start_client: option != "manual")
else
log.warn "Unknown Y2DEBUGGER value: #{option}"
end
end
end
end

0 comments on commit 6deb417

Please sign in to comment.