Class: Zypper::Update

Inherits:
Object
  • Object
show all
Includes:
ZypperUtils
Defined in:
lib/zypper/update.rb

Direct Known Subclasses

Package, Patch

Constant Summary collapse

KNOWN_TYPES =
[:patch, :package, :pattern, :product]
DEFALUT_TYPE =
:patch

Constants included from ZypperUtils

ZypperUtils::ATTRIBUTE_STARTS_WITH, ZypperUtils::PARAMS_FOR_TYPES, ZypperUtils::XML_COMMANDS_GET

Instance Attribute Summary

Attributes included from ZypperUtils

#config, #last_error_message, #last_exit_status, #last_message

Instance Method Summary collapse

Methods included from ZypperUtils

#initialize

Instance Method Details

#find_updates(options = {}) ⇒ Object

Lists all known updates



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/zypper/update.rb', line 12

def find_updates(options = {})
  options[:type] = DEFALUT_TYPE if options[:type].nil?
  # FIXME: check allowed types

  additional_options = {:quiet => true, :get => XML_COMMANDS_GET, :type => options[:type].to_s}

  out = xml_run build_command('list-updates', options.merge(additional_options))

  convert_output(out.fetch(:stream, {}).fetch(:update_status, {}).fetch(:update_list, {}).fetch(:update, []), options[:type])
  # FIXME: implement filters
end