[Hackage] #390: add cabal unpack command

#390: add cabal unpack command ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.3 Platform: | ---------------------------------+------------------------------------------ It'd be handy to be able to `cabal unpack` a package name. It would be useful for users to inspect or modify packages. {{{ $ cabal unpack blah }}} It would just unpack the cached tarball for that package into the current directory (which of course always creates a sub-directory). It should accept either a versioned or unversioned package name. If the package has not been fetched yet then cabal should probably fetch it. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/390 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#390: add cabal unpack command ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.3 | Platform: ---------------------------------+------------------------------------------ Changes (by duncan): * difficulty: normal => easy (<4 hours) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/390#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#390: add cabal unpack command ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.3 | Platform: ---------------------------------+------------------------------------------ Changes (by guest): * cc: dagit@codersbase.com (added) Comment: This feature would be very nice for windows where .zip is the more standard archive format. It would also be a generally useful feature. I've wanted it in other cases just for examining a package. +1 Jason -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/390#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#390: add cabal unpack command ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.3 | Platform: ---------------------------------+------------------------------------------ Comment (by Saizan): I've needed this command a lot lately, so i've written this patch. There are 2 TODOs there since i wasn't sure what was best from an UI pov: * When no precise version is specified it defaults to the latest that match, should we also take the packagePreferences field in consideration here? * Currently it ignores exceptions (however if something goes wrong the functions involved still print error messages), summarizing failures at the end like in 'cabal install' is probably what we want. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/390#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#390: add cabal unpack command ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.3 | Platform: ---------------------------------+------------------------------------------ Comment (by duncan): Replying to [comment:3 Saizan]:
I've needed this command a lot lately, so i've written this patch.
There are 2 TODOs there since i wasn't sure what was best from an UI
Yay! The patch looks good too. pov:
When no precise version is specified it defaults to the latest that
match, That's sensible.
should we also take the packagePreferences field in consideration here?
Currently it ignores exceptions (however if something goes wrong the functions involved still print error messages), summarizing failures at
Hmm. Not sure actually. the end like in 'cabal install' is probably what we want. I'd suggest just failing on the first error. So I'd just remove the `try`. Since it does not do anything with dependencies the only time we can have multiple errors is if the user specifies multiple packages to unpack. If the first fails then they'd probably want to deal with that rather than having all the others unpack too (as possibly fail for the same reason). What happens if the user specifies no packages? Getting a helpful error would be nice. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/390#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#390: add cabal unpack command ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: Severity: normal | Resolution: Keywords: | Difficulty: easy (<4 hours) Ghcversion: 6.8.3 | Platform: ---------------------------------+------------------------------------------ Comment (by Saizan): Replying to [comment:4 duncan]:
Replying to [comment:3 Saizan]: [...]
should we also take the packagePreferences field in consideration here?
Hmm. Not sure actually. I decided to do so for the sake of consistency with cabal install/fetch.
Currently it ignores exceptions (however if something goes wrong the functions involved still print error messages), summarizing failures at the end like in 'cabal install' is probably what we want.
I'd suggest just failing on the first error. So I'd just remove the `try`. Since it does not do anything with dependencies the only time we can have multiple errors is if the user specifies multiple packages to unpack. If the first fails then they'd probably want to deal with that rather than having all the others unpack too (as possibly fail for the same reason).
Right, it seems sensible.
What happens if the user specifies no packages? Getting a helpful error would be nice.
same here. I've attached an amended patch with these edits. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/390#comment:5 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#390: add cabal unpack command
---------------------------------+------------------------------------------
Reporter: duncan | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone:
Component: cabal-install tool | Version:
Severity: normal | Resolution: fixed
Keywords: | Difficulty: easy (<4 hours)
Ghcversion: 6.8.3 | Platform:
---------------------------------+------------------------------------------
Changes (by duncan):
* status: new => closed
* resolution: => fixed
Comment:
{{{
Thu Nov 13 18:59:23 GMT 2008 Andrea Vezzosi
participants (1)
-
Hackage