Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 import 'package:barback/barback.dart'; | 8 import 'package:barback/barback.dart'; |
| 9 import 'package:package_config/packages_file.dart' as packages_file; | 9 import 'package:package_config/packages_file.dart' as packages_file; |
| 10 import 'package:path/path.dart' as p; | 10 import 'package:path/path.dart' as p; |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 518 for (var id in lockFile.packages.values) { | 518 for (var id in lockFile.packages.values) { |
| 519 var source = cache.sources[id.source]; | 519 var source = cache.sources[id.source]; |
| 520 if (source is CachedSource) continue; | 520 if (source is CachedSource) continue; |
| 521 | 521 |
| 522 try { | 522 try { |
| 523 if (cache.sources.load(id).dependencies.every((dep) => | 523 if (cache.sources.load(id).dependencies.every((dep) => |
| 524 overrides.contains(dep.name) || _isDependencyUpToDate(dep))) { | 524 overrides.contains(dep.name) || _isDependencyUpToDate(dep))) { |
| 525 continue; | 525 continue; |
| 526 } | 526 } |
| 527 } on FileException { | 527 } on FileException { |
| 528 print("got fe"); | |
|
Bob Nystrom
2016/05/17 18:10:20
Delete this. :)
nweiz
2016/05/17 18:26:17
Done.
| |
| 528 // If we can't load the pubpsec, the user needs to re-run "pub get". | 529 // If we can't load the pubpsec, the user needs to re-run "pub get". |
| 529 } | 530 } |
| 530 | 531 |
| 531 dataError('${p.join(source.getDirectory(id), 'pubspec.yaml')} has ' | 532 dataError('${p.join(source.getDirectory(id), 'pubspec.yaml')} has ' |
| 532 'changed since the pubspec.lock file was generated, please run "pub ' | 533 'changed since the pubspec.lock file was generated, please run "pub ' |
| 533 'get" again.'); | 534 'get" again.'); |
| 534 } | 535 } |
| 535 } | 536 } |
| 536 | 537 |
| 537 /// Returns whether the locked version of [dep] matches the dependency. | 538 /// Returns whether the locked version of [dep] matches the dependency. |
| 538 bool _isDependencyUpToDate(PackageDep dep) { | 539 bool _isDependencyUpToDate(PackageDep dep) { |
| 540 if (dep.name == root.name) return true; | |
| 541 | |
| 539 var locked = lockFile.packages[dep.name]; | 542 var locked = lockFile.packages[dep.name]; |
| 540 if (locked == null) return false; | 543 if (locked == null) return false; |
| 541 | 544 |
| 542 if (dep.source != locked.source) return false; | 545 if (dep.source != locked.source) return false; |
| 543 | 546 |
| 544 if (!dep.constraint.allows(locked.version)) return false; | 547 if (!dep.constraint.allows(locked.version)) return false; |
| 545 | 548 |
| 546 var source = cache.sources[dep.source]; | 549 var source = cache.sources[dep.source]; |
| 547 if (source == null) return false; | 550 if (source == null) return false; |
| 548 | 551 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 680 /// If [packageSymlinks] is true, creates a symlink to the "packages" | 683 /// If [packageSymlinks] is true, creates a symlink to the "packages" |
| 681 /// directory in [dir]. | 684 /// directory in [dir]. |
| 682 /// | 685 /// |
| 683 /// Otherwise, deletes a "packages" directories in [dir] if one exists. | 686 /// Otherwise, deletes a "packages" directories in [dir] if one exists. |
| 684 void _linkOrDeleteSecondaryPackageDir(String dir) { | 687 void _linkOrDeleteSecondaryPackageDir(String dir) { |
| 685 var symlink = p.join(dir, 'packages'); | 688 var symlink = p.join(dir, 'packages'); |
| 686 if (entryExists(symlink)) deleteEntry(symlink); | 689 if (entryExists(symlink)) deleteEntry(symlink); |
| 687 if (_packageSymlinks) createSymlink(packagesDir, symlink, relative: true); | 690 if (_packageSymlinks) createSymlink(packagesDir, symlink, relative: true); |
| 688 } | 691 } |
| 689 } | 692 } |
| OLD | NEW |