Class: Zypper::Upgraderepo::View::Ini

Inherits:
Object
  • Object
show all
Defined in:
lib/zypper/upgraderepo/view.rb

Overview

Ini style output.

Direct Known Subclasses

Solved

Class Method Summary collapse

Class Method Details

.alternative(num, repo, _max_col, alt) ⇒ Object



306
307
308
309
310
# File 'lib/zypper/upgraderepo/view.rb', line 306

def self.alternative(num, repo, _max_col, alt)
  info num, "Not Found", repo, valid: false, suggested: alt[:url]
  puts "hint=#{alt[:message]}"
  puts "suggested_url=#{alt[:url]}" unless alt[:url].to_s.empty?
end

.available(num, repo, _max_col) ⇒ Object



289
290
291
# File 'lib/zypper/upgraderepo/view.rb', line 289

def self.available(num, repo, _max_col)
  info num, "Ok", repo
end


399
# File 'lib/zypper/upgraderepo/view.rb', line 399

def self.duplicates_footer(dcount, total); end

.duplicates_header(_max_col) ⇒ Object



387
# File 'lib/zypper/upgraderepo/view.rb', line 387

def self.duplicates_header(_max_col); end

.duplicates_item(num, dnum, dcount, repo, _max_col) ⇒ Object



389
390
391
392
393
394
395
396
397
# File 'lib/zypper/upgraderepo/view.rb', line 389

def self.duplicates_item(num, dnum, dcount, repo, _max_col)
  puts "[repository_#{num}]" if dnum == 1
  puts "number_#{dnum}_#{dcount}=#{num}"
  puts "name_#{dnum}_#{dcount}=#{repo.name}"
  puts "alias_#{dnum}_#{dcount}=#{repo.alias}"
  puts "url_#{dnum}_#{dcount}=#{repo.url}"
  puts "priority_#{dnum}_#{dcount}=#{repo.priority}"
  puts "enabled_#{dnum}_#{dcount}=#{repo.enabled? ? "Yes" : "No"}"
end


335
# File 'lib/zypper/upgraderepo/view.rb', line 335

def self.footer(_max_col); end

.forbidden(num, repo, _max_col) ⇒ Object



302
303
304
# File 'lib/zypper/upgraderepo/view.rb', line 302

def self.forbidden(num, repo, _max_col)
  info num, "Forbidden Path", repo, valid: false
end

.header(max_col, upgrade: false) ⇒ Object



333
# File 'lib/zypper/upgraderepo/view.rb', line 333

def self.header(max_col, upgrade: false); end

.info(num, status, repo, valid: true, suggested: "") ⇒ Object



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/zypper/upgraderepo/view.rb', line 347

def self.info(num, status, repo, valid: true, suggested: "")
  @@number = num
  puts "[repository_#{num}]"
  puts "name=#{repo.name}"
  puts "alias=#{repo.alias}"
  puts "old_url=#{repo.old_url}" if repo.upgraded? || !suggested.empty?
  if valid
    if repo.unversioned? && repo.old_url
      puts <<-HEADER.gsub(/^ +/, "")
        # The repository is unversioned: its packages should be perfectly
        # working regardless the distribution version, that because all the
        # required dependencies are included in the repository itself and
        # automatically picked up.
      HEADER
    end
    puts "url=#{repo.url}"
  elsif repo.enabled?
    puts <<-HEADER.gsub(/^ +/, "")
      # The interpolated URL is invalid, try overriding with the one suggested
      # in the field below or find it manually starting from the old_url.
      # The alternatives are:
      # 1. Waiting for a repository upgrade;
      # 2. Change the provider for the related installed packages;
      # 3. Disable the repository putting the enabled status to 'No'.
      #
      url=
    HEADER
  else
    puts <<-HEADER.gsub(/^ +/, "")
      # The interpolated URL is invalid, but being the repository disabled you can
      # keep the old_url in the field below, it will be ignored anyway during the
      # normal update and upgrade process.
    HEADER
    puts "url=#{repo.old_url}"
  end
  puts "priority=#{repo.priority}"
  puts "enabled=#{repo.enabled? ? "Yes" : "No"}"
  puts "status=#{status}"
end

.not_found(num, repo, _max_col) ⇒ Object



298
299
300
# File 'lib/zypper/upgraderepo/view.rb', line 298

def self.not_found(num, repo, _max_col)
  info num, "Not Found", repo, valid: false
end

.redirected(num, repo, _max_col, redirected) ⇒ Object



293
294
295
296
# File 'lib/zypper/upgraderepo/view.rb', line 293

def self.redirected(num, repo, _max_col, redirected)
  info num, "Redirected", repo, false
  puts "redirected_to=#{redirected}"
end

.separator(_max_col, _char = "-", _color = :none) ⇒ Object



329
330
331
# File 'lib/zypper/upgraderepo/view.rb', line 329

def self.separator(_max_col, _char = "-", _color = :none)
  puts ""
end

.server_error(num, repo, _max_col) ⇒ Object



324
325
326
327
# File 'lib/zypper/upgraderepo/view.rb', line 324

def self.server_error(num, repo, _max_col)
  info num, "Server Error", repo
  puts "error=#{repo.status}"
end

.status(os_release) ⇒ Object



337
338
339
340
341
342
343
344
345
# File 'lib/zypper/upgraderepo/view.rb', line 337

def self.status(os_release)
  puts "[os_release]"
  puts "name=#{os_release.fullname}"
  puts "current=#{os_release.current}"
  puts "next=#{os_release.next}"
  puts "last=#{os_release.last}"
  puts "available=#{os_release.newer.join(" ")}"
  puts "allow_unstable=#{os_release.unstable}"
end

.timeout(num, repo, _max_col) ⇒ Object



312
313
314
# File 'lib/zypper/upgraderepo/view.rb', line 312

def self.timeout(num, repo, _max_col)
  info num, "Server Timeout", repo, valid: false
end

.untouched(num, repo, _max_col) ⇒ Object



320
321
322
# File 'lib/zypper/upgraderepo/view.rb', line 320

def self.untouched(num, repo, _max_col)
  info num, "Untouched", repo
end


413
# File 'lib/zypper/upgraderepo/view.rb', line 413

def self.unused_footer(ucount, total); end

.unused_header(_max_col) ⇒ Object



401
# File 'lib/zypper/upgraderepo/view.rb', line 401

def self.unused_header(_max_col); end

.unused_item(num, _unum, repo, _max_col) ⇒ Object



403
404
405
406
407
408
409
410
411
# File 'lib/zypper/upgraderepo/view.rb', line 403

def self.unused_item(num, _unum, repo, _max_col)
  puts "[repository_#{num}]"
  puts "number=#{num}"
  puts "name=#{repo.name}"
  puts "alias=#{repo.alias}"
  puts "url=#{repo.url}"
  puts "priority=#{repo.priority}"
  puts "enabled=#{repo.enabled? ? "Yes" : "No"}"
end

.upgraded(num, repo, _max_col) ⇒ Object



316
317
318
# File 'lib/zypper/upgraderepo/view.rb', line 316

def self.upgraded(num, repo, _max_col)
  info num, "Upgraded", repo
end