"cabal install ___" breaks previously installed packages

I find the behavior cabalwhen installing packages crazy. For example, launch

cabal install funsat

older versions of array, time, random, quickcheckand bitset, breaking packets, such as monadiccp, hoogle, heist, snapetc.

It works to go back, cabal install monadiccpetc., but how can I avoid the default behavior for cracking installed packages? Any intelligent Linux package manager like aptitudeor zypperwould have asked me if I wanted to break the packages are already installed when you install a new package.

Has anyone prepared a workaround for the script? Thanks in advance.

+5
source share
3 answers

cabal-dev, , . cabal-install , , , , , cabal-dev clean && cabal-dev install.

.

, , .


, cabal, , :

cabal () {
  if [ "$1" = "install" ]; then
    local out=$(command cabal --dry-run -v2 "$@" 2>&1)
    if echo "$out" | egrep -c '\((reinstall|new version)\)' >/dev/null; then
      echo "$out"
      return 1
    fi
  fi
  command cabal "$@"
}

YMMV; , , . , .

+8

: --dry-run. cabal - , .

+5

(. -, 22). Darcs cabal-install (darcs get http://darcs.haskell.org/cabal) , . :

$ cabal --version
cabal-install version 0.13.3
using version 1.13.3 of the Cabal library
$ cabal install monadiccp
[...]
$ cabal install funsat
Resolving dependencies...
In order, the following would be installed:
mtl-1.1.1.1 (new version)
syb-0.3.6 (new package)
array-0.2.0.0 (new version)
containers-0.2.0.1 (new version)
bimap-0.2.4 (new package)
deepseq-1.2.0.1 (reinstall) changes: array-0.3.0.2 -> 0.2.0.0
fgl-5.4.2.2 (new package)
text-0.11.1.12 (reinstall) changes: array-0.3.0.2 -> 0.2.0.0
parsec-3.1.2 (reinstall) changes: mtl-2.0.1.0 -> 1.1.1.1
parse-dimacs-1.2 (new package)
time-1.1.4 (new version)
random-1.0.0.3 (reinstall) changes: time-1.2.0.3 -> 1.1.4
QuickCheck-1.2.0.1 -base3 (new package)
bitset-0.6 (new package)
funsat-0.6.1 (new package)
cabal: The install plan contains reinstalls which can break your GHC
installation.
You can use the --avoid-reinstalls option to try to avoid this or try
to ghc-pkg unregister the version of the package version to see its effect
on reverse dependencies. If you know what you are doing you can use
the --override-reinstall-check option to override this reinstall check.
+2

All Articles