Skip to content

Commit

Permalink
Rename (not tested!)
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Feb 18, 2022
1 parent af52769 commit f2ae0a3
Show file tree
Hide file tree
Showing 22 changed files with 57 additions and 47 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions yastd/bin/d-installer → service/bin/d-installer
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ require "rubygems"
require "bundler/setup"

require "eventmachine"
require "yast2/dbus/service"
require "dinstaller/dbus/service"

EM.run do
service = Yast2::DBus::Service.new
service = DInstaller::DBus::Service.new
service.export
EventMachine::PeriodicTimer.new(0.1) { service.dispatch }
end
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions yastd/lib/yast2.rb → service/lib/dinstaller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

# Specific YaST code lives within this module.
module Yast2
module DInstaller
end

require "yast2/installer"
11 changes: 11 additions & 0 deletions service/lib/dinstaller/dbus.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

# Namespace for DBus API
module DInstaller
module DBus
end
end

require "dinstaller/dbus/manager"
require "dinstaller/dbus/language"
require "dinstaller/dbus/software"
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@

require "dbus"

module Yast2
module DInstaller
module DBus
# YaST D-Bus object (/org/opensuse/YaST/Installer1)
#
# @see https://rubygems.org/gems/ruby-dbus
class Language < ::DBus::Object
PATH = "/org/opensuse/Yast/Language1".freeze
PATH = "/org/opensuse/DInstaller/Language1".freeze
private_constant :PATH

YAST_LANGUAGE_INTERFACE = "org.opensuse.YaST.Language1".freeze
private_constant :YAST_LANGUAGE_INTERFACE
LANGUAGE_INTERFACE = "org.opensuse.DInstaller.Language1".freeze
private_constant :LANGUAGE_INTERFACE

# @param installer [Yast2::Installer] YaST installer instance
def initialize(installer, logger)
Expand All @@ -39,7 +39,7 @@ def initialize(installer, logger)
super(PATH)
end

dbus_interface YAST_LANGUAGE_INTERFACE do
dbus_interface LANGUAGE_INTERFACE do
dbus_reader :available_languages, "a(ssa{sv})"
attr_writer :available_languages
dbus_watcher :available_languages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@

require "dbus"

module Yast2
module DInstaller
module DBus
# YaST D-Bus object (/org/opensuse/YaST/Installer1)
# YaST D-Bus object (/org/opensuse/DInstaller/Manager1)
#
# @see https://rubygems.org/gems/ruby-dbus
class Installer < ::DBus::Object
PATH = "/org/opensuse/YaST/Installer1".freeze
class Manager < ::DBus::Object
PATH = "/org/opensuse/DInstaller/Manager1".freeze
private_constant :PATH

YAST_INSTALLER_INTERFACE = "org.opensuse.YaST.Installer1"
private_constant :YAST_INSTALLER_INTERFACE
MANAGER_INTERFACE = "org.opensuse.DInstaler.Manager1".freeze
private_constant :MANAGER_INTERFACE

attr_reader :installer, :logger

# @param installer [Yast2::Installer] YaST installer instance
Expand All @@ -45,7 +46,7 @@ def initialize(installer, logger)
super(PATH)
end

dbus_interface YAST_INSTALLER_INTERFACE do
dbus_interface MANAGER_INTERFACE do
dbus_method :probe, "out result:u" do
# TODO
0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
# find current contact information at www.suse.com.

require "dbus"
require "yast2/dbus/installer"
require "yast2/dbus/language"
require "yast2/dbus/software"
require "yast2/installer"
require "dinstaller/dbus/manager"
require "dinstaller/dbus/language"
require "dinstaller/dbus/software"
# require "dinstaller/installer"

module Yast2
module DInstaller
module DBus
# YaST D-Bus service (org.opensuse.YaST)
#
Expand All @@ -37,13 +37,13 @@ module DBus
# @see Yast2::DBus::Installer
class Service
# @return [String] service name
SERVICE_NAME = "org.opensuse.YaST".freeze
SERVICE_NAME = "org.opensuse.DInstaller".freeze

# @return [String] D-Bus object path
attr_reader :bus

def initialize(logger = nil)
@logger = logger || Logger.new(STDOUT)
@logger = logger || Yast2::Logger.new(STDOUT)
@bus = ::DBus::SystemBus.instance
end

Expand All @@ -68,27 +68,27 @@ def service
end

def dbus_objects
@dbus_objects ||= [installer_dbus, language_dbus, software_dbus]
@dbus_objects ||= [manager_bus, language_dbus, software_dbus]
end

def installer_dbus
@installer_dbus ||= Yast2::DBus::Installer.new(yast_installer, logger)
def manager_bus
@manager_bus ||= DInstaller::DBus::Manager.new
end

def language_dbus
@language_dbus ||= Yast2::DBus::Language.new(yast_installer, logger)
@language_dbus ||= DInstaller::DBus::Language.new
end

def software_dbus
@software_dbus ||= Yast2::DBus::Software.new(yast_installer, logger)
@software_dbus ||= DInstaller::DBus::Software.new
end

def yast_installer
@yast_installer ||= Yast2::Installer.new(logger: logger).tap do |installer|
# FIXME: do not probe by default
installer.probe
#installer.dbus_objects = dbus_objects
end
# def installer
# @installer ||= DInstaller::Installer.new(logger: logger).tap do |installer|
# # FIXME: do not probe by default
# installer.probe
# #installer.dbus_objects = dbus_objects
# end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ module DBus
#
# @see https://rubygems.org/gems/ruby-dbus
class Software < ::DBus::Object
PATH = "/org/opensuse/YaST/Software1".freeze
PATH = "/org/opensuse/DInstaller/Software1".freeze
private_constant :PATH

YAST_SOFTWARE_INTERFACE = "org.opensuse.YaST.Software1"
private_constant :YAST_SOFTWARE_INTERFACE
SOFTWARE_INTERFACE = "org.opensuse.DInstaller.Software1"
private_constant :SOFTWARE_INTERFACE

attr_reader :installer, :logger

Expand All @@ -44,7 +44,7 @@ def initialize(installer, logger)
super(PATH)
end

dbus_interface YAST_SOFTWARE_INTERFACE do
dbus_interface SOFTWARE_INTERFACE do
dbus_reader :available_base_products, "a(ssa{sv})"
attr_writer :available_base_products
dbus_watcher :available_base_products
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# find current contact information at www.suse.com.

# YaST specific code lives under this namespace
module Yast2
module DInstaller
# This class represents the installer status
class InstallationProgress
KNOWN_STEPS = 3 # keep it in sync with installer.rb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

require "yast"
require "y2storage"
require "yast2/installer_status"
require "yast2/software"
require "yast2/installation_progress"
require "dinstaller/installer_status"
require "dinstaller/software"
require "dinstaller/installation_progress"
require "bootloader/proposal_client"
require "bootloader/finish_client"
require "dbus"
Expand All @@ -33,7 +33,7 @@
Yast.import "Stage"

# YaST specific code lives under this namespace
module Yast2
module DInstaller
# This class represents the installer itself
#
# It is responsible for orchestrating the installation process. Additionally,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# find current contact information at www.suse.com.

# YaST specific code lives under this namespace
module Yast2
module DInstaller
# This class represents the installer status
class InstallerStatus
class << self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Yast.import "Pkg"

# YaST specific code lives under this namespace
module Yast2
module DInstaller
# This class represents the installer status
class PackageCallbacks
class << self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
Yast.import "Stage"

# YaST specific code lives under this namespace
module Yast2
module DInstaller
# This class is responsible for software handling
class Software
attr_reader :product, :products
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f2ae0a3

Please sign in to comment.