다음은 패키지를 제거하는 데 사용하는 쉘 스크립트입니다. 그것은 (당신이 당신의 설치를 호스 경우에 저를 비난하지 않지만, 보증없이 제공됩니다!) GHC의 여러 설치 버전을 지원하고 또한 관련 파일을 쳐
#!/bin/bash -eu
# Usage: ./uninstall.sh [--force | --no-unregister] pkgname-version
# if you set VER in the environment to e.g. "-7.0.1" you can use
# the ghc-pkg associated with a different GHC version
: ${VER:=}
if [ "$#" -lt 1 ]
then
echo "Usage: $0 [--force | --no-unregister] pkgname-version"
exit 1
fi
if [ "$1" == "--force" ]
then force=--force; shift; # passed to ghc-pkg unregister
else force=
fi
if [ "$1" == "--no-unregister" ]
then shift # skip unregistering and just delete files
else
if [ "$(ghc-pkg$VER latest $1)" != "$1" ]
then
# full version not specified: list options and exit
ghc-pkg$VER list $1; exit 1
fi
ghc-pkg$VER unregister $force $1
fi
# wipe library files
rm -rfv -- ~/.cabal/lib/$1/ghc-$(ghc$VER --numeric-version)/
# if the directory is left empty, i.e. not on any other GHC version
if rmdir -- ~/.cabal/lib/$1
then rm -rfv -- ~/.cabal/share/{,doc/}$1 # then wipe the shared files as well
fi
'ghc-pkg list blaze-html'? 올바른 사용자로 실행하고 있습니까? 등록되지 않은 버전을 명시 적으로 명시 하시겠습니까? – ivanm
@ivanm 질문 해 주셔서 감사합니다. 'ghc-pkg' * 거짓말 *이 나에게 나타납니다! –
일종의 http://stackoverflow.com/questions/7252193/can-cabal-not-un-install-packages의 복제본이지만이 플래그가 더 좋기 때문에 플래그를 꺼려합니다. –