fpm-cookery 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ # v0.7.0 (2011-11-26)
2
+ * Add hg (mercurial) source handler.
3
+ * Fix tags fetchting for the git source handler.
4
+
1
5
  # v0.6.0 (2011-11-19)
2
6
  * Add a logging/output system.
3
7
  * Improve extracted source detection for the curl and svn source handler.
@@ -2,6 +2,7 @@ require 'forwardable'
2
2
  require 'fpm/cookery/source_handler/curl'
3
3
  require 'fpm/cookery/source_handler/svn'
4
4
  require 'fpm/cookery/source_handler/git'
5
+ require 'fpm/cookery/source_handler/hg'
5
6
  require 'fpm/cookery/log'
6
7
 
7
8
  module FPM
@@ -12,6 +12,7 @@ module FPM
12
12
  if local_path.exist?
13
13
  Dir.chdir(local_path) do
14
14
  git('fetch', url)
15
+ git('fetch', '--tags', url)
15
16
  end
16
17
  else
17
18
  Dir.chdir(cachedir) do
@@ -49,7 +50,7 @@ module FPM
49
50
 
50
51
  private
51
52
  def git(command, *args)
52
- #Log.debug "git #{command} #{args.join(' ')}"
53
+ Log.debug "git #{command} #{args.join(' ')}"
53
54
  safesystem('git', command, *args)
54
55
  end
55
56
  end
@@ -0,0 +1,50 @@
1
+ require 'fpm/cookery/source_handler/template'
2
+ require 'fpm/cookery/log'
3
+
4
+ module FPM
5
+ module Cookery
6
+ class SourceHandler
7
+ class Hg < FPM::Cookery::SourceHandler::Template
8
+ CHECKSUM = false
9
+ NAME = :hg
10
+
11
+ def fetch
12
+ if local_path.exist?
13
+ Dir.chdir(local_path) do
14
+ hg('pull')
15
+ hg('update')
16
+ end
17
+ else
18
+ Dir.chdir(cachedir) do
19
+ hg('clone', url, local_path)
20
+ end
21
+ end
22
+
23
+ local_path
24
+ end
25
+
26
+ def extract
27
+ src = (builddir/local_path.basename('.hg').to_s).to_s
28
+
29
+ Dir.chdir(local_path) do
30
+ if options[:rev]
31
+ src << "-#{options[:rev]}"
32
+ hg('archive', '-y', '-r', options[:rev], '-t', 'files', src)
33
+ else
34
+ src << '-tip'
35
+ hg('archive', '-y', '-t', 'files', src)
36
+ end
37
+ end
38
+
39
+ src
40
+ end
41
+
42
+ private
43
+ def hg(command, *args)
44
+ Log.debug "hg #{command} #{args.join(' ')}"
45
+ safesystem('hg', command, *args)
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -1,5 +1,5 @@
1
1
  module FPM
2
2
  module Cookery
3
- VERSION = '0.6.0'
3
+ VERSION = '0.7.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm-cookery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-19 00:00:00.000000000 Z
12
+ date: 2011-11-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fpm
16
- requirement: &82971890 !ruby/object:Gem::Requirement
16
+ requirement: &81673760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *82971890
24
+ version_requirements: *81673760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: minitest
27
- requirement: &82971550 !ruby/object:Gem::Requirement
27
+ requirement: &81673550 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *82971550
35
+ version_requirements: *81673550
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &82970380 !ruby/object:Gem::Requirement
38
+ requirement: &81075460 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *82970380
46
+ version_requirements: *81075460
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: fpm
49
- requirement: &82969850 !ruby/object:Gem::Requirement
49
+ requirement: &81075040 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *82969850
57
+ version_requirements: *81075040
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: facter
60
- requirement: &82968920 !ruby/object:Gem::Requirement
60
+ requirement: &81074500 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *82968920
68
+ version_requirements: *81074500
69
69
  description: A tool for building software packages with fpm.
70
70
  email:
71
71
  - bernd@tuneafish.de
@@ -98,6 +98,7 @@ files:
98
98
  - lib/fpm/cookery/source_handler.rb
99
99
  - lib/fpm/cookery/source_handler/curl.rb
100
100
  - lib/fpm/cookery/source_handler/git.rb
101
+ - lib/fpm/cookery/source_handler/hg.rb
101
102
  - lib/fpm/cookery/source_handler/svn.rb
102
103
  - lib/fpm/cookery/source_handler/template.rb
103
104
  - lib/fpm/cookery/source_integrity_check.rb