Takes a path to Something.framework and the Current version of that and sets up all the symlinks.
(self, framework, version)
| 301 | module_file.write(module_template) |
| 302 | |
| 303 | def ExecPackageFramework(self, framework, version): |
| 304 | """Takes a path to Something.framework and the Current version of that and |
| 305 | sets up all the symlinks.""" |
| 306 | # Find the name of the binary based on the part before the ".framework". |
| 307 | binary = os.path.basename(framework).split(".")[0] |
| 308 | |
| 309 | CURRENT = "Current" |
| 310 | RESOURCES = "Resources" |
| 311 | VERSIONS = "Versions" |
| 312 | |
| 313 | if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): |
| 314 | # Binary-less frameworks don't seem to contain symlinks (see e.g. |
| 315 | # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). |
| 316 | return |
| 317 | |
| 318 | # Move into the framework directory to set the symlinks correctly. |
| 319 | pwd = os.getcwd() |
| 320 | os.chdir(framework) |
| 321 | |
| 322 | # Set up the Current version. |
| 323 | self._Relink(version, os.path.join(VERSIONS, CURRENT)) |
| 324 | |
| 325 | # Set up the root symlinks. |
| 326 | self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) |
| 327 | self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) |
| 328 | |
| 329 | # Back to where we were before! |
| 330 | os.chdir(pwd) |
| 331 | |
| 332 | def _Relink(self, dest, link): |
| 333 | """Creates a symlink to |dest| named |link|. If |link| already exists, |