Vote count:
0
I have a list of files for which I need to preserve the permissions during the ant task. I realized that the only way to do this is using tarfileset's filemode attribute. Currently I am excluding the list of files in the first tarfileset and including them the second time with the permissions (to avoid duplicate files with different permssions) as given below:
<tar basedir="src" destfile="myzip.tar.gz" compression="gzip">
<tarfileset dir="com/foo/bar">
<exclude name="com/foo/bar/script1.sh"/>
<exclude name="com/foo/bar/script2.sh"/>
</tarfileset>
<tarfileset dir="com/foo/bar" filemode="755">
<include name="com/foo/bar/script1.sh"/>
<include name="com/foo/bar/script2.sh"/>
</tarfileset>
</tar>
Is there a better way by which I can preserve the permissions of the list of files.
Note: I don't have just 2 files to for which I need to preserve the permissions. The list is quite big.
Any help is appreciated. Thanks in advance.
asked 57 secs ago
Preserving tar file permissions in ant task for multiple files using tarfileset
Aucun commentaire:
Enregistrer un commentaire