Ticket #453 (new enhancement)

Opened 4 years ago

Last modified 15 months ago

"cabal fetch" should take output arguments

Reported by: gregorycollins Owned by:
Priority: high Milestone: cabal-install-0.16
Component: cabal-install tool Version: HEAD
Severity: normal Keywords:
Cc: Difficulty: very easy (<1 hour)
GHC Version: 6.10.1 Platform:

Description

It would be nice if "cabal fetch" could output the fetched tarball to a location specified on the command line, i.e.:

cabal fetch bytestring -o foo.tgz

This probably depends on #423.

Change History

Changed 4 years ago by duncan

Should this also save a copy in the normal local package cache or really just make the one copy at the target location?

Changed 4 years ago by gregorycollins

Just the one copy, methinks.

Changed 4 years ago by duncan

If it's already cached of course it's just a cp. In which case it may be simpler just to download it to the cache and then cp. Fewer different code paths.

Changed 4 years ago by gregorycollins

Good point -- I don't see any reason why that wouldn't be acceptable.

Changed 4 years ago by duncan

Also, if the output path is given as a directory then the file should be put into that directory with the obvious name, eg cabal fetch foo -o ./ would create foo-1.0.tar.gz in the current dir, or whatever version of the package it was.

Changed 4 years ago by duncan

  • difficulty changed from normal to easy (<4 hours)

Changed 4 years ago by duncan

  • milestone set to cabal-install-0.8

Changed 4 years ago by gregorycollins

  • priority changed from normal to high

Setting priority on this to "high" because I may need it for platform.

Changed 4 years ago by duncan

  • difficulty changed from easy (<4 hours) to very easy (<1 hour)

And I should note that it's actually really very easy. Adding an extra command line arg is easy as is adding the plumbing to get the info to the right place. The only tricky thing is that for fetch -o we do not care about dependencies so we should use the logic for unpack rather than the normal fetch.

Bonus points for refactoring to unify the two methods and using a parameter to specify if we want to download deps into the cache too.

Changed 15 months ago by kosmikus

  • milestone changed from cabal-install-0.8 to cabal-install-0.16
Note: See TracTickets for help on using tickets.