Class: Gonzui::RPMAptGet

Inherits:
AbstractAptGet show all
Defined in:
lib/gonzui/apt.rb

Instance Attribute Summary

Attributes included from TemporaryDirectoryUtil

#temporary_directory

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractAptGet

#add_cleaning_proc, #clean, #extract, #run_apt_get

Methods included from TemporaryDirectoryUtil

#clean_temporary_directory, #prepare_temporary_directory, #set_temporary_directory

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

#initialize(config, package_name) ⇒ RPMAptGet

Returns a new instance of RPMAptGet.



161
162
163
164
# File 'lib/gonzui/apt.rb', line 161

def initialize(config, package_name)
  super(config, package_name)
  @apt_options = "-d"
end

Class Method Details

.apt_typeObject



157
158
159
# File 'lib/gonzui/apt.rb', line 157

def self.apt_type
  :rpm
end

Instance Method Details

#find_srpm_fileObject

Raises:



170
171
172
173
174
175
176
177
178
179
# File 'lib/gonzui/apt.rb', line 170

def find_srpm_file
  entries = Dir.entries_without_dots(self.temporary_directory)
  raise AptGetError.new("#{@package_name}: download failed") if
    entries.length != 1

  candidate = entries.first
  raise AptGetError.new("#{@package_name}: SRPM not found") unless
    srpm_file?(candidate)
  return File.join(self.temporary_directory, candidate)
end

#srpm_file?(file_name) ⇒ Boolean

Returns:

  • (Boolean)


166
167
168
# File 'lib/gonzui/apt.rb', line 166

def srpm_file?(file_name)
  /\.src\.rpm$/.match(file_name)
end