Hey there.  I am just getting started with using Capistrano for our
first Rails app ever.  We are developing on Windows boxes on a company
network.  We are deploying to a Virtual Private Server running linux,
Fedora Core 7.  We are also using Subversion.  I don't want to poke
holes through our firewall to give access to svnserve(and I couldn't
figure out how).  So its very necessary for us to use the :copy
option.  I was running into a problem with a command that was
incorrectly switching slashes.

The repository lives at svn://192.xxx.xxx.xxx:xxx/.  When trying to
get a local copy of the repository, it would execute this command: svn
checkout -q --username xxxxx --password --no-auth-cache -r2005 svn:\
\192.xxx.xxx.xxx:xxxx\ c:\Docume~1\tilendor\locals~1\temp
\20090113204628

The script blindly flip slashes on the URL the same as the file path
and fail, because the svn URL wasn't valid.

I made a patch which worked for me.
In capistrano\recipes\deploy\stategy\base.rd on line 50 is the method:
       def system(*args)
            cmd = args.join(' ')
            if RUBY_PLATFORM =~ /win32/
              cmd.gsub!('/','\\') # Replace / with \\
              cmd.gsub!(/^cd /,'cd /D ') # Replace cd with cd /D
              cmd.gsub!(/&& cd /,'&& cd /D ') # Replace cd with cd /D
              logger.trace "executing locally: #{cmd}"
              super(cmd)
            else
              logger.trace "executing locally: #{cmd}"
              super
            end
          end

The problem line is cmd.gsub!('/','\\') #replace / with \\ that
blindly alters the URL and the file path.

I made the following change:

            if RUBY_PLATFORM =~ /win32/
                parts = cmd.split(' ')
                parts.collect! do |part|
                        part.gsub!('/','\\') unless /\/\// =~ part # if the
string has // is probably a url, don't change.
                        part
                    end
                cmd = parts.join(' ')
              cmd.gsub!(/^cd /,'cd /D ') # Replace cd with cd /D
              cmd.gsub!(/&& cd /,'&& cd /D ') # Replace cd with cd /D
              logger.trace "executing locally: #{cmd}"
              super(cmd)

I be there are other windows users that face this issue.  What would
it take to get this included in a future version of Capistrano?

Thanks,
~Tilendor

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to 
capistrano-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to