Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Preserving file permissions in exported features
Preserving file permissions in exported features [message #487034] Mon, 21 September 2009 15:35 Go to next message
Peter Saunders is currently offline Peter SaundersFriend
Messages: 30
Registered: July 2009
Member
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 14:57 Go to previous messageGo to next message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
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 13:40 Go to previous messageGo to next message
Peter Saunders is currently offline Peter SaundersFriend
Messages: 30
Registered: July 2009
Member
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 #502060 is a reply to message #487810] Sat, 05 December 2009 01:01 Go to previous messageGo to next message
Matt Barry is currently offline Matt BarryFriend
Messages: 27
Registered: July 2009
Junior Member
So how would one make this work without rootfiles? We'd like to have fragments with native executables for each target platform. The plugins comprise a feature for the workbench, and we are not defining a product. Currently the distribution as an update site strips the executable permissions. If we go fix the permissions after installation, the native executables work fine. Is there some setting in the fragment we can apply?
Re: Preserving file permissions in exported features [message #502096 is a reply to message #502060] Sat, 05 December 2009 16:58 Go to previous messageGo to next message
Matt Barry is currently offline Matt BarryFriend
Messages: 27
Registered: July 2009
Junior Member
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:755);


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.doc.isv/ guide/p2_customizing_metadata.html
Re: Preserving file permissions in exported features [message #601937 is a reply to message #487548] Thu, 24 September 2009 13:41 Go to previous messageGo to next message
Peter Saunders is currently offline Peter SaundersFriend
Messages: 30
Registered: July 2009
Member
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 #603780 is a reply to message #601937] Sat, 05 December 2009 01:01 Go to previous messageGo to next message
Matt Barry is currently offline Matt BarryFriend
Messages: 27
Registered: July 2009
Junior Member
So how would one make this work without rootfiles? We'd like to have fragments with native executables for each target platform. The plugins comprise a feature for the workbench, and we are not defining a product. Currently the distribution as an update site strips the executable permissions. If we go fix the permissions after installation, the native executables work fine. Is there some setting in the fragment we can apply?
Re: Preserving file permissions in exported features [message #603786 is a reply to message #603780] Sat, 05 December 2009 16:58 Go to previous message
Matt Barry is currently offline Matt BarryFriend
Messages: 27
Registered: July 2009
Junior Member
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
Previous Topic:Modify Export-Package header through IPluginModelBase
Next Topic:Properties Page Extension
Goto Forum:
  


Current Time: Fri Mar 29 11:59:21 GMT 2024

Powered by FUDForum. Page generated in 0.06709 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top