commit:     df9639000ca69afc2be4f03a3bb41f5f1ea73f92
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  6 01:51:14 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Oct  6 01:51:14 2016 +0000
URL:        https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=df963900

meta.sh: add more jmock, hamcrest, tec.

tree.sh: restructure to reuse code.

 scripts/meta.sh | 15 ++++++++++++---
 scripts/tree.sh | 37 ++++++++++++++++++++++++++-----------
 2 files changed, 38 insertions(+), 14 deletions(-)

diff --git a/scripts/meta.sh b/scripts/meta.sh
index 0a142c8..4917098 100755
--- a/scripts/meta.sh
+++ b/scripts/meta.sh
@@ -14,8 +14,12 @@ case ${spkg} in
         echo $1:com.google.guava:${spkg}:${sver%%-*}
         exit 0
         ;;
-    json)
-        echo $1:org.json:${spkg}:${sver%%-*}
+    json|jmock)
+        echo $1:org.${spkg}:${spkg}:${sver%%-*}
+        exit 0
+        ;;
+    hamcrest-*)
+        echo $1:org.${spkg%%-*}:${spkg}:${sver%%-*}
         exit 0
         ;;
     xerces)
@@ -24,7 +28,12 @@ case ${spkg} in
         echo $1:xerces:xmlParserAPIs:${sver%%-*}
         exit 0
         ;;
-    commons-*|classworlds|jdom)
+    commons-*|classworlds|jdom|xalan*)
+        echo $1:${spkg}:${spkg}:${sver%%-*}
+        exit 0
+        ;;
+    javax-inject)
+        spkg=${spkg/-/.}
         echo $1:${spkg}:${spkg}:${sver%%-*}
         exit 0
         ;;

diff --git a/scripts/tree.sh b/scripts/tree.sh
index 5482a0b..acabb0a 100755
--- a/scripts/tree.sh
+++ b/scripts/tree.sh
@@ -30,20 +30,20 @@ gebd() {
     PV=${PV/-beta-/_beta}
     # aopalliance-repackaged 2.5.0-b16
     PV=${PV/-b/_beta}
+    # cdi-api 1.0-SP4
+    PV=${PV/-SP/_p}
     # javax.xml.stream:stax-api:1.0-2
     PV=${PV//-/.}
 
-    local M=${MA}-${MV}
-    local 
SRC_URI="http://central.maven.org/maven2/${WORKDIR}/${MV}/${M}-sources.jar";
-
     # spark-launcher_2.11 for scala 2.11
     eval $(sed -nr 's,([^_]*)(_(.*))?,PA=\1 SLOT=\3,p' <<< ${MA})
     [[ -z "${SLOT}" ]] && eval $(sed -nr 's,(.*)-(([0-9]+\.)?[0-9]+),PA=\1 
SLOT=\2,p' <<< ${MA})
     [[ -z "${SLOT}" ]] && PA=${MA}
     PA=${PA//./-}
     PA=${PA//_/-}
-    local P=${PA}-${PV}
-    local ebd=app-maven/${PA}/${P}.ebuild
+
+    local M=${MA}-${MV}
+    local 
SRC_URI="http://central.maven.org/maven2/${WORKDIR}/${MV}/${M}-sources.jar";
 
     if [[ ! -f ../poms/${M}.pom ]]; then
         pushd ../poms
@@ -61,7 +61,12 @@ gebd() {
         popd
     fi
 
-    wget -q --spider ${SRC_URI} || SRC_URI=${SRC_URI/-sources.jar/.jar}
+    if ! wget -q --spider ${SRC_URI}; then
+        SRC_URI=${SRC_URI/-sources.jar/.jar}
+        PA=${PA}-bin
+    fi
+    local P=${PA}-${PV}
+    local ebd=app-maven/${PA}/${P}.ebuild
 
     if [[ ! -f app-maven/${PA}/${P}.ebuild ]]; then
         mkdir -p app-maven/${PA}
@@ -70,7 +75,9 @@ gebd() {
 
         # empty parent artifacts
         # FIXME, this should be removed in poms
-        sed -i '/app-maven\/jsch-agentproxy-[0-9]/d' ${ebd}
+        sed -e '/app-maven\/jsch-agentproxy-bin/d' \
+            -e '/JAVA_GENTOO_CLASSPATH/s|jsch-agentproxy-bin,||' \
+            -i ${ebd}
     fi
 
     line=app-maven:${PA}:${PV}:${SLOT:-0}::${MID}
@@ -81,9 +88,15 @@ gebd() {
         popd > /dev/null
     fi
 
-    if [[ -z "${MAVEN_NODEP}" ]] && mfill app-maven/${PA}/${P}.ebuild; then
+    if [[ -z "${MAVEN_NODEP}" ]] && mfill ${ebd}; then
         java-ebuilder -p ../poms/${M}.pom -e ${ebd} -g  --workdir . \
                       -u ${SRC_URI} --slot ${SLOT:-0} --keywords ~amd64
+
+        # empty parent artifacts
+        # FIXME, this should be removed in poms
+        sed -e '/app-maven\/jsch-agentproxy-bin-[0-9]/d' \
+            -e '/JAVA_GENTOO_CLASSPATH/s|jsch-agentproxy-bin,||' \
+            -i ${ebd}
     fi
 
     [[ ${SRC_URI} = *-sources.jar ]] || sed -i 
"/inherit/s/java-pkg-simple/java-pkg-binjar/" ${ebd}
@@ -104,8 +117,10 @@ mfill() {
 }
 
 if [[ $1 == *.ebuild ]]; then
-    mfill $1
+    eval $(grep MAVEN_ID $1)
+    rm -f $1
 else
-    eval $(awk -F":" '{print "PG="$1, "MA="$2, "MV="$3}' <<< $1)
-    gebd
+    MAVEN_ID=$1
 fi
+eval $(awk -F":" '{print "PG="$1, "MA="$2, "MV="$3}' <<< ${MAVEN_ID})
+gebd

Reply via email to