Skip to content

Commit 1c43783

Browse files
committed
Problem: building Omnigres packages
Problem getting sources without infinite recursion Solution: use a working method This is still very difficult to understand, but at least it works for now. The idea here is to only get sources for the previous version but no further.
1 parent d44861d commit 1c43783

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/omnigres/package.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,23 @@ def requires
208208
end
209209
end
210210

211-
def original_sources
212-
method(:sources).super_method.call
211+
def dont_fetch_previous
212+
@dont_fetch_previous = true
213+
self
213214
end
214215

215216
def sources
216217
return @srcs if @srcs
217218

218-
@srcs = original_sources
219+
@srcs = super
220+
return @srcs if @dont_fetch_previous
219221
unless contains_vendorized_deps?
220222
@srcs.push(deps_tar_gz)
221223
end
222224
if previous_version && !previous_version.broken?
223225
begin
224226
puts "Fetching previous version #{previous_version.version} to be able to generate migrations"
225-
@srcs.push(*previous_version.original_sources) # archive
227+
@srcs.push(*previous_version.dont_fetch_previous.sources) # archive
226228
@srcs.push(previous_version.deps_tar_gz("deps-prev")) unless previous_version.contains_vendorized_deps?
227229
rescue UnsupportedVersion
228230
# ignore this one, just don't build an upgrade

0 commit comments

Comments
 (0)