Class: Zypper::Upgraderepo::View::Ini
- Inherits:
-
Object
- Object
- Zypper::Upgraderepo::View::Ini
- Defined in:
- lib/zypper/upgraderepo/view.rb
Overview
Ini style output.
Direct Known Subclasses
Class Method Summary collapse
- .alternative(num, repo, _max_col, alt) ⇒ Object
- .available(num, repo, _max_col) ⇒ Object
- .duplicates_footer(dcount, total) ⇒ Object
- .duplicates_header(_max_col) ⇒ Object
- .duplicates_item(num, dnum, dcount, repo, _max_col) ⇒ Object
- .footer(_max_col) ⇒ Object
- .forbidden(num, repo, _max_col) ⇒ Object
- .header(max_col, upgrade: false) ⇒ Object
- .info(num, status, repo, valid: true, suggested: "") ⇒ Object
- .not_found(num, repo, _max_col) ⇒ Object
- .redirected(num, repo, _max_col, redirected) ⇒ Object
- .separator(_max_col, _char = "-", _color = :none) ⇒ Object
- .server_error(num, repo, _max_col) ⇒ Object
- .status(os_release) ⇒ Object
- .timeout(num, repo, _max_col) ⇒ Object
- .untouched(num, repo, _max_col) ⇒ Object
- .unused_footer(ucount, total) ⇒ Object
- .unused_header(_max_col) ⇒ Object
- .unused_item(num, _unum, repo, _max_col) ⇒ Object
- .upgraded(num, repo, _max_col) ⇒ Object
Class Method Details
.alternative(num, repo, _max_col, alt) ⇒ Object
309 310 311 312 313 |
# File 'lib/zypper/upgraderepo/view.rb', line 309 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
292 293 294 |
# File 'lib/zypper/upgraderepo/view.rb', line 292 def self.available(num, repo, _max_col) info num, "Ok", repo end |
.duplicates_footer(dcount, total) ⇒ Object
402 |
# File 'lib/zypper/upgraderepo/view.rb', line 402 def self.(dcount, total); end |
.duplicates_header(_max_col) ⇒ Object
390 |
# File 'lib/zypper/upgraderepo/view.rb', line 390 def self.duplicates_header(_max_col); end |
.duplicates_item(num, dnum, dcount, repo, _max_col) ⇒ Object
392 393 394 395 396 397 398 399 400 |
# File 'lib/zypper/upgraderepo/view.rb', line 392 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 |
.footer(_max_col) ⇒ Object
338 |
# File 'lib/zypper/upgraderepo/view.rb', line 338 def self.(_max_col); end |
.forbidden(num, repo, _max_col) ⇒ Object
305 306 307 |
# File 'lib/zypper/upgraderepo/view.rb', line 305 def self.forbidden(num, repo, _max_col) info num, "Forbidden Path", repo, valid: false end |
.header(max_col, upgrade: false) ⇒ Object
336 |
# File 'lib/zypper/upgraderepo/view.rb', line 336 def self.header(max_col, upgrade: false); end |
.info(num, status, repo, valid: true, suggested: "") ⇒ Object
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 386 387 388 |
# File 'lib/zypper/upgraderepo/view.rb', line 350 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
301 302 303 |
# File 'lib/zypper/upgraderepo/view.rb', line 301 def self.not_found(num, repo, _max_col) info num, "Not Found", repo, valid: false end |
.redirected(num, repo, _max_col, redirected) ⇒ Object
296 297 298 299 |
# File 'lib/zypper/upgraderepo/view.rb', line 296 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
332 333 334 |
# File 'lib/zypper/upgraderepo/view.rb', line 332 def self.separator(_max_col, _char = "-", _color = :none) puts "" end |
.server_error(num, repo, _max_col) ⇒ Object
327 328 329 330 |
# File 'lib/zypper/upgraderepo/view.rb', line 327 def self.server_error(num, repo, _max_col) info num, "Server Error", repo puts "error=#{repo.status}" end |
.status(os_release) ⇒ Object
340 341 342 343 344 345 346 347 348 |
# File 'lib/zypper/upgraderepo/view.rb', line 340 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
315 316 317 |
# File 'lib/zypper/upgraderepo/view.rb', line 315 def self.timeout(num, repo, _max_col) info num, "Server Timeout", repo, valid: false end |
.untouched(num, repo, _max_col) ⇒ Object
323 324 325 |
# File 'lib/zypper/upgraderepo/view.rb', line 323 def self.untouched(num, repo, _max_col) info num, "Untouched", repo end |
.unused_footer(ucount, total) ⇒ Object
416 |
# File 'lib/zypper/upgraderepo/view.rb', line 416 def self.(ucount, total); end |
.unused_header(_max_col) ⇒ Object
404 |
# File 'lib/zypper/upgraderepo/view.rb', line 404 def self.unused_header(_max_col); end |
.unused_item(num, _unum, repo, _max_col) ⇒ Object
406 407 408 409 410 411 412 413 414 |
# File 'lib/zypper/upgraderepo/view.rb', line 406 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
319 320 321 |
# File 'lib/zypper/upgraderepo/view.rb', line 319 def self.upgraded(num, repo, _max_col) info num, "Upgraded", repo end |