lib/autobuild/importer.rb in autobuild-0.6.5 vs lib/autobuild/importer.rb in autobuild-0.6.6

- old
+ new

@@ -9,10 +9,14 @@ # [:patches] a list of patch to apply after import # # More options are specific to each importer type. def initialize(options); @options = options end + def patches + @options[:patches] ||= [] + end + # Performs the import of +package+ def import(package) srcdir = package.srcdir if File.directory?(srcdir) if Autobuild.do_update @@ -69,13 +73,13 @@ begin while p = cur_patches.pop unapply(package, p) end - @options[:patch].to_a.each { |p| + patches.to_a.each do |p| apply(package, p) cur_patches << p - } + end ensure File.open(patchlist(package), 'w+') do |f| f.write(cur_patches.join("\n")) end end