knife-changelog 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/knife/changelog/changelog.rb +7 -7
- data/lib/knife/changelog/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edbbf5411d82753b8ce5b135c1a38492c6b22266
|
4
|
+
data.tar.gz: 26c3fd802919a151dcace2082ed0970bcc5519ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18e3235065d4e4e096ceb2463111de89cb0a552c3c7bde36a739afd00b6c7215a7f517166bc19b899c6a73d29eeee47366223c5620c8f7b9dc9a86f8aa3dac84
|
7
|
+
data.tar.gz: c87d9b670ab7f7cefbb4a24654df02f7848896d5028d023c29607fd1f48681cbc350287f3e3d1193dcc9a2ec244ec4dffb3f0f291977f928e2632866ce7ca907
|
@@ -63,7 +63,7 @@ class KnifeChangelog
|
|
63
63
|
when NilClass
|
64
64
|
handle_source name, ck_dep(name)
|
65
65
|
when Berkshelf::GitLocation
|
66
|
-
handle_git loc
|
66
|
+
handle_git name, loc
|
67
67
|
when Berkshelf::PathLocation
|
68
68
|
Chef::Log.debug "path location are always at the last version"
|
69
69
|
""
|
@@ -101,7 +101,7 @@ class KnifeChangelog
|
|
101
101
|
:revision => guess_version_for(name),
|
102
102
|
}
|
103
103
|
location = Berkshelf::GitLocation.new dep, options
|
104
|
-
handle_git(location)
|
104
|
+
handle_git(name, location)
|
105
105
|
else
|
106
106
|
fail "External url #{url} points to unusable location!"
|
107
107
|
end
|
@@ -114,11 +114,11 @@ class KnifeChangelog
|
|
114
114
|
not revlist.error?
|
115
115
|
end
|
116
116
|
|
117
|
-
def detect_cur_revision(dir, rev)
|
117
|
+
def detect_cur_revision(name, dir, rev)
|
118
118
|
unless revision_exists?(dir, rev)
|
119
119
|
prefixed_rev = 'v' + rev
|
120
120
|
return prefixed_rev if revision_exists?(dir, prefixed_rev)
|
121
|
-
fail "#{rev} is not a valid revision"
|
121
|
+
fail "#{rev} is not a valid revision (#{name})"
|
122
122
|
end
|
123
123
|
rev
|
124
124
|
end
|
@@ -133,15 +133,15 @@ class KnifeChangelog
|
|
133
133
|
subm_revision.error!
|
134
134
|
revision = subm_revision.stdout.strip.split(' ').first
|
135
135
|
loc = Berkshelf::Location.init(nil, {git: url,revision: revision})
|
136
|
-
handle_git(loc)
|
136
|
+
handle_git(name, loc)
|
137
137
|
end
|
138
138
|
|
139
|
-
def handle_git(location)
|
139
|
+
def handle_git(name, location)
|
140
140
|
tmp_dir = shallow_clone(@tmp_prefix,location.uri)
|
141
141
|
|
142
142
|
rev_parse = location.instance_variable_get(:@rev_parse)
|
143
143
|
cur_rev = location.revision.rstrip
|
144
|
-
cur_rev = detect_cur_revision(tmp_dir, cur_rev)
|
144
|
+
cur_rev = detect_cur_revision(name, tmp_dir, cur_rev)
|
145
145
|
ls_tree = Mixlib::ShellOut.new("git ls-tree -r #{rev_parse}", :cwd => tmp_dir)
|
146
146
|
ls_tree.run_command
|
147
147
|
changelog = ls_tree.stdout.lines.find { |line| line =~ /\s(changelog.*$)/i }
|