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

Issue 10207018: First pass at "pub update" implementation. (Closed)

Created:
8 years, 8 months ago by Bob Nystrom
Modified:
8 years, 8 months ago
Reviewers:
nweiz
CC:
reviews_dartlang.org, kasperl
Visibility:
Public.

Description

First pass at "pub update" implementation. This will create a "packages" directory next to the current package's entrypoint and populate it with symlinks to packages in the pub package cache. Transitive dependencies are handled. Committed: https://code.google.com/p/dart/source/detail?r=6979

Patch Set 1 #

Patch Set 2 : Minor cleanup. #

Total comments: 16
Unified diffs Side-by-side diffs Delta from patch set Stats (+376 lines, -78 lines) Patch
M utils/pub/cache.dart View 2 chunks +4 lines, -44 lines 0 comments Download
M utils/pub/command_list.dart View 1 chunk +0 lines, -1 line 0 comments Download
M utils/pub/command_update.dart View 1 chunk +20 lines, -1 line 2 comments Download
M utils/pub/io.dart View 1 4 chunks +98 lines, -2 lines 7 comments Download
M utils/pub/package.dart View 1 2 chunks +98 lines, -9 lines 7 comments Download
M utils/pub/pub.dart View 4 chunks +16 lines, -0 lines 0 comments Download
M utils/tests/pub/pub.status View 1 chunk +4 lines, -0 lines 0 comments Download
M utils/tests/pub/pub_tests.dart View 4 chunks +60 lines, -12 lines 0 comments Download
M utils/tests/pub/test_pub.dart View 9 chunks +76 lines, -9 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Bob Nystrom
I'm doing symlinks here because it's a quick and dirty way to get some kind ...
8 years, 8 months ago (2012-04-24 17:45:58 UTC) #1
nweiz
lgtm https://chromiumcodereview.appspot.com/10207018/diff/11/utils/pub/command_update.dart File utils/pub/command_update.dart (right): https://chromiumcodereview.appspot.com/10207018/diff/11/utils/pub/command_update.dart#newcode11 utils/pub/command_update.dart:11: var dependencies; These should be listed in the ...
8 years, 8 months ago (2012-04-25 17:50:47 UTC) #2
Bob Nystrom
Thanks! https://chromiumcodereview.appspot.com/10207018/diff/11/utils/pub/command_update.dart File utils/pub/command_update.dart (right): https://chromiumcodereview.appspot.com/10207018/diff/11/utils/pub/command_update.dart#newcode11 utils/pub/command_update.dart:11: var dependencies; On 2012/04/25 17:50:47, nweiz wrote: > ...
8 years, 8 months ago (2012-04-25 22:20:29 UTC) #3
nweiz
8 years, 8 months ago (2012-04-25 22:30:08 UTC) #4
lgtm

https://chromiumcodereview.appspot.com/10207018/diff/11/utils/pub/io.dart
File utils/pub/io.dart (right):

https://chromiumcodereview.appspot.com/10207018/diff/11/utils/pub/io.dart#new...
utils/pub/io.dart:235: // TODO(rnystrom): Check exit code and output?
On 2012/04/25 22:20:29, Bob Nystrom wrote:
> On 2012/04/25 17:50:47, nweiz wrote:
> > Shouldn't runProcess be responsible for exit code checking?
> > 
> > I believe ln will always use an exit code to indicate failure, so output
> > checking shouldn't be necessary.
> 
> runProcess returns the exit code, but it doesn't test it because it doesn't
> really know or care about what failure means.

I suppose that's reasonable.

https://chromiumcodereview.appspot.com/10207018/diff/11/utils/pub/package.dart
File utils/pub/package.dart (right):

https://chromiumcodereview.appspot.com/10207018/diff/11/utils/pub/package.dar...
utils/pub/package.dart:49: Future<Collection<Package>> loadDependencies() {
On 2012/04/25 22:20:29, Bob Nystrom wrote:
> On 2012/04/25 17:50:47, nweiz wrote:
> > I don't think the distinction between loadDependencies and
> traverseDependencies
> > is clear from the name. What about loadLocalDependencies and
> > loadTransitiveDependencies?
> 
> "local" doesn't have the right connotation to me. It's a drag that
> "dependencies" is already such a long work. I want something here that's clear
> but not painfully long.
> 
> "loadImmediateDependencies" would work but is a mouthful. Maybe
> "traverseAllDependencies" and leave load as-is?

I like "loadImmediateDependencies". It is verbose, but I think in this case
clarity is more important.

Powered by Google App Engine
This is Rietveld 408576698