1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Set LC_ALL=C before querying the revision, to make sure the output is in a predictable locale and can be parsed predictably

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7135 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2007-06-27 03:12:44 +00:00
parent 892b5481a6
commit 67595be1bf
2 changed files with 12 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Set LC_ALL=C before querying the revision, to make sure the output is in a predictable locale and can be parsed predictably [via Leandro Nunes dos Santos]
* Add :copy_remote_dir variable for the :copy strategy, to indicate where the archive should be copied to on the remote servers [Jamis Buck]
* Make the awk use in the dependencies code work with POSIX awk [mcornick]

View file

@ -28,7 +28,7 @@ set(:revision) { source.head } unless exists?(:revision)
# =========================================================================
set(:source) { Capistrano::Deploy::SCM.new(scm, self) }
set(:real_revision) { source.local.query_revision(revision) { |cmd| `#{cmd}` } }
set(:real_revision) { source.local.query_revision(revision) { |cmd| with_env("LC_ALL", "C") { `#{cmd}` } } }
set(:strategy) { Capistrano::Deploy::Strategy.new(deploy_via, self) }
@ -69,6 +69,15 @@ def depend(location, type, *args)
set :dependencies, deps
end
# Temporarily sets an environment variable, yields to a block, and restores
# the value when it is done.
def with_env(name, value)
saved, ENV[name] = ENV[name], value
yield
ensure
ENV[name] = saved
end
# =========================================================================
# These are the tasks that are available to help with deploying web apps,
# and specifically, Rails applications. You can have cap give you a summary