From f62f23c40b92c61f28f5b597b9bbbff44ee86499 Mon Sep 17 00:00:00 2001 From: Sourav Moitra Date: Mon, 22 Feb 2016 21:59:59 +0530 Subject: [PATCH] Some whitespace removal --- bin/binary_gem_resolver.rb | 2 +- bin/gem_dependency_checker.rb | 3 +-- bin/gem_mapper.rb | 5 ++--- bin/gems2update.rb | 5 ++--- bin/git_gem_diff.rb | 2 +- bin/git_gem_updater.rb | 3 +-- bin/missing_deps.rb | 2 +- lib/polisher/adaptors/checker_loader.rb | 2 +- lib/polisher/adaptors/upstream.rb | 3 --- lib/polisher/adaptors/version_checker.rb | 2 -- lib/polisher/cli/bin/binary_gem_resolver.rb | 2 -- lib/polisher/cli/bin/gem_dependency_checker.rb | 2 -- lib/polisher/cli/bin/gems2update.rb | 2 -- lib/polisher/cli/bin/git_gem_updater.rb | 2 -- lib/polisher/cli/targets.rb | 1 - lib/polisher/gem.rb | 4 ---- lib/polisher/gem/attributes.rb | 1 - lib/polisher/gem/dependencies.rb | 1 - lib/polisher/gem/diff.rb | 1 - lib/polisher/gem/parser.rb | 4 ---- lib/polisher/gem/retriever.rb | 2 -- lib/polisher/gem/state.rb | 1 - lib/polisher/gem/versions.rb | 4 ---- lib/polisher/gemfile.rb | 1 - lib/polisher/gemfile/attributes.rb | 2 -- lib/polisher/gemfile/deps.rb | 3 --- lib/polisher/gemfile/parser.rb | 4 ---- lib/polisher/git/pkg.rb | 1 - lib/polisher/git/pkg/repo.rb | 5 ----- lib/polisher/git/pkg/versions.rb | 1 - lib/polisher/rpm.rb | 1 - lib/polisher/rpm/patch.rb | 4 ---- lib/polisher/rpm/requirement.rb | 4 ---- lib/polisher/rpm/requirement/parser.rb | 2 -- lib/polisher/rpm/spec.rb | 3 --- lib/polisher/rpm/spec/comparison.rb | 4 ---- lib/polisher/specifier.rb | 1 - lib/polisher/targets/koji.rb | 2 -- lib/polisher/targets/koji/builder.rb | 2 -- lib/polisher/targets/koji/diff.rb | 2 -- lib/polisher/targets/koji/versions.rb | 1 - lib/polisher/targets/yum.rb | 1 - lib/polisher/util/component.rb | 2 -- lib/polisher/util/conf_helpers.rb | 1 - lib/polisher/util/profile.rb | 1 - 45 files changed, 10 insertions(+), 94 deletions(-) diff --git a/bin/binary_gem_resolver.rb b/bin/binary_gem_resolver.rb index ba65484..42124c5 100755 --- a/bin/binary_gem_resolver.rb +++ b/bin/binary_gem_resolver.rb @@ -18,7 +18,7 @@ include Polisher::CLI - parse_args +parse_args verify_args! # require the gem's extconf diff --git a/bin/gem_dependency_checker.rb b/bin/gem_dependency_checker.rb index fae52ef..c9f56aa 100755 --- a/bin/gem_dependency_checker.rb +++ b/bin/gem_dependency_checker.rb @@ -17,13 +17,12 @@ require 'polisher/gem' require 'polisher/gemfile' require 'polisher/util/config' - require 'polisher/cli/all' require 'polisher/cli/bin/gem_dependency_checker' include Polisher::CLI - conf = gem_dependency_checker_conf +conf = gem_dependency_checker_conf optparse = gem_dependency_checker_option_parser optparse.parse! validate_sources diff --git a/bin/gem_mapper.rb b/bin/gem_mapper.rb index 1dd9bc1..51be219 100755 --- a/bin/gem_mapper.rb +++ b/bin/gem_mapper.rb @@ -7,13 +7,12 @@ require 'polisher/gemfile' require 'polisher/util/config' - require 'polisher/cli/all' require 'polisher/cli/bin/gem_mapper' include Polisher::CLI - conf = gem_mapper_conf +conf = gem_mapper_conf optparse = gem_mapper_parser optparse.parse! @@ -22,6 +21,6 @@ Polisher::Logging.level = conf[:log_level] Polisher::Config.set begin -print_tree conf + print_tree conf rescue Exception => e end diff --git a/bin/gems2update.rb b/bin/gems2update.rb index 893a02b..aaf24fa 100755 --- a/bin/gems2update.rb +++ b/bin/gems2update.rb @@ -6,13 +6,12 @@ require 'polisher/util/logger' require 'polisher/util/config' - require 'polisher/cli/all' require 'polisher/cli/bin/gems2update' include Polisher::CLI - conf = gems2update_conf +conf = gems2update_conf optparse = gems2update_parser optparse.parse! @@ -23,6 +22,6 @@ configure_targets conf begin -check_gems conf + check_gems conf rescue Exception => e end diff --git a/bin/git_gem_diff.rb b/bin/git_gem_diff.rb index a2df412..1d0a4df 100755 --- a/bin/git_gem_diff.rb +++ b/bin/git_gem_diff.rb @@ -12,7 +12,7 @@ include Polisher::CLI - conf = git_gem_diff_conf +conf = git_gem_diff_conf optparse = git_gem_diff_option_parser optparse.parse! diff --git a/bin/git_gem_updater.rb b/bin/git_gem_updater.rb index b8dd16f..bd288be 100755 --- a/bin/git_gem_updater.rb +++ b/bin/git_gem_updater.rb @@ -11,13 +11,12 @@ # Copyright (C) 2013-2014 Red Hat, Inc. require 'polisher/util/config' - require 'polisher/cli/all' require 'polisher/cli/bin/git_gem_updater' include Polisher::CLI - conf = git_gem_updater_conf +conf = git_gem_updater_conf optparse = git_gem_updater_option_parser optparse.parse! validate_gems! diff --git a/bin/missing_deps.rb b/bin/missing_deps.rb index eafef0f..c866630 100755 --- a/bin/missing_deps.rb +++ b/bin/missing_deps.rb @@ -13,7 +13,7 @@ include Polisher::CLI - conf = missing_deps_conf +conf = missing_deps_conf optparse = missing_deps_parser optparse.parse! diff --git a/lib/polisher/adaptors/checker_loader.rb b/lib/polisher/adaptors/checker_loader.rb index f25c2ba..581f96a 100644 --- a/lib/polisher/adaptors/checker_loader.rb +++ b/lib/polisher/adaptors/checker_loader.rb @@ -76,4 +76,4 @@ def should_check?(target) @check_list.include?(target) end end # module CheckerLoader -end +end # module Polisher diff --git a/lib/polisher/adaptors/upstream.rb b/lib/polisher/adaptors/upstream.rb index 83b15bc..e45125a 100644 --- a/lib/polisher/adaptors/upstream.rb +++ b/lib/polisher/adaptors/upstream.rb @@ -17,13 +17,10 @@ class Upstream def self.parse(source) if source.gem? Polisher::Gem.parse(:gem => source) - elsif source.gemspec? Polisher::Gem.parse(:gemspec => source) - elsif source.gemfile? Polisher::Gemfile.parse(source) - end end end diff --git a/lib/polisher/adaptors/version_checker.rb b/lib/polisher/adaptors/version_checker.rb index 58325ca..ca81236 100644 --- a/lib/polisher/adaptors/version_checker.rb +++ b/lib/polisher/adaptors/version_checker.rb @@ -21,14 +21,12 @@ class VersionChecker # available for specified package def self.versions_for(name, &bl) versions = {} - all_targets.each do |target| if should_check?(target) target_versions = send target_method(target), name, &bl versions.merge! target => target_versions end end - versions end diff --git a/lib/polisher/cli/bin/binary_gem_resolver.rb b/lib/polisher/cli/bin/binary_gem_resolver.rb index c74060a..b43596b 100644 --- a/lib/polisher/cli/bin/binary_gem_resolver.rb +++ b/lib/polisher/cli/bin/binary_gem_resolver.rb @@ -29,7 +29,6 @@ def extconf break end end - ec end end @@ -214,4 +213,3 @@ def find_executable(bin, path = nil) :executable => bin unless success success end - diff --git a/lib/polisher/cli/bin/gem_dependency_checker.rb b/lib/polisher/cli/bin/gem_dependency_checker.rb index ebdbb6d..45269b1 100644 --- a/lib/polisher/cli/bin/gem_dependency_checker.rb +++ b/lib/polisher/cli/bin/gem_dependency_checker.rb @@ -74,11 +74,9 @@ def print_gemfile_deps(gemfile) def print_deps(conf) if conf_gem? print_gem_deps(conf_source) - elsif conf_gemfile? print_gemfile_deps(conf_source) end - puts last_dep # XXX end end # module CLI diff --git a/lib/polisher/cli/bin/gems2update.rb b/lib/polisher/cli/bin/gems2update.rb index 39bcd13..2543ce1 100644 --- a/lib/polisher/cli/bin/gems2update.rb +++ b/lib/polisher/cli/bin/gems2update.rb @@ -47,13 +47,11 @@ def check_missing def check_gems2update(source) msg = 'processing dependencies' waiting :msg => msg, :color => :red - source.dependency_tree(:recursive => true, :dev_deps => dev_deps?) do |src, dep, resolved_dep| waiting_msg "#{msg} #{src.is_a?(Polisher::Gemfile) ? "Gemfile" : src.name}(#{dep.name})" check_missing_dep dep end - end_waiting check_missing end diff --git a/lib/polisher/cli/bin/git_gem_updater.rb b/lib/polisher/cli/bin/git_gem_updater.rb index 48bc3e1..588bc1e 100644 --- a/lib/polisher/cli/bin/git_gem_updater.rb +++ b/lib/polisher/cli/bin/git_gem_updater.rb @@ -5,7 +5,6 @@ ########################################################### require 'colored' - require 'polisher/gem' require 'polisher/git/pkg' @@ -30,7 +29,6 @@ def git_gem_updater_option_parser def validate_gems! conf[:gems] += user_gems - if conf[:gems].empty? puts "must specify a gem or user name!".red exit 1 diff --git a/lib/polisher/cli/targets.rb b/lib/polisher/cli/targets.rb index dc71a06..bce1c27 100644 --- a/lib/polisher/cli/targets.rb +++ b/lib/polisher/cli/targets.rb @@ -81,7 +81,6 @@ def configure_targets(conf) Polisher::Koji.koji_tags conf[:koji_tags] if conf[:koji_tags] Polisher::Koji.package_prefix conf[:prefix] if conf[:prefix] end - # TODO other target config end end # module CLI diff --git a/lib/polisher/gem.rb b/lib/polisher/gem.rb index 5f3c018..31951b0 100644 --- a/lib/polisher/gem.rb +++ b/lib/polisher/gem.rb @@ -5,13 +5,11 @@ require 'polisher/util/conf_helpers' require 'polisher/mixins/vendored_deps' - require 'polisher/gem/attributes' require 'polisher/gem/dependencies' require 'polisher/gem/files' require 'polisher/gem/state' require 'polisher/gem/versions' - require 'polisher/gem/parser' require 'polisher/gem/retriever' require 'polisher/gem/diff' @@ -20,13 +18,11 @@ module Polisher class Gem include ConfHelpers include HasVendoredDeps - include GemAttributes include GemDependencies include GemFiles include GemState include GemVersions - include GemParser include GemRetriever include GemDiff diff --git a/lib/polisher/gem/attributes.rb b/lib/polisher/gem/attributes.rb index fbd4843..638063f 100644 --- a/lib/polisher/gem/attributes.rb +++ b/lib/polisher/gem/attributes.rb @@ -10,7 +10,6 @@ module GemAttributes attr_accessor :version attr_accessor :deps attr_accessor :dev_deps - attr_accessor :path def file_name diff --git a/lib/polisher/gem/dependencies.rb b/lib/polisher/gem/dependencies.rb index 029bf85..826d98f 100644 --- a/lib/polisher/gem/dependencies.rb +++ b/lib/polisher/gem/dependencies.rb @@ -43,7 +43,6 @@ def resolve_tree_deps(args = {}, &bl) def resolve_tree_dep(args = {}, &bl) dep = args[:dep] matching = args[:matching] - resolved = nil begin resolved = Polisher::Gem.matching(dep, matching) diff --git a/lib/polisher/gem/diff.rb b/lib/polisher/gem/diff.rb index bca01f9..5dd5a2b 100644 --- a/lib/polisher/gem/diff.rb +++ b/lib/polisher/gem/diff.rb @@ -32,7 +32,6 @@ def diff(other) FileUtils.rm_rf other_dir unless other_dir.nil? || !other.is_a?(Polisher::Gem) end - out end end # module GemDiff diff --git a/lib/polisher/gem/parser.rb b/lib/polisher/gem/parser.rb index cf7e6a1..99a45b7 100644 --- a/lib/polisher/gem/parser.rb +++ b/lib/polisher/gem/parser.rb @@ -69,15 +69,11 @@ def from_gem(gem_path) def parse(args = {}) if args.is_a?(String) return from_json args - elsif args.key?(:gemspec) return from_gemspec args[:gemspec] - elsif args.key?(:gem) return from_gem args[:gem] - end - new end end # module ClassMethods diff --git a/lib/polisher/gem/retriever.rb b/lib/polisher/gem/retriever.rb index 668d729..5004fed 100644 --- a/lib/polisher/gem/retriever.rb +++ b/lib/polisher/gem/retriever.rb @@ -25,12 +25,10 @@ def client def download_gem(name, version) cached = GemCache.get(name, version) return cached unless cached.nil? - client.url = "https://rubygems.org/gems/#{name}-#{version}.gem" client.follow_location = true client.http_get gemf = client.body_str - GemCache.set(name, version, gemf) gemf end diff --git a/lib/polisher/gem/state.rb b/lib/polisher/gem/state.rb index c746cae..2a7edce 100644 --- a/lib/polisher/gem/state.rb +++ b/lib/polisher/gem/state.rb @@ -74,7 +74,6 @@ def distgit_state(args = {}) # the specified gem dependency requirements def state(args = {}) return :available if koji_state(args) == :available - state = distgit_state(args) return :needs_repo if state == :missing_repo return :needs_branch if state == :missing_branch diff --git a/lib/polisher/gem/versions.rb b/lib/polisher/gem/versions.rb index 45fa1ab..367e705 100644 --- a/lib/polisher/gem/versions.rb +++ b/lib/polisher/gem/versions.rb @@ -105,7 +105,6 @@ def dependency_versions(args = {}, &bl) args[:versions] = versions end - versions end @@ -115,16 +114,13 @@ def versions(args = {}, &bl) recursive = local_args[:recursive] dev_deps = local_args[:dev_deps] versions = local_args[:versions] || {} - gem_versions = Polisher::VersionChecker.versions_for(name, &bl) versions.merge! name => gem_versions local_args[:versions] = versions - if recursive versions.merge! dependency_versions local_args, &bl versions.merge! dependency_versions local_args.merge(:dev => true), &bl if dev_deps end - versions end # module ClassMethods end # module GemVersions diff --git a/lib/polisher/gemfile.rb b/lib/polisher/gemfile.rb index a70773c..0929086 100644 --- a/lib/polisher/gemfile.rb +++ b/lib/polisher/gemfile.rb @@ -11,7 +11,6 @@ module Polisher class Gemfile include VersionedDependencies - include GemfileAttributes include GemfileDeps include GemfileParser diff --git a/lib/polisher/gemfile/attributes.rb b/lib/polisher/gemfile/attributes.rb index 4853cf0..a6db4e5 100644 --- a/lib/polisher/gemfile/attributes.rb +++ b/lib/polisher/gemfile/attributes.rb @@ -7,13 +7,11 @@ module Polisher module GemfileAttributes # always nil, for interface compatability attr_accessor :version - attr_accessor :deps attr_accessor :dev_deps # always empty array, for interface compatability attr_accessor :file_paths - attr_accessor :definition end # module GemfileAttributes end # module Polisher diff --git a/lib/polisher/gemfile/deps.rb b/lib/polisher/gemfile/deps.rb index c189ceb..52b6b98 100644 --- a/lib/polisher/gemfile/deps.rb +++ b/lib/polisher/gemfile/deps.rb @@ -22,19 +22,16 @@ def patched # (path and alternate rubygems src) next unless dep.source.is_a?(Bundler::Source::Git) src = dep.source - # retrieve gem gem = if src.version Polisher::Gem.new(:name => dep.name, :version => src.version) else Polisher::Gem.retrieve(dep.name) end - # retrieve dep git = Polisher::Git::Repo.new :url => src.uri git.clone unless git.cloned? git.checkout src.ref if src.ref - # diff gem against git gem.diff(git.path) end.compact! diff --git a/lib/polisher/gemfile/parser.rb b/lib/polisher/gemfile/parser.rb index 141a40a..c7274af 100644 --- a/lib/polisher/gemfile/parser.rb +++ b/lib/polisher/gemfile/parser.rb @@ -18,7 +18,6 @@ def parse(path, args = {}) require 'bundler' groups = args[:groups] - definition = nil path, gemfile = File.split(path) Dir.chdir(path) do @@ -28,16 +27,13 @@ def parse(path, args = {}) raise ArgumentError, "invalid gemfile: #{path}" end end - metadata = {} metadata[:deps] = definition.dependencies.select do |d| groups.nil? || groups.empty? || # groups not specified groups.any? { |g| d.groups.include?(g.intern) } # dep in any group end - metadata[:dev_deps] = [] # TODO metadata[:definition] = definition - new metadata end end # module ClassMethods diff --git a/lib/polisher/git/pkg.rb b/lib/polisher/git/pkg.rb index bb9342d..7033ecb 100644 --- a/lib/polisher/git/pkg.rb +++ b/lib/polisher/git/pkg.rb @@ -19,7 +19,6 @@ class Pkg < Repo include PkgAttributes include PkgRepo include PkgVersions - include PkgBuilder include PkgUpdater diff --git a/lib/polisher/git/pkg/repo.rb b/lib/polisher/git/pkg/repo.rb index 204cf2e..d1001ab 100644 --- a/lib/polisher/git/pkg/repo.rb +++ b/lib/polisher/git/pkg/repo.rb @@ -11,13 +11,11 @@ module Git module PkgRepo # Alias orig clone method to git_clone alias :git_clone :clone - # Override clone to use PKG_PCMD # @override def clone require_dep! 'awesome_spawn' require_cmd! pkg_cmd - clobber! Dir.mkdir path unless File.directory? path in_repo do @@ -35,7 +33,6 @@ def clone FileUtils.rm_rf rpm_name end - self end @@ -47,7 +44,6 @@ def fetch(target = nil) checkout target reset! pull - self end @@ -72,7 +68,6 @@ def valid_targets def commit(msg = nil) require_dep! 'awesome_spawn' require_cmd! git_cmd - in_repo { AwesomeSpawn.run "#{git_cmd} add #{pkg_files.join(' ')}" } super(msg.nil? ? "updated to #{version}" : msg) self diff --git a/lib/polisher/git/pkg/versions.rb b/lib/polisher/git/pkg/versions.rb index 596fd57..43f390b 100644 --- a/lib/polisher/git/pkg/versions.rb +++ b/lib/polisher/git/pkg/versions.rb @@ -30,7 +30,6 @@ def versions_for(name, &bl) logger.warn "error retrieving #{name} from #{gitpkg.url}/#{tgt}(distgit): #{e}" end end - bl.call(:git, name, versions) unless bl.nil? versions end diff --git a/lib/polisher/rpm.rb b/lib/polisher/rpm.rb index 06e158c..4122a69 100644 --- a/lib/polisher/rpm.rb +++ b/lib/polisher/rpm.rb @@ -10,7 +10,6 @@ module RPM # Use rpmdev-packager if it's available def self.packager require 'awesome_spawn' - @packager ||= AwesomeSpawn.run('/usr/bin/rpmdev-packager').output.chop rescue AwesomeSpawn::NoSuchFileError end diff --git a/lib/polisher/rpm/patch.rb b/lib/polisher/rpm/patch.rb index 8de1f2c..b10b44a 100644 --- a/lib/polisher/rpm/patch.rb +++ b/lib/polisher/rpm/patch.rb @@ -20,10 +20,7 @@ def spec_line(n = 0) def self.from(diff) return diff.collect { |d| from(d) } if diff.is_a?(Array) - result = {} - - in_diff = nil diff_lines = '' diff.each_line do |line| @@ -38,7 +35,6 @@ def self.from(diff) end end result[in_diff] = diff_lines if in_diff - result.collect { |t, c| new :title => t, :content => c } end end diff --git a/lib/polisher/rpm/requirement.rb b/lib/polisher/rpm/requirement.rb index 263827f..451c2f5 100644 --- a/lib/polisher/rpm/requirement.rb +++ b/lib/polisher/rpm/requirement.rb @@ -4,18 +4,15 @@ # Copyright (C) 2013-2014 Red Hat, Inc. require 'polisher/util/conf_helpers' - require 'polisher/rpm/requirement/attributes' require 'polisher/rpm/requirement/parser' require 'polisher/rpm/requirement/comparison' - require 'polisher/rpm/requirement/gem_reference' module Polisher module RPM class Requirement include ConfHelpers - include RequirementAttributes include RequirementParser include RequirementComparison @@ -31,7 +28,6 @@ def initialize(args = {}) @name = args[:name] @condition = args[:condition] @version = args[:version] - @name.strip! unless @name.nil? @condition.strip! unless @condition.nil? @version.strip! unless @version.nil? diff --git a/lib/polisher/rpm/requirement/parser.rb b/lib/polisher/rpm/requirement/parser.rb index 970daaa..130c9cb 100644 --- a/lib/polisher/rpm/requirement/parser.rb +++ b/lib/polisher/rpm/requirement/parser.rb @@ -21,12 +21,10 @@ def parse(str, opts = {}) name = stra[1] condition = stra[2] version = stra[3] - else name = stra[0] condition = stra[1] version = stra[2] - end req = new({:name => name, diff --git a/lib/polisher/rpm/spec.rb b/lib/polisher/rpm/spec.rb index b7beda4..3e0094f 100644 --- a/lib/polisher/rpm/spec.rb +++ b/lib/polisher/rpm/spec.rb @@ -4,16 +4,13 @@ # Copyright (C) 2013-2014 Red Hat, Inc. require "active_support/core_ext/hash/except" - require 'polisher/rpm/spec/requirements' require 'polisher/rpm/spec/files' require 'polisher/rpm/spec/subpackages' require 'polisher/rpm/spec/check' - require 'polisher/rpm/spec/updater' require 'polisher/rpm/spec/parser' require 'polisher/rpm/spec/comparison' - require 'polisher/rpm/spec/gem_files' require 'polisher/rpm/spec/gem_reference' require 'polisher/rpm/spec/gem_requirements' diff --git a/lib/polisher/rpm/spec/comparison.rb b/lib/polisher/rpm/spec/comparison.rb index 0e766b8..e2153a7 100644 --- a/lib/polisher/rpm/spec/comparison.rb +++ b/lib/polisher/rpm/spec/comparison.rb @@ -34,12 +34,10 @@ def compare_upstream_deps(upstream_source, same, diff) if spec_reqs.nil? diff[d.name] = {:spec => nil, :upstream => d.requirement.to_s} - elsif !spec_reqs.any? { |req| req.matches?(d) } || !self.has_all_requirements_for?(d) diff[d.name] = {:spec => spec_reqs_specifier, :upstream => d.requirement.to_s} - elsif !diff.has_key?(d.name) same[d.name] = {:spec => spec_reqs_specifier, :upstream => d.requirement.to_s} @@ -56,11 +54,9 @@ def compare_local_deps(upstream_source, same, diff) if upstream_dep.nil? diff[req.gem_name] = {:spec => req.specifier, :upstream => nil} - elsif !req.matches?(upstream_dep) diff[req.gem_name] = {:spec => req.specifier, :upstream => upstream_dep.requirement.to_s} - elsif !diff.has_key?(req.gem_name) same[req.gem_name] = {:spec => req.specifier, :upstream => upstream_dep.requirement.to_s} diff --git a/lib/polisher/specifier.rb b/lib/polisher/specifier.rb index 0d8548a..c1de717 100644 --- a/lib/polisher/specifier.rb +++ b/lib/polisher/specifier.rb @@ -8,6 +8,5 @@ module Polisher EARLIEST_SPECIFIER = :earliest LATEST_SPECIFIER = :latest - RELATIVE_SPECIFIERS = [EARLIEST_SPECIFIER, LATEST_SPECIFIER] end # module Polisher diff --git a/lib/polisher/targets/koji.rb b/lib/polisher/targets/koji.rb index cd976c5..8b1736b 100644 --- a/lib/polisher/targets/koji.rb +++ b/lib/polisher/targets/koji.rb @@ -4,7 +4,6 @@ # Copyright (C) 2013-2014 Red Hat, Inc. require 'polisher/util/conf_helpers' - require 'polisher/targets/koji/rpc' require 'polisher/targets/koji/versions' require 'polisher/targets/koji/builder' @@ -13,7 +12,6 @@ module Polisher class Koji include ConfHelpers - include KojiRpc include KojiVersions include KojiBuilder diff --git a/lib/polisher/targets/koji/builder.rb b/lib/polisher/targets/koji/builder.rb index d622c0f..ba045f6 100644 --- a/lib/polisher/targets/koji/builder.rb +++ b/lib/polisher/targets/koji/builder.rb @@ -14,11 +14,9 @@ module ClassMethods def build(args = {}) require 'awesome_spawn' require_cmd! build_cmd - target = args[:target] || build_tgt srpm = args[:srpm] scratch = args[:scratch] ? '--scratch' : '' - cmd = "#{build_cmd} build #{scratch} #{target} #{srpm}" result = AwesomeSpawn.run(cmd) url = parse_url(result.output) diff --git a/lib/polisher/targets/koji/diff.rb b/lib/polisher/targets/koji/diff.rb index 8b58fc8..c54028d 100644 --- a/lib/polisher/targets/koji/diff.rb +++ b/lib/polisher/targets/koji/diff.rb @@ -27,11 +27,9 @@ def diff(tag1, tag2) builds2.each do |build| name = build['package_name'] next if builds.key?(name) - version = build['version'] builds[name] = {tag1 => nil, tag2 => version} end - builds end end # module ClassMethods diff --git a/lib/polisher/targets/koji/versions.rb b/lib/polisher/targets/koji/versions.rb index 5805cff..2fd77b0 100644 --- a/lib/polisher/targets/koji/versions.rb +++ b/lib/polisher/targets/koji/versions.rb @@ -59,7 +59,6 @@ def versions_for_tag(name, tag) client.call('listTagged', tag, nil, true, nil, false, "#{prefix}#{name}") end - metadata.flatten.collect { |b| b['version'] }.uniq end end # module ClassMethods diff --git a/lib/polisher/targets/yum.rb b/lib/polisher/targets/yum.rb index f7a0911..cf5c52d 100644 --- a/lib/polisher/targets/yum.rb +++ b/lib/polisher/targets/yum.rb @@ -18,7 +18,6 @@ class Yum # @returns [String] version of gem in yum or nil if not found def self.version_for(name, &bl) require 'awesome_spawn' - require_cmd! yum_cmd version = nil diff --git a/lib/polisher/util/component.rb b/lib/polisher/util/component.rb index 0292f0a..4b7fc93 100644 --- a/lib/polisher/util/component.rb +++ b/lib/polisher/util/component.rb @@ -22,7 +22,6 @@ def self.verify(polisher_klass, *dependencies) all_required = dependencies.all? do |dep| require_dependency(polisher_klass, dep) end - yield if all_required end @@ -32,7 +31,6 @@ def self.require_dependency(polisher_klass, dependency) rescue LoadError klasses = polisher_klass.split("::") desired_namespace = Polisher - klasses.each do |k| desired_namespace.const_set(k, Missing) unless desired_namespace.const_defined?(k, false) desired_namespace = "#{desired_namespace.name}::#{k}".constantize diff --git a/lib/polisher/util/conf_helpers.rb b/lib/polisher/util/conf_helpers.rb index 87f01a8..fb1a215 100644 --- a/lib/polisher/util/conf_helpers.rb +++ b/lib/polisher/util/conf_helpers.rb @@ -48,7 +48,6 @@ def conf_attr(name, opts = {}) current.compact! current.flatten! instance_variable_set(nvar, current) - else instance_variable_set(nvar, default) unless current instance_variable_set(nvar, ENV[envk]) if ENV.key?(envk) diff --git a/lib/polisher/util/profile.rb b/lib/polisher/util/profile.rb index 1768e8b..1f0eea9 100644 --- a/lib/polisher/util/profile.rb +++ b/lib/polisher/util/profile.rb @@ -4,7 +4,6 @@ # Copyright (C) 2015 Red Hat, Inc. require "active_support/core_ext/hash/except" - require 'polisher/util/config' require 'polisher/util/conf_helpers'