<commit_before>require 'formula'

class Pig < Formula
  url 'http://apache.dataphone.se/hadoop/pig/pig-0.5.0/pig-0.5.0.tar.gz'
  homepage 'http://hadoop.apache.org/pig/'
  md5 '9687f3a8c6042938bf8b1b225e6d4b40'

  def patches
    DATA
  end

  def install
    rm_f Dir["bin/*.bat"]
    prefix.install ['bin', 'lib/hadoop20.jar', "pig-#{version}-core.jar"]
  end
end

# There's something weird with Pig's launch script, it doesn't find the correct
# path. This patch removes a test that should fail, but doesn't.
__END__
diff --git a/bin/pig b/bin/pig
index 97fc649..79056cf 100644
--- a/bin/pig
+++ b/bin/pig
@@ -56,11 +56,7 @@ this="$0"
 while [ -h "$this" ]; do
     ls=`ls -ld "$this"`
     link=`expr "$ls" : '.*-> \(.*\)$'`
-    if expr "$link" : '.*/.*' > /dev/null; then
-        this="$link"
-    else
-        this=`dirname "$this"`/"$link"
-    fi
+    this=`dirname "$this"`/"$link"
 done
 
 # convert relative path to absolute path<commit_msg>pig 0.8.1<commit_after>require 'formula'

class Pig < Formula
  url 'ftp://apache.mirrors.pair.com//pig/pig-0.8.1/pig-0.8.1.tar.gz'
  homepage 'http://hadoop.apache.org/pig/'
  md5 'd3325f5816b68fb3c1d405095fcf5c7a'

  def patches
    DATA
  end

  def install
    rm_f Dir["bin/*.bat"]
    prefix.install ['bin', "pig-#{version}-core.jar"]
  end
end

# There's something weird with Pig's launch script, it doesn't find the correct
# path. This patch removes a test that should fail, but doesn't.
__END__
diff --git a/bin/pig b/bin/pig
index 97fc649..79056cf 100644
--- a/bin/pig
+++ b/bin/pig
@@ -56,11 +56,7 @@ this="$0"
 while [ -h "$this" ]; do
     ls=`ls -ld "$this"`
     link=`expr "$ls" : '.*-> \(.*\)$'`
-    if expr "$link" : '.*/.*' > /dev/null; then
-        this="$link"
-    else
-        this=`dirname "$this"`/"$link"
-    fi
+    this=`dirname "$this"`/"$link"
 done

 # convert relative path to absolute path
{'fraction_non_alphanumeric': 0.19234856535600425, 'fraction_numerical': 0.05791710945802338, 'mean_word_length': 2.788732394366197, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '600797', 'n_tokens_mistral': 821, 'n_tokens_neox': 739, 'n_words': 177}