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

Unified Diff: utils/pub/system_cache.dart

Issue 12171002: Tweak SDK constraint checking a bit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« utils/pub/git_source.dart ('K') | « utils/pub/git_source.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/system_cache.dart
diff --git a/utils/pub/system_cache.dart b/utils/pub/system_cache.dart
index 634dc173257b0e9742a549f86e6903fae9b855be..cd151f4f7518f0791f70659e5d98678ea763dd65 100644
--- a/utils/pub/system_cache.dart
+++ b/utils/pub/system_cache.dart
@@ -62,17 +62,21 @@ class SystemCache {
/// Gets the package identified by [id]. If the package is already cached,
/// reads it from the cache. Otherwise, requests it from the source.
- Future<Package> describe(PackageId id) {
- Future<Package> getUncached() {
+ Future<Pubspec> describe(PackageId id) {
+ Future<Pubspec> getUncached() {
nweiz 2013/02/02 00:15:29 This probably doesn't need to be a separate functi
Bob Nystrom 2013/02/02 00:47:10 Done.
// Not cached, so get it from the source.
- return id.describe().then((pubspec) => new Package.inMemory(pubspec));
+ return id.describe();
}
// Try to get it from the system cache first.
if (id.source.shouldCache) {
return id.systemCacheDirectory.then((packageDir) {
if (!dirExistsSync(packageDir)) return getUncached();
- return Package.load(id.name, packageDir, sources);
+ // TODO(rnystrom): Going through Package for this is a bit weird.
+ // Once Package loading is synchronous, should give Pubspec itself a
+ // constructor that loads the file.
+ return Package.load(id.name, packageDir, sources)
+ .then((package) => package.pubspec);;
nweiz 2013/02/02 00:15:29 Style nit: extra semicolon
Bob Nystrom 2013/02/02 00:47:10 Done.
});
}
« utils/pub/git_source.dart ('K') | « utils/pub/git_source.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698