Class: Gonzui::Updater

Inherits:
AbstractUpdater show all
Defined in:
lib/gonzui/updater.rb

Instance Method Summary collapse

Methods inherited from AbstractUpdater

#finish, #initialize, #summary

Methods included from Util

assert, assert_equal, assert_equal_all, assert_non_nil, assert_not_reached, benchmark, command_exist?, commify, eprintf, format_bytes, program_name, protect_from_signals, require_command, set_verbosity, shell_escape, unix?, vprintf, windows?, wprintf

Constructor Details

This class inherits a constructor from Gonzui::AbstractUpdater

Instance Method Details

#updateObject



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/gonzui/updater.rb', line 238

def update
  # Don't use #each_package_name to avoid
  # deadlock. #each_package_name creates and holds a
  # cursor while an iteration
  @dbm.get_package_names.each {|package_name|
    begin
      updated_p = update_package(package_name)
      yield(package_name) if block_given? and updated_p
    rescue SourceDisappeared
      wprintf("%s: source disappeared", package_name)
    ensure
      @dbm.flush_cache
    end
  }
end