ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: Tar and exec problem
Date Thu, 08 May 2003 00:14:09 GMT
On Thu, 8 May 2003 07:41 am, Praveen Shenoy wrote:
> I am using the exec task to run tar as we cannot use tar directly.
> Running tar directly, replaces all the file permissions. So, this is how
> I am using it
>
> <target name="all" depends="copy_files">
>          <exec dir="${build.root}/deploy" executable="tar"
> failonerror="true" >
>              <arg line="-cvf ../sometar.tar *" />
>          </exec>
>          <delete dir="${build.root}/deploy" />
>      </target>
>
> It fails with
>
> [exec] /bin/tar: *: Cannot stat: No such file or directory
> [exec] /bin/tar: Error exit delayed from previous errors
>
> It doesn't like th "*" after the tar name. If I change it to a specific
> directory instead of "*" it works fine. Is there a problem using "*"?
>

Wildcard expansion is performed by the shell. When you exec a command from 
Ant, the shell is not directly involved so no wildcard expansion is 
performed. Instead of executing tar, you can execute /bin/sh and pass the 
complete tar command as the args

Conor


Mime
View raw message