Tidying up
This commit is contained in:
parent
f0fec31123
commit
8031edf2d1
1 changed files with 5 additions and 11 deletions
|
|
@ -17,7 +17,7 @@ module DebImporter
|
||||||
attr_reader :architectures, :components, :description, :codename, :origin, :version, :files
|
attr_reader :architectures, :components, :description, :codename, :origin, :version, :files
|
||||||
|
|
||||||
# Load and parse a Release file of an APT repository
|
# Load and parse a Release file of an APT repository
|
||||||
def initialize(dist_url, components)
|
def initialize(dist_url)
|
||||||
@dist_url = dist_url
|
@dist_url = dist_url
|
||||||
release_url = dist_url + "/Release"
|
release_url = dist_url + "/Release"
|
||||||
Rails.logger.debug "Loading Release file from #{release_url}"
|
Rails.logger.debug "Loading Release file from #{release_url}"
|
||||||
|
|
@ -29,18 +29,12 @@ module DebImporter
|
||||||
@codename = fields[:Codename]
|
@codename = fields[:Codename]
|
||||||
@origin = fields[:Origin]
|
@origin = fields[:Origin]
|
||||||
@version = fields[:Version]
|
@version = fields[:Version]
|
||||||
# Not needed at the moment. We do not check sizes or checksums yet.
|
|
||||||
#when 'SHA1', 'SHA256', 'MD5Sum'
|
# TODO: check sizes and checksums
|
||||||
# next if @files # skip parsing files if another section (e.g. "MD5Sum") already gathered them
|
|
||||||
# @files = []
|
|
||||||
# value.lines.each do |line|
|
|
||||||
# path = line.split.last
|
|
||||||
# @files << path
|
|
||||||
# end
|
|
||||||
end # open
|
end # open
|
||||||
end # def initialize
|
end # def initialize
|
||||||
|
|
||||||
# TODO: Avoid code duplication (bz2, gz, ...)
|
# Get package information from translation (i18n) files
|
||||||
def i18n(component, language)
|
def i18n(component, language)
|
||||||
url = "#{@dist_url}/#{component}/i18n/Translation-en"
|
url = "#{@dist_url}/#{component}/i18n/Translation-en"
|
||||||
file = find_and_open_compressed_url(url)
|
file = find_and_open_compressed_url(url)
|
||||||
|
|
@ -92,7 +86,7 @@ module DebImporter
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Gather the fields of a Debian control file and return them as a hash
|
# Gather the fields of a Debian control file section and return them as a hash
|
||||||
def get_fields(data)
|
def get_fields(data)
|
||||||
fields = {}
|
fields = {}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue