Return-Path: X-Original-To: apmail-incubator-giraph-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-giraph-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8CB209A90 for ; Fri, 3 Feb 2012 19:13:11 +0000 (UTC) Received: (qmail 51005 invoked by uid 500); 3 Feb 2012 19:13:11 -0000 Delivered-To: apmail-incubator-giraph-commits-archive@incubator.apache.org Received: (qmail 50975 invoked by uid 500); 3 Feb 2012 19:13:11 -0000 Mailing-List: contact giraph-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: giraph-dev@incubator.apache.org Delivered-To: mailing list giraph-commits@incubator.apache.org Received: (qmail 50967 invoked by uid 99); 3 Feb 2012 19:13:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2012 19:13:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2012 19:13:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5914F2388860; Fri, 3 Feb 2012 19:12:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1240303 - in /incubator/giraph/trunk: CHANGELOG bin/giraph Date: Fri, 03 Feb 2012 19:12:47 -0000 To: giraph-commits@incubator.apache.org From: jghoman@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120203191247.5914F2388860@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jghoman Date: Fri Feb 3 19:12:46 2012 New Revision: 1240303 URL: http://svn.apache.org/viewvc?rev=1240303&view=rev Log: GIRAPH-136: Error message for bin/giraph could be improved. Modified: incubator/giraph/trunk/CHANGELOG incubator/giraph/trunk/bin/giraph Modified: incubator/giraph/trunk/CHANGELOG URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/CHANGELOG?rev=1240303&r1=1240302&r2=1240303&view=diff ============================================================================== --- incubator/giraph/trunk/CHANGELOG (original) +++ incubator/giraph/trunk/CHANGELOG Fri Feb 3 19:12:46 2012 @@ -1,6 +1,10 @@ Giraph Change Log -Release 0.1.0 - unreleased +Release 0.2.0 - unreleased + + GIRAPH-136: Error message for bin/graph could be improved. (jghoman) + +Release 0.1.0 - 2012-01-31 GIRAPH-120: Add Sebastian Schelter to site. (ssc) Modified: incubator/giraph/trunk/bin/giraph URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/bin/giraph?rev=1240303&r1=1240302&r2=1240303&view=diff ============================================================================== --- incubator/giraph/trunk/bin/giraph (original) +++ incubator/giraph/trunk/bin/giraph Fri Feb 3 19:12:46 2012 @@ -15,6 +15,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +# friendly message for those who forget to tell us what to do +if [ $# = 0 ]; then + echo "Usage: giraph [-D] " + echo "At a minimum one must provide a path to the jar containing the vertex to be executed." + exit 1 +fi + + # resolve links - $0 may be a softlink THIS="$0" while [ -h "$THIS" ]; do @@ -31,7 +39,7 @@ done THIS_DIR=`dirname "$THIS"` GIRAPH_HOME=`cd "$THIS_DIR/.." ; pwd` -# extra properites to send straight to Hadoop +# extra properties to send straight to Hadoop HADOOP_PROPERTIES= while [ $1 ] && [ ${1:0:2} == "-D" ] ; do HADOOP_PROPERTIES="$1 $HADOOP_PROPERTIES" @@ -42,29 +50,46 @@ USER_JAR=$1 shift if [ ! -e "$USER_JAR" ]; then - echo "Can't find user jar to execute." + echo "Can't find user jar (${USER_JAR}) to execute." exit 1 fi # add user jar to classpath CLASSPATH=${USER_JAR} +CLASS=org.apache.giraph.GiraphRunner + # so that filenames w/ spaces are handled correctly in loops below IFS= # add release dependencies to CLASSPATH -for f in $GIRAPH_HOME/lib/*.jar; do - CLASSPATH=${CLASSPATH}:$f; -done - -CLASS=org.apache.giraph.GiraphRunner - -for f in $GIRAPH_HOME/lib/giraph*.jar ; do - if [ -e "$f" ]; then - JAR=$f - fi -done - +if [ -d "$GIRAPH_HOME/lib" ]; then + for f in $GIRAPH_HOME/lib/*.jar; do + CLASSPATH=${CLASSPATH}:$f; + done + + for f in $GIRAPH_HOME/lib/giraph*.jar ; do + if [ -e "$f" ]; then + JAR=$f + break + fi + done +else + echo "No lib directory, assuming dev environment" + if [ ! -d "$GIRAPH_HOME/target" ]; then + echo "No target directory. Build Giraph jar before proceeding." + exit 1 + fi + + CLASSPATH=`mvn dependency:build-classpath | grep -v "[INFO]"` + + for f in $GIRAPH_HOME/target/giraph*.jar ; do + if [ -e "$f" ]; then + JAR=$f + break + fi + done +fi # restore ordinary behaviour unset IFS