Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: utils/pub/path_source.dart

Issue 13095015: Use backtracking when solving dependency constraints. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise, update to latest corelib, and make backtracker default. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: utils/pub/path_source.dart
diff --git a/utils/pub/path_source.dart b/utils/pub/path_source.dart
index e4d1f02ad724afb417ca36897d775cd5bb631c74..c103c1bfdd488a57a8af0efd254145f2a05ca6c7 100644
--- a/utils/pub/path_source.dart
+++ b/utils/pub/path_source.dart
@@ -33,10 +33,18 @@ class PathSource extends Source {
}
bool descriptionsEqual(description1, description2) {
- // Compare real paths after normalizing and resolving symlinks.
- var path1 = new File(description1["path"]).fullPathSync();
- var path2 = new File(description2["path"]).fullPathSync();
- return path1 == path2;
+ try {
+ // Compare real paths after normalizing and resolving symlinks.
+ var path1 = new File(description1["path"]).fullPathSync();
+ var path2 = new File(description2["path"]).fullPathSync();
+ return path1 == path2;
+ } on FileIOException catch (ex) {
+ // If either of the files couldn't be found, fall back to just comparing
+ // the normalized paths.
+ var path1 = path.normalize(path.absolute(description1["path"]));
+ var path2 = path.normalize(path.absolute(description2["path"]));
+ return path1 == path2;
+ }
}
Future<bool> install(PackageId id, String destination) {

Powered by Google App Engine
This is Rietveld 408576698