Permalink
Browse files

raise error if "rpm" is not installed on the machine e.g. Ubuntu, Mac…

… OS X

remove unused gems
adapt .gemspec
  • Loading branch information...
1 parent 11543ce commit 7fb1b3f377ca747d3f397fca9c1be66388339e2b @vlewin vlewin committed Jun 15, 2012
Showing with 9 additions and 12 deletions.
  1. +0 −1 Gemfile
  2. +0 −2 Gemfile.lock
  3. +8 −8 lib/handlers/appliance.rb
  4. +1 −1 ssc.gemspec
View
@@ -3,7 +3,6 @@ source "http://rubygems.org"
gem "studio_api", ">= 3.1.2"
gem "thor", ">=0.14.6"
gem "json"
-gem "awesome_print"
gem 'simplecov', :require => false, :group => :test
View
@@ -10,7 +10,6 @@ GEM
activesupport (3.2.5)
i18n (~> 0.6)
multi_json (~> 1.0)
- awesome_print (1.0.2)
builder (3.0.0)
git (1.2.5)
i18n (0.6.0)
@@ -46,7 +45,6 @@ PLATFORMS
ruby
DEPENDENCIES
- awesome_print
bundler
jeweler
json
View
@@ -1,5 +1,3 @@
-require 'active_support/core_ext'
-
module SSC
module Handler
class Appliance < Base
@@ -67,13 +65,15 @@ def status
end
end
- desc "appliance diff", "returns difference between RPMs installed on current machine and Studio configuration"
+ desc "appliance diff", "difference between RPMs installed on current machine and SUSE Studio configuration"
def diff
- # get list of installed packages
- rpm_output = `rpm -qa --qf '%{NAME}#%{VERSION}-%{RELEASE}$'`.split('$').sort # TODO: bug check exit code
- rpm_output.delete_if {|x| x["gpg-pubkey"] } # remove SUSE gpg-pubkey package
-
- local_packages = Hash[rpm_output.map {|e| e.split('#')}]
+ # get list of installed packages
+ rpm_output = `rpm -qa --qf '%{NAME}#%{VERSION}-%{RELEASE}$'`.split('$').sort # TODO: bug check exit code
+ rpm_output.delete_if {|x| x["gpg-pubkey"] } # remove SUSE gpg-pubkey package
+
+ raise "\n*** Command 'rpm 'not found: ensure RPM is installed #{$?.exitstatus}" unless $?.success?
+
+ local_packages = Hash[rpm_output.map {|e| e.split('#')}]
# read software yaml and convert to RPM hash format
studio_packages = {}
View
@@ -68,7 +68,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<mocha>, [">= 0"])
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
- s.add_dependency(%q<rcov>, [">= 0"])
+ s.add_dependency(%q<simplecov>, [">= 0"])
end
else
s.add_dependency(%q<studio_api>, [">= 3.1.2"])

0 comments on commit 7fb1b3f

Please sign in to comment.