Author: michiel
Date: 2010-04-02 13:26:18 +0200 (Fri, 02 Apr 2010)
New Revision: 41730

Modified:
   speeltuin/mihxil/symlinks.sh
Log:
added a small new feature, also support didactor jars

Modified: speeltuin/mihxil/symlinks.sh
===================================================================
--- speeltuin/mihxil/symlinks.sh        2010-04-02 09:32:42 UTC (rev 41729)
+++ speeltuin/mihxil/symlinks.sh        2010-04-02 11:26:18 UTC (rev 41730)
@@ -1,12 +1,25 @@
 #!/bin/bash
-mmbasehome=$HOME/.m2/repository/org/mmbase
-
 # Creates symlinks to mmbase jars in maven repository.
 #
 # Usage: symlinks.sh [<directory> [<taglib|crontab|...> [<taglib|crontab|..]]]
 # If no directory speccified current directory is taken.
 # If no mmbase applications specified it tries to explore which applications 
are present already, and replaces those
 
+# To symlink didactor jars, do the following:
+
+# mich...@belono:~/vu/didactor/webapp/WEB-INF/lib$ PROJ=didactor 
~/mmbase/speeltuin/mihxil/symlinks.sh
+
+
+
+
+if [ "$PROJ" == '' ]; then
+    jarprefix=mmbase
+    m2home=$HOME/.m2/repository/org/mmbase
+elif [ "$PROJ" == 'didactor' ]; then
+    jarprefix=didactor
+    m2home=$HOME/.m2/repository/nl/didactor
+fi
+
 dest=$1
 shift
 if [ "$dest" == "" ]; then
@@ -16,7 +29,8 @@
 if [ -z "$1" ] ; then
     apps=""
     #No explicit jars specified
-    for file in `ls $dest | grep -E 'mmbase[a-z\-]*-[0-9].*'`; do
+    for file in `ls $dest | grep -E "$jarprefix[a-z\-]*-[0-9].*"`; do
+       echo $file
        if [ $? == "0" ]; then
            apps="$apps $file"
        else
@@ -37,8 +51,8 @@
 for i in $apps ; do
     version=`echo ${i%.jar} | awk -F- 'BEGIN {num=0;} {for (i=1; i<=NF;i++) { 
if ($i ~ /[0-9].*/) {num=1;}; if (num) { printf $i; if (i < NF) printf FS;}}}'`;
     name=`echo ${i%.jar} | awk -F- 'BEGIN {num=1;} {for (i=1; i<=NF;i++) { if 
($i ~ /[0-9].*/) {num=0;}; if (num) { if (i > 1) printf FS;  printf $i; }}}'`;
-    src=$mmbasehome/$name/$version/$name-$version.jar
-    srcclasses=$mmbasehome/$name/$version/$name-$version-classes.jar
+    src=$m2home/$name/$version/$name-$version.jar
+    srcclasses=$m2home/$name/$version/$name-$version-classes.jar
     destjar=$dest/$name-$version.jar
     echo $destjar
     if [ -e $destjar -o -h $destjar ] ; then

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to