[sip-comm-dev] Probably a bug in ant ZipFileSet


#1

Hello,

From Ant manual:

http://ant.apache.org/manual/CoreTypes/zipfileset.html

Parameters
filemode A 3 digit octal string, specify the user, group and other modes in the standard Unix fashion. Only applies to plain files. Default is 644. since Ant 1.5.2. No
dirmode A 3 digit octal string, specify the user, group and other modes in the standard Unix fashion. Only applies to directories. Default is 755. since Ant 1.5.2. No

We don't use filemode or dirmode anywhere but looks like Ant's default doesn't work. Here's a simple check to see what's broken:

mkdir delme
cd delme
cp ~/sip-communicator/sc-bundles/os-specific/linux/neomedia.jar .
unzip neomedia.jar
rm -rf *
rm: cannot remove `codecLib': Permission denied
rm: cannot remove `com': Permission denied
rm: cannot remove `javax': Permission denied
rm: cannot remove `jmapps': Permission denied

When I put filemode="644" dirmode="755" in build.xml in the target bundle-neomedia where we build the jars everything is OK. Maybe we should explicitly put filemode and dirmode everywhere where we use the zipfileset src=...
zipfileset dir=... is OK as is

Thanks,
Pavel Tankov


#2

Hey all,

We discussed this offlist and here's a summary for the sake of completeness:

Basically there were a few ways for resolving the issue:

1. Modifying the environment on the build machine that will be creating
the RPMs and making sure that brp-java-repack-jar (which is the one
having problems with the jars. Pavel mentioned that this is most
probably because of its use of "unzip" to handle the jars.

2. Modifying all zipfileset entries in our build.xml to contain the
filemode="644" and dirmode="755".

3. Somehow creating an alias for zipfileset in our build xml that
contains the params from 2 by default.

I guess that my personal preference goes for 1 since we've never had
permissions problems with our jars so far and changing the way we build
them may cause other unexpected issues to surface on some OS somewhere.

If anyone has any suggestions, don't hesitate to chime in!

Cheers,
Emil

На 22.03.10 16:07, Pavel Tankov написа:

···

Hello,

From Ant manual:
http://ant.apache.org/manual/CoreTypes/zipfileset.html

Parameters
filemode A 3 digit octal string, specify the user, group and other
modes in the standard Unix fashion. Only applies to plain files. Default
is 644. since Ant 1.5.2. No
dirmode A 3 digit octal string, specify the user, group and other
modes in the standard Unix fashion. Only applies to directories. Default
is 755. since Ant 1.5.2. No

We don't use filemode or dirmode anywhere but looks like Ant's default
doesn't work. Here's a simple check to see what's broken:

mkdir delme
cd delme
cp ~/sip-communicator/sc-bundles/os-specific/linux/neomedia.jar .
unzip neomedia.jar
rm -rf *
rm: cannot remove `codecLib': Permission denied
rm: cannot remove `com': Permission denied
rm: cannot remove `javax': Permission denied
rm: cannot remove `jmapps': Permission denied

When I put filemode="644" dirmode="755" in build.xml in the target
bundle-neomedia where we build the jars everything is OK. Maybe we
should explicitly put filemode and dirmode everywhere where we use the
zipfileset src=...
zipfileset dir=... is OK as is

Thanks,
Pavel Tankov

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net