Changes between Version 2 and Version 3 of Ticket #198

Show
Ignore:
Timestamp:
01/01/08 13:56:21 (5 years ago)
Author:
ijones
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #198

    • Property summary changed from cabal install foo should upgrade foo if there's a newer version to outline for revamp of "cabal install" and upgrade behavior
  • Ticket #198 – description

    v2 v3  
    1 As in #168 
     1I'm consolidating #168 and #197 here. 
     2 
     3= Use cases = 
     4 * "cabal install world --deep" (upgrades all packages, whether required or not) 
     5   * do we delete obsolete packages too? 
     6 * "cabal install world" (upgrades only "interesting" packages and any required upgrades) 
     7 * "cabal install foo" (upgrades foo and any required upgrades from foo) 
     8 * "cabal install foo --deep" (upgrades foo and all its dependencies whether required or not)  
     9 
     10= Definitions = 
     11 * '''Interesting packages''' are packages that a user specifically requests, rather than a package that's installed because of a dependency. 
     12 * '''Obsolete packages''' are packages which were installed as a dependency on an interesting package, but are no longer depended on by any interesting package. 
     13 * '''required upgrades''' - if the new version of foo requires a new version of Bar, then we are required to upgrade bar. 
     14 
     15= behavior of "install foo" = 
    216 
    317if I have foo-1.0 installed, and foo-2.0 is available, "cabal install foo" should upgrade foo to version 2.0 
     
    1024   1. if that version can be satisfied locally, but not from hackage, use the local version 
    1125   1. if a newer version on Hackage satisfies the dependency too, install that. 
     26 
     27= background from duncan re gentoo = 
     28I'm glad this is in, I just want to think about the user interface for a moment; for these variations on installing/upgrading stuff, what mix of top level commands or modifying flags they should use. 
     29 
     30So at the moment the behaviour is: 
     31 
     32{{{ 
     33cabal install foo 
     34}}} 
     35 
     36means install the package foo only if it is not already installed. If a newer version is available it is ignored. Though if someone specifies cabal install foo-1.1 then that really will be installed, even if foo-1.0 is installed already. This is probably not what most people want (see #168 & #198). 
     37 
     38{{{ 
     39cabal upgrade 
     40}}} 
     41 
     42means upgrade all upgradable packages. Presumably we upgrade them in dependency order. 
     43 
     44There are more variations that people would probably like so the question is, what variations, and how should the user interface allow those things to be expressed. 
     45 
     46One data point that I am familiar with is gentoo's package manager. It has a number of variations: 
     47 
     48{{{ 
     49emerge foo 
     50}}} 
     51 
     52means install or re-install package foo. So if a newer one is available, that newer one will be installed. This is the behaviur that bugs #168 & #198 are asking for. If foo is already installed and no later version is available then it is re-installed. The default behavior is not to upgrade dependencies of foo even if updates are available, that is we install/upgrade the minimum number of packages necessary to install the package requested. 
     53 
     54{{{ 
     55emerge foo --update 
     56}}} 
     57 
     58changes the behavior so that foo is not re-installed if it is already installed. Remember the default behavior was to reinstall foo if it was the latest version. 
     59 
     60This is probably the most controversial behasvour. It'd make a lot of sense to reverse the default of this mode and make --update the default and have something like --force-reinstall to re-install the same version that is already installed. 
     61 
     62{{{ 
     63emerge foo --deep 
     64}}} 
     65 
     66This modifies the behaviour to also update dependencies. So this updates the maximal number of packages that are used directly or indirectly by package foo. 
     67 
     68There are also a couple meta-packages. One emerge world which is all packages that have ever been explicitly requested (ie not including packages that were merely dependencies of requested packages). That detail is probably not necessary, but we could do with an everything target. 
     69 
     70So in this gentoo semantics, we'd express the new upgrade command by 
     71{{{ 
     72emerge world --update --deep 
     73}}}