Class: Zypper::Repository

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

Constant Summary

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

#add(options = {}) ⇒ Object

Adds a new repository defined by options

(string) :url URL/URL
(string) :alias


24
25
26
# File 'lib/zypper/repository.rb', line 24

def add(options = {})
  run build_command('addrepo', options)
end

#all(options = {}) ⇒ Object

Lists all known repositories



16
17
18
19
# File 'lib/zypper/repository.rb', line 16

def all(options = {})
  out = xml_run build_command('repos', options.merge(:get => XML_COMMANDS_GET))
  convert_output(out.fetch(:stream, {}).fetch(:repo_list, {}).fetch(:repo, []), :repo)
end

#refresh(options = {}) ⇒ Object

Refreshes repositories

@param (optional) options
  :force - to force the refresh
  :force_rebuild - forces rebuilding the libzypp database


11
12
13
# File 'lib/zypper/repository.rb', line 11

def refresh(options = {})
  run build_command('refresh', options)
end

#remove(options = {}) ⇒ Object

Removes a repository defined by options

(string) :alias


30
31
32
# File 'lib/zypper/repository.rb', line 30

def remove(options = {})
  run build_command('removerepo', options)
end