pkg-wizard 0.1.8 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,6 +1,20 @@
1
1
  = pkg-wizard
2
2
 
3
- Doc is comming...
3
+ == Installation
4
+
5
+ gem install pkg-wizard
6
+
7
+ === Requirements
8
+
9
+ Git >= 1.7
10
+
11
+ * Debian/Ubuntu
12
+
13
+ apt-get install build-essential ruby1.8-dev mock rpm yum git-core createrepo
14
+
15
+ * RHEL/Fedora
16
+
17
+ yum install rpmdevtools git createrepo mock yum-utils
4
18
 
5
19
  == Copyright
6
20
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.8
1
+ 0.1.10
@@ -0,0 +1,54 @@
1
+ require 'pkg-wizard/command'
2
+ require 'pkg-wizard/rpm'
3
+ require 'pkg-wizard/logger'
4
+ require 'pkg-wizard/git'
5
+ require 'tmpdir'
6
+ require 'fileutils'
7
+ require 'uri'
8
+
9
+ module PKGWizard
10
+ class InitEnv < Command
11
+ registry << { :name => 'init-env', :klass => self }
12
+
13
+ option :help,
14
+ :short => "-h",
15
+ :long => "--help",
16
+ :description => "Show this message",
17
+ :on => :tail,
18
+ :boolean => true,
19
+ :show_options => true,
20
+ :exit => 0
21
+
22
+ def self.perform
23
+ $stdout.sync = true
24
+ cmd = InitEnv.new
25
+ cmd.banner = "\nUsage: rpmwiz init-env\n\n"
26
+ cmd.parse_options
27
+ if `whoami`.strip.chomp != 'root'
28
+ $stderr.puts 'Run this command as root.'
29
+ exit 1
30
+ end
31
+ if File.exist?('/etc/redhat-release')
32
+ print '* Installing RHEL/Fedora requirements... '
33
+ output = `yum install -y git rpmdevtools mock createrepo yum-utils`
34
+ if $? != 0
35
+ $stderr.puts "Failed installing requirementes: \n#{output}"
36
+ exit 1
37
+ end
38
+ puts "done."
39
+ elsif File.exist?('/etc/lsb-release') and \
40
+ File.read('/etc/lsb-release') =~ /DISTRIB_ID=Ubuntu/
41
+ print '* Installing Ubuntu requirements... '
42
+ output = `apt-get install -y git-core mock createrepo rpm yum`
43
+ if $? != 0
44
+ $stderr.puts "Failed installing requirementes: \n#{output}"
45
+ exit 1
46
+ end
47
+ puts "done."
48
+ else
49
+ $stderr.puts 'unsupported distribuition'
50
+ end
51
+ end
52
+
53
+ end
54
+ end
@@ -3,13 +3,13 @@ require 'git'
3
3
  module PKGWizard
4
4
 
5
5
  class GitRPM
6
- def self.fetch(giturl, path)
6
+ def self.fetch(giturl, path, opts = {})
7
7
  # We pull if clone exists
8
8
  if File.directory?(path + '/.git')
9
9
  c = Git.open(path)
10
10
  c.pull
11
11
  else
12
- Git.clone giturl, path
12
+ Git.clone giturl, path, opts
13
13
  end
14
14
  end
15
15
  end
data/lib/pkg-wizard.rb CHANGED
@@ -4,7 +4,7 @@ require 'mixlib/cli'
4
4
 
5
5
  module PKGWizard
6
6
 
7
- VERSION = '0.1.8'
7
+ VERSION = '0.1.10'
8
8
 
9
9
  class Distribution
10
10
  def self.detect
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkg-wizard
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 8
10
- version: 0.1.8
9
+ - 10
10
+ version: 0.1.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sergio Rubio
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-21 00:00:00 +01:00
18
+ date: 2011-02-28 00:00:00 +01:00
19
19
  default_executable: pkgwiz
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -183,6 +183,7 @@ files:
183
183
  - lib/pkg-wizard/command.rb
184
184
  - lib/pkg-wizard/commands/build_bot.rb
185
185
  - lib/pkg-wizard/commands/create_srpm.rb
186
+ - lib/pkg-wizard/commands/init_env.rb
186
187
  - lib/pkg-wizard/commands/remote_build.rb
187
188
  - lib/pkg-wizard/git.rb
188
189
  - lib/pkg-wizard/logger.rb