ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pshenoy...@aol.com (Praveen Shenoy)
Subject Re: Tar and exec problem
Date Thu, 08 May 2003 00:33:36 GMT
  <target name="all" depends="copy_files">
             <exec dir="${build.root}/deploy/shopping" 
executable="/bin/sh" failonerror="true" >
             <arg line="tar -cvf ../../ship/package/fedeploy.tar *">
             </arg>
         </exec>

didn't work. output below.

[exec] tar: /bin/tar: cannot execute binary file

Praveen

Conor MacNeill wrote:

 > 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
 >
 >
 > ---------------------------------------------------------------------
 > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
 > For additional commands, e-mail: user-help@ant.apache.org
 >



Mime
View raw message