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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 } | 529 } |
530 | 530 |
531 dataError('${p.join(source.getDirectory(id), 'pubspec.yaml')} has ' | 531 dataError('${p.join(source.getDirectory(id), 'pubspec.yaml')} has ' |
532 'changed since the pubspec.lock file was generated, please run "pub ' | 532 'changed since the pubspec.lock file was generated, please run "pub ' |
533 'get" again.'); | 533 'get" again.'); |
534 } | 534 } |
535 } | 535 } |
536 | 536 |
537 /// Returns whether the locked version of [dep] matches the dependency. | 537 /// Returns whether the locked version of [dep] matches the dependency. |
538 bool _isDependencyUpToDate(PackageDep dep) { | 538 bool _isDependencyUpToDate(PackageDep dep) { |
| 539 if (dep.name == root.name) return true; |
| 540 |
539 var locked = lockFile.packages[dep.name]; | 541 var locked = lockFile.packages[dep.name]; |
540 if (locked == null) return false; | 542 if (locked == null) return false; |
541 | 543 |
542 if (dep.source != locked.source) return false; | 544 if (dep.source != locked.source) return false; |
543 | 545 |
544 if (!dep.constraint.allows(locked.version)) return false; | 546 if (!dep.constraint.allows(locked.version)) return false; |
545 | 547 |
546 var source = cache.sources[dep.source]; | 548 var source = cache.sources[dep.source]; |
547 if (source == null) return false; | 549 if (source == null) return false; |
548 | 550 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 /// If [packageSymlinks] is true, creates a symlink to the "packages" | 682 /// If [packageSymlinks] is true, creates a symlink to the "packages" |
681 /// directory in [dir]. | 683 /// directory in [dir]. |
682 /// | 684 /// |
683 /// Otherwise, deletes a "packages" directories in [dir] if one exists. | 685 /// Otherwise, deletes a "packages" directories in [dir] if one exists. |
684 void _linkOrDeleteSecondaryPackageDir(String dir) { | 686 void _linkOrDeleteSecondaryPackageDir(String dir) { |
685 var symlink = p.join(dir, 'packages'); | 687 var symlink = p.join(dir, 'packages'); |
686 if (entryExists(symlink)) deleteEntry(symlink); | 688 if (entryExists(symlink)) deleteEntry(symlink); |
687 if (_packageSymlinks) createSymlink(packagesDir, symlink, relative: true); | 689 if (_packageSymlinks) createSymlink(packagesDir, symlink, relative: true); |
688 } | 690 } |
689 } | 691 } |
OLD | NEW |