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

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: Clean up some test code. Created 7 years, 9 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 6cdc0707bbb76add33eaf057f917a809446c3060..fc7ff93faa5efac05c12c628a9ac168e91fe06ef 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 {
nweiz 2013/03/29 01:58:25 I don't understand why this change is in this CL.
Bob Nystrom 2013/03/30 00:15:55 The previous code will fail if you call descriptio
+ // 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, fallback to just comparing
nweiz 2013/03/29 01:58:25 "fallback" -> "fall back"
Bob Nystrom 2013/03/30 00:15:55 Done.
+ // the normalized paths.
+ var path1 = path.normalize(description1["path"]);
+ var path2 = path.normalize(description2["path"]);
nweiz 2013/03/29 01:58:25 Shouldn't you make these absolute here?
Bob Nystrom 2013/03/30 00:15:55 Done.
+ return path1 == path2;
+ }
}
Future<bool> install(PackageId id, String destination) {

Powered by Google App Engine
This is Rietveld 408576698