开发者

P2 Touchpoint chmod not working?

开发者 https://www.devze.com 2022-12-26 06:24 出处:网络
I\'m using Eclipse 3.5.2 and I\'ve created a p2.inf with the following information: instructions.install = \\

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 tr开发者_运维知识库ied 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?


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.


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'.


A couple of things I notice:

  1. The "touchpoint.natives.chmod" action does not look like it supports @artifact. Try using org.eclipse.equinox.p2.touchpoint.eclipse.chmod instead.
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消