perryn escribió:
> Hello,
>
> So I'm trying to deploy to a Solaris box using deploy_via :copy
>
> It doesn't work, because tar on the target box doesn't understand the
> z option, so I need to use gtar instead.
>
> I aliased tar to gtar in my .profile, but it seems this is not getting
> run by capistrano. I know that this was a problem prior to 2.1, but I
> am using 2.2.0..
>
> I will be pathetically grateful to anyone who can suggest a solution.
> >
>
>
Hi Perryn,
You can override the methods that compress and decompress, and change
the binary used.
The code (not tested) can be something like this:
module Capistrano
module Deploy
module Strategy
class Copy < Base
# Returns the command necessary to compress the given directory
# into the given file. The command is returned as an array, where
# the first element is the utility to be used to perform the
compression.
def compress(directory, file)
case compression
when :gzip, :gz then ["gtar", "czf", file, directory]
when :bzip2, :bz2 then ["gtar", "cjf", file, directory]
when :zip then ["zip", "-qr", file, directory]
else raise ArgumentError, "invalid compression type
#{compression.inspect}"
end
end
# Returns the command necessary to decompress the given file,
# relative to the current working directory. It must also
# preserve the directory structure in the file. The command is
returned
# as an array, where the first element is the utility to be
used to
# perform the decompression.
def decompress(file)
case compression
when :gzip, :gz then ["gtar", "xzf", file]
when :bzip2, :bz2 then ["gtar", "xjf", file]
when :zip then ["unzip", "-q", file]
else raise ArgumentError, "invalid compression type
#{compression.inspect}"
end
end
end
end
end
end
NOTE: I don't know "gtar" options. In this case for compress is using
"czf"(for gz files) and "cjf"(for bz2 files), and decompress "xzf"(for
gz files) and "xjf"(for bz2 files). I thought that you get the idea.
Regards
--
Rafael Garcia Ortega
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---
begin:vcard
fn;quoted-printable:Rafael Garc=C3=ADa Ortega
n;quoted-printable:Garc=C3=ADa Ortega;Rafael
org:ASPgems S.L.
email;internet:[EMAIL PROTECTED]
tel;work:692686533
x-mozilla-html:FALSE
url:http://www.aspgems.com
version:2.1
end:vcard