2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-18 21:06:03 +00:00
|
|
|
|
2011-02-15 12:17:32 +00:00
|
|
|
class Bash < Formula
|
2010-01-20 02:23:09 +00:00
|
|
|
homepage 'http://www.gnu.org/software/bash/'
|
2011-09-12 16:31:30 +00:00
|
|
|
url 'http://ftpmirror.gnu.org/bash/bash-4.2.tar.gz'
|
2011-11-30 18:56:07 +00:00
|
|
|
mirror 'http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz'
|
2011-03-23 21:05:12 +00:00
|
|
|
sha256 'a27a1179ec9c0830c65c6aa5d7dab60f7ce1a2a608618570f96bfa72e95ab3d8'
|
2013-03-09 01:45:51 +00:00
|
|
|
version '4.2.45'
|
2009-09-18 21:06:03 +00:00
|
|
|
|
2013-08-22 16:59:40 +00:00
|
|
|
head 'git://git.savannah.gnu.org/bash.git'
|
|
|
|
|
2012-11-11 03:12:26 +00:00
|
|
|
depends_on 'readline'
|
2009-09-18 21:06:03 +00:00
|
|
|
|
2012-11-03 18:26:57 +00:00
|
|
|
# Vendor the patches. The mirrors are unreliable for getting the patches,
|
|
|
|
# and the more patches there are, the more unreliable they get. Upstream
|
|
|
|
# patches can be found in: http://ftpmirror.gnu.org/bash/bash-4.2-patches
|
|
|
|
def patches
|
2013-11-15 02:43:37 +00:00
|
|
|
# http://article.gmane.org/gmane.comp.shells.bash.bugs/20242
|
|
|
|
p = { :p1 => DATA }
|
|
|
|
if build.stable?
|
|
|
|
p[:p0] = "https://gist.github.com/jacknagel/4008180/raw/1509a257060aa94e5349250306cce9eb884c837d/bash-4.2-001-045.patch"
|
|
|
|
end
|
|
|
|
p
|
|
|
|
end
|
2010-01-20 02:23:09 +00:00
|
|
|
|
2011-05-07 19:22:57 +00:00
|
|
|
def install
|
2013-10-12 22:18:33 +00:00
|
|
|
# When built with SSH_SOURCE_BASHRC, bash will source ~/.bashrc when
|
|
|
|
# it's non-interactively from sshd. This allows the user to set
|
|
|
|
# environment variables prior to running the command (e.g. PATH). The
|
|
|
|
# /bin/bash that ships with Mac OS X defines this, and without it, some
|
|
|
|
# things (e.g. git+ssh) will break if the user sets their default shell to
|
|
|
|
# Homebrew's bash instead of /bin/bash.
|
|
|
|
ENV.append_to_cflags "-DSSH_SOURCE_BASHRC"
|
|
|
|
|
2011-05-07 19:22:57 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}", "--with-installed-readline"
|
2009-09-18 21:06:03 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2012-01-20 12:46:43 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
In order to use this build of bash as your login shell,
|
|
|
|
it must be added to /etc/shells.
|
|
|
|
EOS
|
|
|
|
end
|
2014-02-08 18:46:17 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
output = `#{bin}/bash -c "echo hello"`.strip
|
|
|
|
assert_equal "hello", output
|
|
|
|
assert_equal 0, $?.exitstatus
|
|
|
|
end
|
2009-09-18 21:06:03 +00:00
|
|
|
end
|
2013-11-15 02:43:37 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/parse.y b/parse.y
|
2013-11-30 16:09:05 +00:00
|
|
|
index b5c94e7..085e5e4 100644
|
2013-11-15 02:43:37 +00:00
|
|
|
--- a/parse.y
|
|
|
|
+++ b/parse.y
|
2013-11-30 16:09:05 +00:00
|
|
|
@@ -5260,9 +5260,16 @@ decode_prompt_string (string)
|
|
|
|
#undef ROOT_PATH
|
|
|
|
#undef DOUBLE_SLASH_ROOT
|
2013-11-15 02:43:37 +00:00
|
|
|
else
|
2013-11-30 16:09:05 +00:00
|
|
|
+ {
|
2013-11-15 02:43:37 +00:00
|
|
|
/* polite_directory_format is guaranteed to return a string
|
|
|
|
no longer than PATH_MAX - 1 characters. */
|
|
|
|
- strcpy (t_string, polite_directory_format (t_string));
|
|
|
|
+ /* polite_directory_format might simply return the pointer to t_string
|
|
|
|
+ strcpy(3) tells dst and src may not overlap, OS X 10.9 asserts this and
|
|
|
|
+ triggers an abort trap if that's the case */
|
|
|
|
+ temp = polite_directory_format (t_string);
|
|
|
|
+ if (temp != t_string)
|
|
|
|
+ strcpy (t_string, temp);
|
2013-11-30 16:09:05 +00:00
|
|
|
+ }
|
2013-11-15 02:43:37 +00:00
|
|
|
|
|
|
|
temp = trim_pathname (t_string, PATH_MAX - 1);
|
|
|
|
/* If we're going to be expanding the prompt string later,
|