Ticket #23012: patch-bin-lein.diff

File patch-bin-lein.diff, 2.4 KB (added by ian.eure@…, 15 years ago)

Updated patch-bin-lein.diff

  • bin/lein

    a b  
    22
    33VERSION="1.0.1"
    44
    5 CLASSPATH="$(find -H lib/ -mindepth 2> /dev/null 1 -maxdepth 1 -print0 | tr \\0 \:)"
    6 LEIN_JAR="$HOME/.m2/repository/leiningen/leiningen/$VERSION/leiningen-$VERSION-standalone.jar"
    7 CLOJURE_JAR="$HOME/.m2/repository/org/clojure/clojure/1.1.0-master-SNAPSHOT/clojure-1.1.0-master-SNAPSHOT.jar"
     5PREFIX=__PREFIX__
     6CLASSPATH="$(find -H $PREFIX -name \*.jar 2> /dev/null -print0 | tr \\0 \:)"
     7CLOJURE_JAR="$PREFIX/local/share/java/clojure/lib/clojure.jar"
    88
    99# normalize $0 on certain BSDs
    1010if [ "$(dirname $0)" = "." ]; then
     
    2626
    2727BIN_DIR="$(dirname "$SCRIPT")"
    2828
    29 if [ -r "$BIN_DIR/../src/leiningen/core.clj" ]; then
    30     # Running from source checkout
    31     LEIN_DIR="$(dirname "$BIN_DIR")"
    32     LEIN_LIBS="$(find -H $LEIN_DIR/lib -mindepth 2> /dev/null 1 -maxdepth 1 -print0 | tr \\0 \:)"
    33     CLASSPATH="$LEIN_DIR/src:$LEIN_LIBS:$CLASSPATH"
    34 
    35     if [ "$LEIN_LIBS" = "" -a "$1" != "self-install" ]; then
    36         echo "Your Leiningen development checkout is missing its dependencies."
    37         echo "Please download a stable version of Leiningen to fetch the deps."
    38         echo "See the \"Hacking\" section of the readme for details."
    39         exit 1
    40     fi
    41 else
    42     # Not running from a checkout
    43     CLASSPATH="$LEIN_JAR:$CLASSPATH"
    44 
    45     if [ ! -r "$LEIN_JAR" -a "$1" != "self-install" ]; then
    46         echo "Leiningen is not installed. Please run \"lein self-install\"."
    47         exit 1
    48     fi
    49 fi
    50 
    5129if [ $DEBUG ]; then
    5230    echo $CLASSPATH
    5331fi
     
    6038
    6139if [ "$1" = "repl" ]; then
    6240    java -client $JAVA_OPTS -cp "src/:classes/:$CLASSPATH" jline.ConsoleRunner clojure.main ${@:2}
    63 elif [ "$1" = "self-install" ]; then
    64     if [[ $VERSION == *SNAPSHOT ]]; then
    65         echo "The self-install task is only meant for stable releases."
    66         echo "See the \"Hacking\" section of the README."
    67         exit 1
    68     fi
    69     echo "Downloading Leiningen now..."
    70     mkdir -p `dirname "$LEIN_JAR"`
    71     LEIN_URL="http://repo.technomancy.us/leiningen-$VERSION-standalone.jar"
    72     if type -p curl >/dev/null 2>&1; then
    73         exec curl -o "$LEIN_JAR" "$LEIN_URL"
    74     else
    75         exec wget -O "$LEIN_JAR" "$LEIN_URL"
    76     fi
    7741else
    7842    exec java -Xbootclasspath/a:"$CLOJURE_JAR" -client $JAVA_OPTS -cp "$CLASSPATH" -Dleiningen.version="$VERSION" clojure.main -e "(use 'leiningen.core)(-main $ESCAPED_ARGS)"
    7943fi