| OLD | NEW |
| 1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import contextlib | 5 import contextlib |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 import tempfile | 10 import tempfile |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 from_source = True | 275 from_source = True |
| 276 | 276 |
| 277 if from_source: | 277 if from_source: |
| 278 self.Build(build_deps, force) | 278 self.Build(build_deps, force) |
| 279 | 279 |
| 280 if self.IsAnyVersionInstalled(): | 280 if self.IsAnyVersionInstalled(): |
| 281 installed_pkg = self.GetInstalledPackage() | 281 installed_pkg = self.GetInstalledPackage() |
| 282 installed_pkg.LogStatus('Uninstalling existing') | 282 installed_pkg.LogStatus('Uninstalling existing') |
| 283 installed_pkg.DoUninstall() | 283 installed_pkg.DoUninstall() |
| 284 | 284 |
| 285 binary_package.BinaryPackage(package_file).Install() | 285 binary_package.BinaryPackage(package_file).Install(force) |
| 286 | 286 |
| 287 def GetInstalledPackage(self): | 287 def GetInstalledPackage(self): |
| 288 return package.CreateInstalledPackage(self.NAME, self.config) | 288 return package.CreateInstalledPackage(self.NAME, self.config) |
| 289 | 289 |
| 290 def CreatePkgFile(self): | 290 def CreatePkgFile(self): |
| 291 """Create and pkg file for use with the FreeBSD pkg tool. | 291 """Create and pkg file for use with the FreeBSD pkg tool. |
| 292 | 292 |
| 293 This step is designed to run after the build scripts and will | 293 This step is designed to run after the build scripts and will |
| 294 package up any files published by the PublishByArchForDevEnv | 294 package up any files published by the PublishByArchForDevEnv |
| 295 step. | 295 step. |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 if os.path.isdir(package_name): | 770 if os.path.isdir(package_name): |
| 771 return SourcePackage(package_name, config) | 771 return SourcePackage(package_name, config) |
| 772 | 772 |
| 773 for subdir in DEFAULT_LOCATIONS: | 773 for subdir in DEFAULT_LOCATIONS: |
| 774 pkg_root = os.path.join(paths.NACLPORTS_ROOT, subdir, package_name) | 774 pkg_root = os.path.join(paths.NACLPORTS_ROOT, subdir, package_name) |
| 775 info = os.path.join(pkg_root, 'pkg_info') | 775 info = os.path.join(pkg_root, 'pkg_info') |
| 776 if os.path.exists(info): | 776 if os.path.exists(info): |
| 777 return SourcePackage(pkg_root, config) | 777 return SourcePackage(pkg_root, config) |
| 778 | 778 |
| 779 raise Error("Package not found: %s" % package_name) | 779 raise Error("Package not found: %s" % package_name) |
| OLD | NEW |