问题
I'm using Eclipse 3.5.2 and I've created a p2.inf with the following information:
instructions.install = \
chmod(targetDir:@artifact,targetFile:$os$/libfoo.so,permissions:755);
instructions.install.import= \
org.eclipse.equinox.p2.touchpoint.natives.chmod
I placed the p2.inf inside the META-INF folder of the fragment, but when I install the update site, libfoo.so does not have execute permissions.
After pulling my hair out, I tried a p2.inf referencing a non-existing *.so, but nothing seems to happen. No error messages, exceptions, or warnings of any kind to indicate the P2 touchpoint action failed...
What's the deal? Any ideas?
回答1:
In Eclipse 3.6 (don't know about previous versions), the variable to use instead of @artifact is ${artifact.location}. I had to dig into the p2 source code to find it, but using it in the targetDir parameter worked like a charm.
回答2:
The import line should be org.eclipse.equinox.p2.touchpoint.eclipse.chmod
(i.e. eclipse rather than natives), according to the following comment from org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.ChmodAction
// This basically a copy of the chmod action in the native touchpoint,
// only it provides @artifact support.
(For comparison, see the 'natives' chmod action)
I haven't checked about support for interpolating variables like 'os'.
回答3:
A couple of things I notice:
- The "touchpoint.natives.chmod" action does not look like it supports
@artifact
. Try usingorg.eclipse.equinox.p2.touchpoint.eclipse.chmod
instead. os
does not appear to be a parameter that is replaced at install time. Also, looking at the p2 source code, if "os" was a parameter, it seems the syntax would actually be${os}
. (See ParameterizedProvisioningAction#processVariables)
Note that the $version$
and `$qualifier$' parameters mentioned on the wiki are replaced at metadata generation/publishing time, not at install time.
来源:https://stackoverflow.com/questions/2580080/p2-touchpoint-chmod-not-working