aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorelliottcable2009-12-10 22:19:35 -0800
committerMax Howell2010-01-13 15:09:28 +0000
commitfd104120a97b38649bc336c4feb80701e09ad0ad (patch)
tree38ba2d6d7d4fa9b2fdf59cff061bc1ec3b77d0d5 /Library
parenta9f53c5ad4f3c77aac2670aa91517d5c91b23ede (diff)
downloadhomebrew-fd104120a97b38649bc336c4feb80701e09ad0ad.tar.bz2
The Redis formula no longer dabbles around outside the HOMEBREW_PREFIX.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/redis.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/Library/Formula/redis.rb b/Library/Formula/redis.rb
index 1b0dd704c..97028f2fa 100644
--- a/Library/Formula/redis.rb
+++ b/Library/Formula/redis.rb
@@ -11,17 +11,21 @@ class Redis <Formula
bin.install %w( redis-benchmark redis-cli redis-server )
+ %w( run db/redis log ).each do |path|
+ FileUtils.mkdir_p(var+path) unless File.directory?(var+path)
+ end
+
# set up the conf file
(etc+'redis.conf').write <<-REDIS_CONF
# Redis configuration file example
# By default Redis does not run as a daemon. Use 'yes' if you need it.
-# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
+# Note that Redis will write a pid file in #{var}/run/redis.pid when daemonized.
daemonize no
-# When run as a daemon, Redis write a pid file in /var/run/redis.pid by default.
+# When run as a daemon, Redis write a pid file in #{var}/run/redis.pid by default.
# You can specify a custom pid file location here.
-pidfile /var/run/redis.pid
+pidfile #{var}/run/redis.pid
# Accept connections on the specified port, default is 6379
port 6379
@@ -54,7 +58,7 @@ dbfilename dump.rdb
# For default save/load DB in/from the working directory
# Note that you must specify a directory not a file name.
-dir /var/db/redis/
+dir #{var}/db/redis/
# Set server verbosity to 'debug'
# it can be one of:
@@ -66,7 +70,7 @@ loglevel notice
# Specify the log file name. Also 'stdout' can be used to force
# the demon to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
-logfile /var/log/redis.log
+logfile #{var}/log/redis.log
# Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where
@@ -146,11 +150,6 @@ glueoutputbuf yes
shareobjects no
shareobjectspoolsize 1024
REDIS_CONF
-
- # FIXME: You get “* Can't chdir to '/var/db/redis/': No such file or
- # directory” when running with this conf. We need to either make
- # that directory, or (better yet) stop breaking the rules, and work
- # inside the Homebrew prefix.
end
def caveats