Return-Path: Delivered-To: apmail-buildr-commits-archive@www.apache.org Received: (qmail 20931 invoked from network); 24 Aug 2010 05:17:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Aug 2010 05:17:38 -0000 Received: (qmail 44660 invoked by uid 500); 24 Aug 2010 05:17:38 -0000 Delivered-To: apmail-buildr-commits-archive@buildr.apache.org Received: (qmail 44625 invoked by uid 500); 24 Aug 2010 05:17:37 -0000 Mailing-List: contact commits-help@buildr.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@buildr.apache.org Delivered-To: mailing list commits@buildr.apache.org Received: (qmail 44618 invoked by uid 99); 24 Aug 2010 05:17:36 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Aug 2010 05:17:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Aug 2010 05:17:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B0992238890A; Tue, 24 Aug 2010 05:16:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r988390 - in /buildr/trunk: CHANGELOG lib/buildr/core/transports.rb spec/core/transport_spec.rb Date: Tue, 24 Aug 2010 05:16:00 -0000 To: commits@buildr.apache.org From: toulmean@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100824051600.B0992238890A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: toulmean Date: Tue Aug 24 05:16:00 2010 New Revision: 988390 URL: http://svn.apache.org/viewvc?rev=988390&view=rev Log: BUILDR-143 Upload to a file:// path needs ability to specify permissions (Joel Muzzerall) Modified: buildr/trunk/CHANGELOG buildr/trunk/lib/buildr/core/transports.rb buildr/trunk/spec/core/transport_spec.rb Modified: buildr/trunk/CHANGELOG URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=988390&r1=988389&r2=988390&view=diff ============================================================================== --- buildr/trunk/CHANGELOG (original) +++ buildr/trunk/CHANGELOG Tue Aug 24 05:16:00 2010 @@ -6,6 +6,7 @@ * Change: BUILDR-484 Upgrade to Scala 2.8.0 (final) and associated dependencies (ScalaCheck 1.7, ScalaTest 1.2, Specs 1.6.5) * Change: BUILDR-487 package :sources should default to using .jar extension (instead of .zip) +* Fixed: BUILDR-143 Upload to a file:// path needs ability to specify permissions (Joel Muzzerall) * Fixed: BUILDR-144 Filter does not preserve file permissions * Fixed: BUILDR-163 cobertura-check * Fixed: BUILDR-203 Compiler guessing very inefficient Modified: buildr/trunk/lib/buildr/core/transports.rb URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/transports.rb?rev=988390&r1=988389&r2=988390&view=diff ============================================================================== --- buildr/trunk/lib/buildr/core/transports.rb (original) +++ buildr/trunk/lib/buildr/core/transports.rb Tue Aug 24 05:16:00 2010 @@ -484,6 +484,13 @@ module URI COMPONENT = [ :host, :path ].freeze + def upload(source, options = nil) + super + if File === source then + File.chmod(source.stat.mode, real_path) + end + end + def initialize(*args) super # file:something (opaque) becomes file:///something Modified: buildr/trunk/spec/core/transport_spec.rb URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/transport_spec.rb?rev=988390&r1=988389&r2=988390&view=diff ============================================================================== --- buildr/trunk/spec/core/transport_spec.rb (original) +++ buildr/trunk/spec/core/transport_spec.rb Tue Aug 24 05:16:00 2010 @@ -63,6 +63,13 @@ describe URI, '#upload' do @uri = URI(URI.escape("file://#{File.expand_path(@target)}")) end + it 'should preserve file permissions if uploading to a file' do + File.chmod(0666, @source) + s = File.stat(@source).mode + @uri.upload @source + File.stat(@target).mode.should eql(s) + end + it 'should upload file if found' do @uri.upload @source file(@target).should contain(@content)