Revision
1522
Author
eloy.de.enige@gmail.com
Date
2009-05-03 06:26:27 -0700 (Sun, 03 May 2009)

Log Message

Added a rake task to apply all upstream patches

Modified Paths

Diff

Modified: MacRuby/branches/experimental/rakelib/upstream_git_repo_tasks.rb (1521 => 1522)


--- MacRuby/branches/experimental/rakelib/upstream_git_repo_tasks.rb	2009-05-03 13:02:58 UTC (rev 1521)
+++ MacRuby/branches/experimental/rakelib/upstream_git_repo_tasks.rb	2009-05-03 13:26:27 UTC (rev 1522)
@@ -110,6 +110,19 @@
             end
           end
 
+          namespace :patches do
+            desc "Applies all patches in #{@local_dir}/upstream_patches"
+            task :apply do
+              Dir.chdir(@local_dir) do
+                patches = Dir.glob("upstream_patches/*.patch")
+                patches.sort_by { |name| File.basename(name)[0,4] }.each do |patch|
+                  puts "\nApplying patch: #{File.basename(patch)}"
+                  sh "/usr/bin/patch -p1 < #{patch}"
+                end
+              end
+            end
+          end
+
           desc "Remove the `#{@upstream_options[:branch]}' branch and switch to the `master' branch (cleans all untracked files!)"
           task :remove do
             puts "\nRemoving the `#{@upstream_options[:branch]}' branch and all untracked files!"