ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "didge" <di...@foundrylogic.com>
Subject using ant to build Zaurus .ipk files
Date Tue, 05 Nov 2002 01:38:20 GMT
I'm trying to use ant to build Sharp Zaurus .ipk files  Essentially, an .ipk
is a packaged application that contains program files organized in a
particular directory structure that has been tarred and compressed.

The issue that I have is that ant's builtin gzip task does not seem to
behave the same has gnu's gzip.

Here is my script:

<project name="ipk" default="ipk" basedir="."/>
   <target name="ipk" depends="clean, prepare">
       <tar tarfile="control.tar" basedir="." includes="control" />
       <gzip src="control.tar" zipfile="control.tar.gz"/>
       <tar tarfile="data.tar" basedir="home"/>
       <gzip src="data.tar" zipfile="data.tar.gz"/>
       <tar tarfile="dcr.tar" basedir="." includes="control.tar.gz,
data.tar.gz"/>
       <gzip src="dcr.tar" zipfile="myapp-evm_1.0_arm.ipk"/>
   </target>
</project>

The result of running this script and running the equivalent shell script on
linux follows:

ant (using <gzip> task):
  10240 control.tar
    234 control.tar.gz  <---
1966080 data.tar
1759789 data.tar.gz
1760855 dcr-evm_1.0_arm.ipk
1771520 dcr.tar

sh (using cygwin gzip):
  10240 control.tar
    238 control.tar.gz  <--- 4 bytes more than ant!
2007040 data.tar
1758520 data.tar.gz
1759180 dcr-evm_1.0_arm.ipk
1761280 dcr.tar

Notice that the control.tar is the same between the shell and ant versions,
but that the control.tar.gz built by the shell, is slightly larger, by 4
bytes. This is why I believe that the <gzip> task of ant is slightly
different than the gnu version used by cygwin and linux.

The file that is eventually created, dcr-evm_1.0_arm.ipk, is then fed to the
following command on the Zaurus upon installation:

	if gzip -dc $filename | tar -xOf - ./control.tar.gz | gzip -dc - |
tar -xf - -C $IPKG_TMP/$pkg/control; then

This command peforms the following:
1. decompress the ipkg to standard out
2. untar the control.tar.gz from standard in to standard out
3. decompress control.tar.gz from standard in to standard out
4. untar control from standard in to the directory $IPKG_TMP/$pkg/control
5. Check the status and abort if anything screws up

Basically, the command is failing at step 2 above, trying to untar
control.tar.gz from standard in. When I run this command on linux, I get the
following error:
tar: ./control.tar.gz: Not found in archive
tar: Error exit delayed from previous errors

gzip: stdin: unexpected end of file

Another interesting note is that if I run the steps individually using
temporary files and not pipes, then linux happily decompresses and untars
control from the ant built ipk!!! It appears that the combination of an ant
built ipk and the use of pipes on the zaurus to perform the initial
decompression is the problem, but since I cannot change the
ipkg_install_file script on the Zaurus, I'm stuck...

This would really be cool to get working, any ideas are appreciated!







--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message