File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ module Shards
91
91
92
92
private def outdated_lockfile? (packages )
93
93
a = packages.map { |x | {x.name, x.version, x.commit} }
94
- b = locks.map { |x | {x.name, x[" version" ], x[" commit" ]?} }
94
+ b = locks.map { |x | {x.name, x[" version" ]? , x[" commit" ]?} }
95
95
a != b
96
96
end
97
97
end
Original file line number Diff line number Diff line change @@ -17,6 +17,15 @@ module Shards
17
17
18
18
def prepare (development = true ) : Nil
19
19
@graph .add(@spec , development)
20
+
21
+ if locks = @locks
22
+ locks.each do |lock |
23
+ if lock[" commit" ]?
24
+ @graph .add(lock)
25
+ end
26
+ end
27
+ end
28
+
20
29
build_cnf_clauses(development)
21
30
end
22
31
@@ -76,7 +85,7 @@ module Shards
76
85
77
86
if plus = str.index(" +git.commit." )
78
87
version = str[(colon + 1 )...plus]
79
- commit = str[(plus + 13 )..- 1 ]
88
+ commit = str[(plus + 12 )..- 1 ]
80
89
else
81
90
version = str[(colon + 1 )..- 1 ]
82
91
commit = nil
@@ -192,7 +201,7 @@ module Shards
192
201
if locked = @locks .try(& .find { |d | d.name == pkg.name })
193
202
# determine position of locked version to use it as reference:
194
203
pkg.each_version do |version , index |
195
- if version == locked.version
204
+ if version == locked.version || ((commit = locked[ " commit " ]?) && version.ends_with?( " +git.commit. #{ commit } " ))
196
205
position = index
197
206
break
198
207
end
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ module Shards
50
50
spec.development_dependencies.each { |dependency | add(dependency) } if development
51
51
end
52
52
53
- private def add (dependency : Dependency )
53
+ def add (dependency : Dependency )
54
54
pkg = @packages [dependency.name] ||= Pkg .new(dependency)
55
55
resolver = pkg.resolver
56
56
You can’t perform that action at this time.
0 commit comments