Chromium Code Reviews| Index: utils/pub/entrypoint.dart |
| diff --git a/utils/pub/entrypoint.dart b/utils/pub/entrypoint.dart |
| index 521f2614c4bdae4b88cf55fbc88be08a0a56c703..b5cc6f31159664b3e8f18250345dbd0b246d503f 100644 |
| --- a/utils/pub/entrypoint.dart |
| +++ b/utils/pub/entrypoint.dart |
| @@ -6,6 +6,7 @@ library entrypoint; |
| import 'io.dart'; |
| import 'lock_file.dart'; |
| +import 'log.dart' as log; |
| import 'package.dart'; |
| import 'root_source.dart'; |
| import 'system_cache.dart'; |
| @@ -81,6 +82,7 @@ class Entrypoint { |
| if (!exists) return new Future.immediate(null); |
| // TODO(nweiz): figure out when to actually delete the directory, and when |
| // we can just re-use the existing symlink. |
| + log.fine("Deleting package directory $packageDir."); |
|
nweiz
2012/12/05 23:56:54
Redundant with deleteDir.
Bob Nystrom
2012/12/06 01:33:26
Replaced path with package name in log. I still wa
|
| return deleteDir(packageDir); |
| }).chain((_) { |
| if (id.source.shouldCache) { |
| @@ -161,6 +163,8 @@ class Entrypoint { |
| Future<LockFile> _loadLockFile() { |
| var completer = new Completer<LockFile>(); |
| var lockFilePath = join(root.dir, 'pubspec.lock'); |
| + |
| + log.fine("Loading lockfile $lockFilePath."); |
|
nweiz
2012/12/05 23:56:54
"$lockFilePath" is redundant.
Bob Nystrom
2012/12/06 01:33:26
Done.
|
| var future = readTextFile(lockFilePath); |
| future.handleException((_) { |
| @@ -168,8 +172,9 @@ class Entrypoint { |
| // probably wrong and we should notify the user. |
| fileExists(lockFilePath).transform((exists) { |
| if (!exists) return; |
| - printError("Error reading pubspec.lock: ${future.exception}"); |
| + log.error("Error reading pubspec.lock: ${future.exception}"); |
| }).then((_) { |
| + log.fine("No lock file at $lockFilePath, creating empty one."); |
| completer.complete(new LockFile.empty()); |
| }); |
| @@ -190,7 +195,9 @@ class Entrypoint { |
| if (id.source is! RootSource) lockFile.packages[id.name] = id; |
| } |
| - return writeTextFile(join(root.dir, 'pubspec.lock'), lockFile.serialize()); |
| + var lockFilePath = join(root.dir, 'pubspec.lock'); |
| + log.fine("Saving lockfile $lockFilePath."); |
|
nweiz
2012/12/05 23:56:54
"$lockFilePath" is redundant.
|
| + return writeTextFile(lockFilePath, lockFile.serialize()); |
| } |
| /** |