Sha256: f3f5d4293e804150f8b67ef7f6e1043dfd9e55cab9f5cca6710fd239614017f0
Contents?: true
Size: 1.48 KB
Versions: 5
Compression:
Stored size: 1.48 KB
Contents
require 'pkg-wizard/command' require 'pkg-wizard/rpm' require 'pkg-wizard/logger' require 'pkg-wizard/git' require 'tmpdir' require 'fileutils' require 'uri' module PKGWizard class InitEnv < Command registry << { :name => 'init-env', :klass => self } option :help, :short => "-h", :long => "--help", :description => "Show this message", :on => :tail, :boolean => true, :show_options => true, :exit => 0 def self.perform $stdout.sync = true cmd = InitEnv.new cmd.banner = "\nUsage: rpmwiz init-env\n\n" cmd.parse_options if `whoami`.strip.chomp != 'root' $stderr.puts 'Run this command as root.' exit 1 end if File.exist?('/etc/redhat-release') print '* Installing RHEL/Fedora requirements... ' output = `yum install -y git rpmdevtools mock createrepo yum-utils` if $? != 0 $stderr.puts "Failed installing requirementes: \n#{output}" exit 1 end puts "done." elsif File.exist?('/etc/lsb-release') and \ File.read('/etc/lsb-release') =~ /DISTRIB_ID=Ubuntu/ print '* Installing Ubuntu requirements... ' output = `apt-get install -y git-core mock createrepo rpm yum` if $? != 0 $stderr.puts "Failed installing requirementes: \n#{output}" exit 1 end puts "done." else $stderr.puts 'unsupported distribuition' end end end end
Version data entries
5 entries across 5 versions & 1 rubygems