Bug 193236

Summary: cassandra2-2.0.10 does not work
Product: Ports & Packages Reporter: Toshiro <toshiro.biz>
Component: Individual Port(s)Assignee: admins
Status: Closed FIXED    
Severity: Affects Many People CC: admins, pi
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Fixed port
none
Patch for port
none
Patch for port none

Description Toshiro 2014-09-02 01:43:43 UTC
when installing cassandra2, it uses openjdk 7; it installs correctly but does not work at all!

The problem is /usr/local/share/cassandra/conf/cassandra-env.sh, in particular, this part of the code:

jvmver=`echo "$java_ver_output" | grep 'java version' | awk -F'"' 'NR==1 {print $2}'`
JVM_VERSION=${jvmver%_*}
JVM_PATCH_VERSION=${jvmver#*_}

if [ "$JVM_VERSION" \< "1.7" ] ; then
    echo "Cassandra 2.0 and later require Java 7 or later."
    exit 1;
fi


$JVM_VERSION never gets the JVM version, here's the relevant part of 

sh -x cassandra.env.sh:


+ java -version
+ java_ver_output='openjdk version "1.7.0_65"
OpenJDK Runtime Environment (build 1.7.0_65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)'
+ echo 'openjdk version "1.7.0_65"
OpenJDK Runtime Environment (build 1.7.0_65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)'
+ grep 'java version'
+ awk '-F"' 'NR==1 {print $2}'
+ jvmver=''
+ JVM_VERSION=''
+ JVM_PATCH_VERSION=''
+ [ '' '<' 1.7 ]
+ echo 'Cassandra 2.0 and later require Java 7 or later.'
Cassandra 2.0 and later require Java 7 or later.
+ exit 1
Comment 1 admins 2014-09-02 16:07:37 UTC
Created attachment 146688 [details]
Fixed port
Comment 2 John Marino freebsd_committer freebsd_triage 2014-09-04 17:07:18 UTC
admins, 

Please submit a proper patch.
A shar is *only* used for brand new ports. 

After that, you only provide patches.

CC'ing Kurt who committed the port, he might be interested.
Comment 3 John Marino freebsd_committer freebsd_triage 2014-09-04 17:08:18 UTC
(intentional repeat for Kurt)

admins, 

Please submit a proper patch.
A shar is *only* used for brand new ports. 

After that, you only provide patches.

CC'ing Kurt who committed the port, he might be interested.
Comment 4 admins 2014-09-04 17:12:15 UTC
Created attachment 146808 [details]
Patch for port
Comment 5 Kurt Jaeger freebsd_committer freebsd_triage 2014-09-04 20:41:58 UTC
Can you re-do the patch somehow ?

It fails to apply here:

Patching file Makefile using Plan A...
Hunk #1 succeeded at 2.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff --git a/databases/cassandra2/files/patch-env b/databases/cassandra2/files/patch-env
|index caacf9c..252e8ec 100644
|--- a/databases/cassandra2/files/patch-env
|+++ b/databases/cassandra2/files/patch-env
--------------------------
File to patch: files/patch-env
Patching file files/patch-env using Plan A...
Hunk #1 failed at 1.
1 out of 1 hunks failed--saving rejects to files/patch-env.rej
Comment 6 admins 2014-09-04 20:59:07 UTC
Created attachment 146832 [details]
Patch for port

# patch -p1 < /tmp/cassandra2.diff
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ruN cassandra2.orig/Makefile cassandra2/Makefile
|--- cassandra2.orig/Makefile	2014-08-29 06:29:40.000000000 -0700
|+++ cassandra2/Makefile	2014-09-04 13:47:49.000000000 -0700
--------------------------
Patching file Makefile using Plan A...
Hunk #1 succeeded at 2.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ruN cassandra2.orig/files/patch-env cassandra2/files/patch-env
|--- cassandra2.orig/files/patch-env	2014-08-29 00:18:10.000000000 -0700
|+++ cassandra2/files/patch-env	2014-09-04 13:49:04.000000000 -0700
--------------------------
Patching file files/patch-env using Plan A...
Hunk #1 succeeded at 1.
done
Comment 7 commit-hook freebsd_committer freebsd_triage 2014-09-05 03:31:02 UTC
A commit references this bug:

Author: pi
Date: Fri Sep  5 03:30:39 UTC 2014
New revision: 367323
URL: http://svnweb.freebsd.org/changeset/ports/367323

Log:
  databases/cassandra2: fix jdk7 invocation

  PR:		193236
  Submitted by:	toshiro.biz@gmail.com
  Approved by:	admins@perceptyx.com (maintainer)

Changes:
  head/databases/cassandra2/Makefile
  head/databases/cassandra2/files/patch-env
Comment 8 Kurt Jaeger freebsd_committer freebsd_triage 2014-09-05 03:31:29 UTC
Committed, thanks!