Preserving file permissions in exported features [message #487034] |
Mon, 21 September 2009 11:35  |
Eclipse User |
|
|
|
Hi
I need to include some native Linux executable files within an Eclipse 3.5 plug-in. When I generate an update site for the feature containing this plug-in, the executable file permissions are lost. I'm looking for the simplest way to preserve these file permissions. Searching various discussion archives, it seems that it should be possible to force the generation of tar files rather than zip files by adding the following line to build.properties in the feature project:
archivesFormat=win32, win32, x86 - zip & linux, gtk, x86 - tar
This has no effect. Am I missing something? Is there an easier way to preserve file permissions?
Thanks
Peter Saunders
|
|
|
Re: Preserving file permissions in exported features [message #487548 is a reply to message #487034] |
Wed, 23 September 2009 10:57   |
Eclipse User |
|
|
|
Peter Saunders wrote:
> Hi
>
> I need to include some native Linux executable files within an Eclipse
> 3.5 plug-in. When I generate an update site for the feature containing
> this plug-in, the executable file permissions are lost. I'm looking for
> the simplest way to preserve these file permissions. Searching various
> discussion archives, it seems that it should be possible to force the
> generation of tar files rather than zip files by adding the following
> line to build.properties in the feature project:
>
> archivesFormat=win32, win32, x86 - zip & linux, gtk, x86 - tar
How are these executables shipped? Within a feature? Are they rootfiles?
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .pde.doc.user/tasks/pde_rootfiles.htm
If they are root files, there are properties you can set to change
permissions, i.e:
root.permissions.755=eclipse: Set the 'eclipse' file to have executable
permissions.
root.linux.gtk.x86.permissions.755=lib/**: Set all files under the lib
directory to be executable
See the documentation in the link above.
Cheers,
Chris Aniszczyk | EclipseSource Austin | +1 860 839 2465
http://twitter.com/eclipsesource | http://twitter.com/caniszczyk
|
|
|
Re: Preserving file permissions in exported features [message #487810 is a reply to message #487548] |
Thu, 24 September 2009 09:40   |
Eclipse User |
|
|
|
Hi Chris
Thanks for your reply.
You wrote:
>> Peter Saunders wrote:
>>
>> I need to include some native Linux executable files within an Eclipse
>> 3.5 plug-in. When I generate an update site for the feature containing
>> this plug-in, the executable file permissions are lost. I'm looking for
>> the simplest way to preserve these file permissions. Searching various
>> discussion archives, it seems that it should be possible to force the
>> generation of tar files rather than zip files by adding the following
>> line to build.properties in the feature project:
>>
>> archivesFormat=win32, win32, x86 - zip & linux, gtk, x86 - tar
>
> How are these executables shipped? Within a feature? Are they rootfiles?
I am flexible, but I do need this to work with an Eclipse update site.
> If they are root files, there are properties you can set to change
> permissions, i.e:
>
> root.permissions.755=eclipse
> root.linux.gtk.x86.permissions.755=lib/**
This looks like a good option for me. I have experimented with defining rootfiles within an Eclipse feature project and it is mostly working. I can deliver my executable files within a hierarchy of directories and ensure that file permissions are set correctly. But when I UNinstall the feature which provides these files, I am left with a hierarchy of empty directories under the rootfile directory. Perhaps the rootfile uninstall code cannot handle subdirectories. Is this a known problem?
Peter Saunders
|
|
|
|
|
Re: Preserving file permissions in exported features [message #601937 is a reply to message #487548] |
Thu, 24 September 2009 09:41   |
Eclipse User |
|
|
|
Hi Chris
Thanks for your reply.
You wrote:
>> Peter Saunders wrote:
>>
>> I need to include some native Linux executable files within an Eclipse
>> 3.5 plug-in. When I generate an update site for the feature containing
>> this plug-in, the executable file permissions are lost. I'm looking for
>> the simplest way to preserve these file permissions. Searching various
>> discussion archives, it seems that it should be possible to force the
>> generation of tar files rather than zip files by adding the following
>> line to build.properties in the feature project:
>>
>> archivesFormat=win32, win32, x86 - zip & linux, gtk, x86 - tar
>
> How are these executables shipped? Within a feature? Are they rootfiles?
I am flexible, but I do need this to work with an Eclipse update site.
> If they are root files, there are properties you can set to change
> permissions, i.e:
>
> root.permissions.755=eclipse
> root.linux.gtk.x86.permissions.755=lib/**
This looks like a good option for me. I have experimented with defining rootfiles within an Eclipse feature project and it is mostly working. I can deliver my executable files within a hierarchy of directories and ensure that file permissions are set correctly. But when I UNinstall the feature which provides these files, I am left with a hierarchy of empty directories under the rootfile directory. Perhaps the rootfile uninstall code cannot handle subdirectories. Is this a known problem?
Peter Saunders
|
|
|
|
Re: Preserving file permissions in exported features [message #603786 is a reply to message #603780] |
Sat, 05 December 2009 11:58  |
Eclipse User |
|
|
|
I've worked out an answer to my question posted here earlier, so I thought I'd share my solution:
Using Eclipse 3.5.1:
In the META-INF folder of the fragment containing the operating-system-specific files, create the advice file p2.inf In this file add the content
instructions.install = \
chmod(targetDir:@artifact,targetFile:myprogram,permissions:7 55);
where myprogram is a file found at the root of the fragment that we want to have executable permissions after installation.
Re-create our update site. I used the update site publishing application
/eclipse -application org.eclipse.equinox.p2.publisher.UpdateSitePublisher ...
but I don't know if this method is essential. Perform the software update in the workbench from the published update site, and then check the permissions on the myprogram file at its new location. The permissions now are 755 as desired.
The following page was useful in working out the solution:
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/p2_customizing_metadata.html
|
|
|
Powered by
FUDForum. Page generated in 0.26999 seconds