Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361204

Summary: root.permissions property does not support wildcards/patterns
Product: z_Archived Reporter: Meng Xin Zhu <kane.zhu>
Component: TychoAssignee: Jan Sievers <jan.sievers>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: jan.sievers, kane.mx, pwebster, t-oberlies, thanh.ha
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 386599    
Attachments:
Description Flags
Minimal project to reproduce
none
patch (needs tests) none

Description Meng Xin Zhu CLA 2011-10-18 02:39:18 EDT
1. specify the root files and 'chmod' action in build.properties like below,

root.linux.gtk.x86= jre
root.linux.gtk.x86.permissions.777=jre/*/bin/*

2. use tycho to deploy the RCP application as eclipse repository. Tycho creates the wrong metadata for 'chmod' action like below,

        <instructions size='1'>
          <instruction key='install'>
            chmod(targetDir:${installFolder}, targetFile:jre/*/bin/*, permissions:777);
          </instruction>
        </instructions>

However this usage works fine in PDE build. The metadata generated by PDE looks like,

<instructions size="1"><instruction key="install">
            chmod(targetDir:${installFolder}, targetFile:jre/1.6.0_21/bin/java, permissions:777);
          </instruction></instructions><instructions size="1"><instruction key="install">
            chmod(targetDir:${installFolder}, targetFile:jre/1.6.0_21/bin/java_vm, permissions:777);
          </instruction></instructions><instructions size="1"><instruction key="install">
            chmod(targetDir:${installFolder}, targetFile:jre/1.6.0_21/bin/javaws, permissions:777);
          </instruction></instructions>

PDE build helps find all files that match the specified pattern, then create touchpoint action for them one by one.
Comment 1 Jan Sievers CLA 2011-10-18 03:45:04 EDT
also see bug 352251 comment#1
Comment 2 Meng Xin Zhu CLA 2011-10-18 05:54:32 EDT
(In reply to comment #1)
> also see bug 352251 comment#1

I see. It's still a limitation.

I tried to add two lines of changing permission in build.properties, only the last one is generated into metadata. No workaround for it.

root.solaris.gtk.sparc.permissions.777=jre/1.6.0_21/bin/java
root.solaris.gtk.sparc.permissions.777=jre/1.6.0_21/bin/java_vm
Comment 3 Tobias Oberlies CLA 2011-10-18 08:00:01 EDT
(In reply to comment #2)
> I tried to add two lines of changing permission in build.properties, only the
> last one is generated into metadata. No workaround for it.
> 
> root.solaris.gtk.sparc.permissions.777=jre/1.6.0_21/bin/java
> root.solaris.gtk.sparc.permissions.777=jre/1.6.0_21/bin/java_vm
This is expected for a properties file, isn't it? IIRC the value can be a comma-separated list.
Comment 4 Tobias Oberlies CLA 2011-10-18 08:01:57 EDT
Still, you are right that this is a missing feature/bug. But in all static cases you should be able to work around the problem by specifying an explicit list of files.
Comment 5 Meng Xin Zhu CLA 2011-10-19 02:51:22 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > I tried to add two lines of changing permission in build.properties, only the
> > last one is generated into metadata. No workaround for it.
> >
> > root.solaris.gtk.sparc.permissions.777=jre/1.6.0_21/bin/java
> > root.solaris.gtk.sparc.permissions.777=jre/1.6.0_21/bin/java_vm
> This is expected for a properties file, isn't it? IIRC the value can be a
> comma-separated list.
You're right, comma-separated list is a workaround.
Comment 6 Tobias Oberlies CLA 2011-11-14 08:25:46 EST
Changed title from
   tycho incorrectly handles the 'chmod' touchpoint action
to
   root.permissions property does not support wildcards/patterns
to better describe the limitation.
Comment 7 Paul Webster CLA 2012-09-20 08:08:59 EDT
We've hit this while building the Eclipse Platform using CBI - maven/tycho.

root.linux.gtk.x86.permissions.755=*.so*
Comment 8 Thanh Ha CLA 2012-11-08 18:40:26 EST
Created attachment 223373 [details]
Minimal project to reproduce

Attached is a minimal project to reproduce the issue.
Comment 9 Jan Sievers CLA 2012-11-09 05:07:15 EST
Created attachment 223381 [details]
patch (needs tests)

there are currently problems to push to gerrit, so here is a first version of a patch. needs tests.
Comment 10 Jan Sievers CLA 2012-11-09 12:27:43 EST
https://git.eclipse.org/r/#/c/8624/

... more complicated than one would assume at first glance