From 3b8c98040c2f579186edce30fe1453e0dc8a71c5 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Tue, 29 Nov 2011 10:17:38 +0100 Subject: [PATCH] download_strategy.ry: Improve Bazaar efficiency Bazaar download strategy tried to re-download everything on "export" as a checkout is used. See: https://answers.launchpad.net/bzr/+question/180269 https://bugs.launchpad.net/bzr/+bug/897511 Related to issue Homebrew/homebrew#8774. Closes Homebrew/homebrew#8863. Signed-off-by: Charlie Sharpsteen --- Library/Homebrew/download_strategy.rb | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index a3996909e1..58221c28f2 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -498,17 +498,22 @@ class BazaarDownloadStrategy < AbstractDownloadStrategy end def stage - dst=Dir.getwd - Dir.chdir @clone do - if @spec and @ref - ohai "Checking out #{@spec} #{@ref}" - Dir.chdir @clone do - safe_system 'bzr', 'export', '-r', @ref, dst - end - else - safe_system 'bzr', 'export', dst - end - end + # FIXME: The export command doesn't work on checkouts + # See https://bugs.launchpad.net/bzr/+bug/897511 + FileUtils.cp_r Dir[@clone+"{.}"], Dir.pwd + FileUtils.rm_r Dir[Dir.pwd+"/.bzr"] + + #dst=Dir.getwd + #Dir.chdir @clone do + # if @spec and @ref + # ohai "Checking out #{@spec} #{@ref}" + # Dir.chdir @clone do + # safe_system 'bzr', 'export', '-r', @ref, dst + # end + # else + # safe_system 'bzr', 'export', dst + # end + #end end end