Commit 8704797e authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

apkbuild-gem-resolver: use Array.empty?

parent 4567343e
......@@ -21,7 +21,7 @@ class Package
@@augeas.load
apath = '/files' + dir
fail if @@augeas.match("/augeas#{apath}//error").length > 0
fail unless @@augeas.match("/augeas#{apath}//error").empty?
repos = ['main']
repos << 'testing' if testing
......@@ -271,7 +271,7 @@ class Update
def check_deps
specs, errors = Gem::SpecFetcher::fetcher.spec_for_dependency(dependency)
raise "Invalid gem: #{@name}-#{version}" if specs.length == 0
raise "Invalid gem: #{@name}-#{version}" if specs.empty?
fail if specs.length > 1
deps = specs[0][0].runtime_dependencies
......@@ -285,7 +285,7 @@ class Update
end
end
if deps.length > 0
unless deps.empty?
raise 'Undeclared dependencies in ' + @package.name + deps.inject('') {
|s, dep| "#{s}\n#{dep.name} #{dep.requirements_list.join ' '}"
}
......@@ -293,7 +293,7 @@ class Update
end
def update
updated? || @obsolete_deps.length > 0 ? (
updated? || !@obsolete_deps.empty? ? (
{
:name => @package.name,
:version => version,
......@@ -331,7 +331,7 @@ update.resolve
for pkg in update
obs = pkg[:obsolete_deps]
obs = obs.length == 0 ? nil : " (obsolete dependencies: #{obs.join ', '})"
obs = obs.empty? ? nil : " (obsolete dependencies: #{obs.join ', '})"
puts "#{pkg[:name]}-#{pkg[:version]}#{obs}"
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment