Ajout : rangement.
[tool/hledger.git] / script / ghc-pkg-reset
diff --git a/script/ghc-pkg-reset b/script/ghc-pkg-reset
new file mode 100755 (executable)
index 0000000..3870706
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh -eux
+
+# DESCRIPTION: remove all installed GHC/cabal packages,
+# leaving ~/.cabal binaries and docs in place.
+# When all else fails, use this to get out of dependency hell and start over.
+read -p 'erasing all your user ghc and cabal packages - are you sure (y/n) ? ' ans
+test x$ans == xy && ( \
+       echo 'erasing directories under ~/.ghc'; rm -rf `find ~/.ghc -maxdepth 1 -type d`; \
+       echo 'erasing ~/.cabal/lib'; rm -rf ~/.cabal/lib; \
+       # echo 'erasing ~/.cabal/packages'; rm -rf ~/.cabal/packages; \
+       # echo 'erasing ~/.cabal/share'; rm -rf ~/.cabal/share; \
+ )