not workin, trying to make it work for the build system.
authorJoni Hahkala <joni.hahkala@cern.ch>
Thu, 13 Jan 2005 20:04:24 +0000 (20:04 +0000)
committerJoni Hahkala <joni.hahkala@cern.ch>
Thu, 13 Jan 2005 20:04:24 +0000 (20:04 +0000)
bin/generate-test-certificates.sh
build.xml

index e7bb6fa..e64c3d3 100755 (executable)
 # Authors: 
 #      Joni Hahkala <Joni.Hahlaka@cern.ch>
 #      Akos Frohner <Akos.Frohner@cern.ch>
+#      John White   <John.White@cern.ch>
 #
 
-if [ "$1" == "--all" ]; then
-    # CATYPES='trusted'
-    # CATYPES='fake'
-    # CATYPES='big'
-    # CATYPES='expired'
-    CATYPES='trusted fake big expired'
-    ALL='yes'
-    shift
-else
-    CATYPES='trusted'
-fi
-    
-BASEDIR=$1
-
-CONFIGDIR=$PWD/$(dirname $0)/../test
-export PASSWORD='changeit'
-DAYS=10000
-
-##PROJDIR=$PWD/$(dirname $0)/../project
-##VERSION='v'
-##VERSION=${VERSION}$(awk -F'[ =]' '/module.version/ { print $2} ' project/version.properties)
-##VERSION=${VERSION}'-'
-##VERSION=${VERSION}$(awk -F'[ =]' '/module.age/ { print $2} ' project/version.properties)
 
 # generating the PKCS#12 format
 function create_p12 {
@@ -478,23 +456,41 @@ function create_all_test {
 
 ############################## main ################################
 
-if [ -z "$BASEDIR" ]; then
+if [ "$1" == "--all" ]; then
+    CATYPES='trusted fake big expired'
+    ALL='yes'
+    shift
+else
+    CATYPES='trusted'
+fi
+
+#define all used dirs    
+TARGETDIR=$1
+MODULEDIR=$(dirname $0)/..
+CONFIGDIR=$MODULEDIR/test
+
+export PASSWORD='changeit'
+DAYS=10000
+
+if [ -z "$TARGETDIR" ]; then
     echo "Please specify the destination directory!"
     exit -1
 fi
 
-BASEDIR="$BASEDIR/share/test/certificates"
-mkdir -p $BASEDIR
-cd $BASEDIR
+mkdir -p $TARGETDIR
+
+cd $TARGETDIR
 echo "Current directory now: `pwd`"
+echo "Config directory now: ${CONFIGDIR}"
+
 mkdir -p tmp
-ABSBASEDIR=$(pwd)
+ABSTARGETDIR=$(pwd)
 
 for catype in $CATYPES; do
     echo "+-----------------------"
     echo "| $catype"
     echo "+-----------------------"
-    cd $ABSBASEDIR
+    cd $ABSTARGETDIR
 
     export CATYPE=${catype}
     export CA_DIR=${catype}-ca
@@ -519,7 +515,7 @@ for catype in $CATYPES; do
         continue
     fi
     if [ -d "$CA_DIR" ]; then
-        echoclean "CA directory already exists: $CA_DIR"
+        echo "CA directory already exists: $CA_DIR"
     else
         cp -a $CONFIGDIR/${catype}-ca $CA_DIR
     fi
index 568890a..08473b8 100644 (file)
--- a/build.xml
+++ b/build.xml
             ============================================== -->
        
     <target name="localinit"/>
-       <target name="clean"/>
+       <target name="clean">
+            <delete dir="${stage.dir}/share/test/certificates"/>
 
+        </target>
        <target name="doc"/>
 
     <target name="localdistbin"/>
 
+    <target name="dist" depends="stage"/>
+
     <target name="stage" depends="envcheck">
-        <exec executable="./bin/generate-test-certificates.sh">  
-            <arg line="${stage.dir}"/>
+        <echo>path:    ${stage.dir}/share/test/certificates</echo>
+        <echo>path:    "${module.dir}/bin"</echo>
+        <exec  executable="${module.dir}/bin/generate-test-certificates.sh">  
+            <arg line="--all ${stage.dir}/share/test/certificates"/>
         </exec>
     </target>