Make 'install --dry-run' print the latest available version of a package. #1014

Merged
merged 1 commit into from Aug 26, 2012

4 participants

@23Skidoo
Haskell member

Print the latest available version of a package when the solver has picked a different version for some reason. Inspired by Brent Yorgey's highlight-versions tool.

Example of output:

$ cabal install --dry-run repa
Resolving dependencies...
In order, the following would be installed (use -v for more details):
primitive-0.4.1
random-1.0.1.1
QuickCheck-2.4.2 (latest: 2.5)
vector-0.9.1
repa-3.2.1.1
$ cabal install --dry-run repa -v
Reading available packages...
Choosing modular solver.
Resolving dependencies...
In order, the following would be installed:
primitive-0.4.1 (new package)
random-1.0.1.1 (new package)
QuickCheck-2.4.2 (latest: 2.5) (new package)
vector-0.9.1 (new package)
repa-3.2.1.1 (new package)
@23Skidoo 23Skidoo Make 'install --dry-run' print the latest available version of a pack…
…age.

Print the latest available version of a package when the solver has picked a
different version for some reason. Inspired by Brent Yorgey's highlight-versions
tool [1].

Example of output:

$ cabal install --dry-run repa
Resolving dependencies...
In order, the following would be installed (use -v for more details):
primitive-0.4.1
random-1.0.1.1
QuickCheck-2.4.2 (latest: 2.5)
vector-0.9.1
repa-3.2.1.1

$ cabal install --dry-run repa -v
Reading available packages...
Choosing modular solver.
Resolving dependencies...
In order, the following would be installed:
primitive-0.4.1 (new package)
random-1.0.1.1 (new package)
QuickCheck-2.4.2 (latest: 2.5) (new package)
vector-0.9.1 (new package)
repa-3.2.1.1 (new package)

[1] http://byorgey.wordpress.com/2012/08/25/identifying-outdated-packages-in-cabal-install-plans/
0455ff5
@tibbe tibbe merged commit 0455ff5 into haskell:master Aug 26, 2012
@dcoutts
Haskell member

Yep, looks good. Thanks.

@kosmikus

Great change. I'm just worried that it might break tools that parse the output of a --dry-run, of which there might be some. That's the main reason why I've in the past tried to maintain the simplicity of output without -v. (In general, I think the extra information that -v prints is nearly always useful and could be turned into the default.)

@23Skidoo
Haskell member

@kosmikus Yes, I was a bit worried about breaking external tools, too. If this proves to be a problem in practice, we can make this -v only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment