From 95225c89cef3dbe90e676905f8f3accd9ab314a1 Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 13 Jan 2013 20:26:04 -0800 Subject: patch supply_drop so rsync can accept --include and arbitrary flags. --- vendor/supply_drop/lib/supply_drop/rsync.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'vendor/supply_drop') diff --git a/vendor/supply_drop/lib/supply_drop/rsync.rb b/vendor/supply_drop/lib/supply_drop/rsync.rb index 6d561ea..732a719 100644 --- a/vendor/supply_drop/lib/supply_drop/rsync.rb +++ b/vendor/supply_drop/lib/supply_drop/rsync.rb @@ -4,8 +4,10 @@ module SupplyDrop def command(from, to, options={}) flags = ['-az'] flags << '--delete' if options[:delete] + flags << includes(options[:includes]) if options.has_key?(:includes) flags << excludes(options[:excludes]) if options.has_key?(:excludes) flags << ssh_options(options[:ssh]) if options.has_key?(:ssh) + flags << options[:flags] if options.has_key?(:flags) "rsync #{flags.compact.join(' ')} #{from} #{to}" end @@ -16,7 +18,11 @@ module SupplyDrop end def excludes(patterns) - [patterns].flatten.map { |p| "--exclude=#{p}" } + [patterns].flatten.map { |p| "--exclude='#{p}'" } + end + + def includes(patterns) + [patterns].flatten.map { |p| "--include='#{p}'" } end def ssh_options(options) -- cgit v1.2.3