From 3f155e4d4afbdaeb0a82bc3811ed00bc5685f65b Mon Sep 17 00:00:00 2001 From: iwata Date: Sat, 22 Oct 2011 21:23:21 +0900 Subject: [PATCH] remove --gnu-getopt --- README.mdown | 16 ++++++---------- git-now.rb | 36 +++++++++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/README.mdown b/README.mdown index 8f47f36..a851bdd 100644 --- a/README.mdown +++ b/README.mdown @@ -37,31 +37,27 @@ If you're on a Mac and use [homebrew](http://github.com/mxcl/homebrew), it's sim $ brew install https://github.com/iwata/git-now/raw/master/git-now.rb #### install options - * use ``gnu-getopt`` - - $ brew install --gnu-getopt https://github.com/iwata/git-now/raw/master/git-now.rb - - * copy zsh completion function for zsh users + * ``--zsh-completion``
copy zsh completion function for zsh users $ brew install --zsh-completion https://github.com/iwata/git-now/raw/master/git-now.rb -Show details + Show details - $ brew options https://github.com/iwata/git-now/raw/master/git-now.rb + $ brew options https://github.com/iwata/git-now/raw/master/git-now.rb ### Manual installation If you prefer a manual installation, please use the following instructions: - $ git clone --recursive git://github.com/iwata/git-now.git + $ git clone --recursive git://github.com/iwata/git-now.git Then, you can install `git-now`, using: - $ sudo make install + $ sudo make install By default, git-now will be installed in /usr/local. To change the prefix where git-now will be installed, simply specify it explicitly, using: - $ sudo make prefix=/opt/local install + $ sudo make prefix=/opt/local install Or simply point your `PATH` environment variable to your git-now checkout directory. diff --git a/git-now.rb b/git-now.rb index f4e04c5..7263a66 100644 --- a/git-now.rb +++ b/git-now.rb @@ -1,31 +1,30 @@ require 'formula' class GitNow < Formula - url 'https://github.com/iwata/git-now.git', :tag => 'v0.1.0.8.1' - version '0.1.0.8.1' + url 'https://github.com/iwata/git-now.git', :tag => 'v0.1.0.9' + version '0.1.0.9' head 'https://github.com/iwata/git-now.git', :branch => 'develop' homepage 'https://github.com/iwata/git-now' def options [ - ['--gnu-getopt', "Link a gnu-getopt formula"], ['--zsh-completion', "copy zsh completion function file to #{share}/zsh/functions"] ] end - # for longopt - if ARGV.include? '--gnu-getopt' - depends_on 'gnu-getopt' + def patches + DATA end + + # for longopt + depends_on 'gnu-getopt' + if ARGV.include? '--zsh-completion' depends_on 'zsh' end def install system "make", "prefix=#{prefix}", "install" - if ARGV.include? '--gnu-getopt' - system "brew ln gnu-getopt" - end if ARGV.include? '--zsh-completion' zsh_functions_d = share + 'zsh/functions' zsh_functions_d.install "etc/_git-now" @@ -33,3 +32,22 @@ class GitNow < Formula end end + +#This patch makes sure GNUtools are used on OSX. +#gnu-getopt is keg-only hence the backtick expansion. +#These aliases only exist for the duration of git-now, +#inside the git-now shells. Normal operation of bash is +#unaffected - getopt will still find the version supplied +#by OSX in other shells, for example. +__END__ +--- a/git-now ++++ b/git-now +@@ -1,5 +1,7 @@ + #!/bin/sh + ++alias getopt='`brew --prefix gnu-getopt`/bin/getopt' ++ + # enable debug mode + if [ "$DEBUG" = "yes" ]; then + set -x +