You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by "Dominic Graefen (JIRA)" <ji...@apache.org> on 2011/02/07 12:53:30 UTC

[jira] Commented: (BUILDR-568) Buildr::download seems to be broken on windows

    [ https://issues.apache.org/jira/browse/BUILDR-568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991344#comment-12991344 ] 

Dominic Graefen commented on BUILDR-568:
----------------------------------------

I can fix the issue by setting the binmode on the file:

if Buildr::Util.win_os?
            unless File.exists? @sdk_zip.to_s
              FileUtils.mkdir_p File.dirname(@sdk_zip.to_s) unless File.directory? File.dirname(@sdk_zip.to_s)
              File.open @sdk_zip.to_s, 'w' do |file|
                file.binmode()
                URI.read(@url, {:progress=>true}) { |chunk| file.write chunk }
              end
            end
          else
            Buildr.artifact(@spec).from(Buildr.download(@url)).invoke unless File.exists? @sdk_zip.to_s
          end

> Buildr::download seems to be broken on windows
> ----------------------------------------------
>
>                 Key: BUILDR-568
>                 URL: https://issues.apache.org/jira/browse/BUILDR-568
>             Project: Buildr
>          Issue Type: Bug
>          Components: Core features
>    Affects Versions: 1.4.4
>         Environment: Windows XP SP3 running inside a VM on Mac OS X
> buildr 1.4.4 running with rjb
>            Reporter: Dominic Graefen
>              Labels: buildr, core, download, windows
>
> In my buildr-extension I am downloading an artifact from an url
> Buildr::artifact("com.adobe.alchemy:toolkit:zip:#{toolkit_version}").from(Buildr::download(toolkit_url))
> which works fine on Mac OS X, but all the zip files I am downloading on Windows are corrupt.
> WinRAR says: "Unexpected end of Archive"

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira