avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject svn commit: rev 21549 - avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks
Date Mon, 21 Jun 2004 17:14:45 GMT
Author: mcconnell
Date: Mon Jun 21 10:14:45 2004
New Revision: 21549

Modified:
   avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/AbstractDeliverableTask.java
Log:
updated to handle explicit declaration of the asc output filename

Modified: avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/AbstractDeliverableTask.java
==============================================================================
--- avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/AbstractDeliverableTask.java
(original)
+++ avalon/trunk/tools/magic/src/main/org/apache/avalon/tools/tasks/AbstractDeliverableTask.java
Mon Jun 21 10:14:45 2004
@@ -30,7 +30,8 @@
 import org.apache.tools.ant.taskdefs.Checksum;
 import org.apache.tools.ant.taskdefs.Manifest;
 import org.apache.tools.ant.taskdefs.ManifestException;
-import org.apache.tools.ant.taskdefs.Execute;
+import org.apache.tools.ant.taskdefs.ExecTask;
+import org.apache.tools.ant.types.Commandline;
 import org.apache.tools.ant.types.FileSet;
 import org.apache.tools.ant.types.Path;
 
@@ -56,11 +57,10 @@
         log( "Creating md5 checksum" );
 
         File md5 = new File( file.toString() + "." + MD5_EXT );
-
-        Delete delete = (Delete) getProject().createTask( "delete" );
-        delete.setFile( md5 );
-        delete.init();
-        delete.execute();
+        if( md5.exists() )
+        {
+            md5.delete();
+        }
 
         Checksum checksum = (Checksum) getProject().createTask( "checksum" );
         checksum.setFile( file );
@@ -71,6 +71,8 @@
 
     public void asc( File file ) throws IOException
     {
+
+        String path = Project.translatePath( file.toString() );
         File asc = new File( file.toString() + "." + ASC_EXT );
         if( asc.exists() )
         {
@@ -81,11 +83,20 @@
         if(( null != gpg ) && !"".equals( gpg ) )
         {
             log( "Creating asc signature using '" + gpg + "']" );
-            Execute execute = new Execute();
-            execute.setCommandline( 
-              new String[]{ gpg, "-a", "-b", file.toString() } );
-            execute.setWorkingDirectory( getProject().getBaseDir() );
-            execute.setSpawn( true );
+            ExecTask execute = (ExecTask) getProject().createTask( "exec" );
+
+            execute.setExecutable( gpg );
+
+            execute.createArg().setValue( "-a" );
+            execute.createArg().setValue( "-b" );
+            execute.createArg().setValue( "-o" );
+            execute.createArg().setValue( path + "." + ASC_EXT );
+            execute.createArg().setValue( path );
+
+            execute.setDir( getProject().getBaseDir() );
+            execute.setSpawn( false );
+            execute.setAppend( false );
+            execute.setTimeout( new Integer( 1000 ) );
             execute.execute();
         }
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message