Partially fix "make framework-pkg"
[ghc-hetmet.git] / distrib / MacOS / installer-scripts / Uninstaller
index 6ad00d3..696d571 100644 (file)
@@ -5,11 +5,13 @@
 
 INSTALL_DEST=/Library/Frameworks
 INSTALL_BASE=/
+
 if [ ${INSTALL_BASE} = / ]; then
-  INSTALL_BIN=/usr/bin
-else
-  INSTALL_BIN=${INSTALL_BASE}/bin
+  INSTALL_BASE=/usr
 fi
+INSTALL_BIN=${INSTALL_BASE}/bin
+INSTALL_MAN1=${INSTALL_BASE}/share/man/man1
+INSTALL_HTML=${INSTALL_BASE}/share/doc
 
 if [ ! -x ${INSTALL_DEST}/GHC.framework ]; then
   echo "${INSTALL_DEST}/GHC.framework does not exit"
@@ -46,17 +48,28 @@ if [ ${NO_VERSIONS} -ne 2 ]; then
 fi
 
 echo "Removing symbolic links into GHC.framework"
-for thisfile in `ls ${INSTALL_BIN}`; do
-  if ls -l ${INSTALL_BIN}/${thisfile} | grep -q GHC.framework/Versions; then
-    rm -f ${INSTALL_BIN}/${thisfile}
+for thisfile in ${INSTALL_BIN}/*; do
+  if ls -l "${thisfile}" | grep -q GHC.framework/Versions; then
+    rm -f "${thisfile}"
+  fi
+done
+for thisfile in ${INSTALL_MAN1}/*; do
+  if ls -l "${thisfile}" | grep -q GHC.framework/Versions; then
+    rm -f "${thisfile}"
+  fi
+done
+for thisfile in ${INSTALL_HTML}/*; do
+  if ls -l "${thisfile}" | grep -q GHC.framework/Versions; then
+    rm -f "${thisfile}"
   fi
 done
 
 echo "Removing ${INSTALL_DEST}/GHC.framework"
 rm -rf ${INSTALL_DEST}/GHC.framework
 
-echo "Removing package recipts"
+echo "Removing package recipt"
+# The first is for Leopard packages and the second for Tiger packages.
 rm -f /Library/Receipts/boms/org.haskell.glasgowHaskellCompiler.ghc.pkg.bom
-rm -f /Library/Receipts/boms/org.haskell.glasgowHaskellCompiler.uninstaller.pkg
+rm -rf /Library/Receipts/ghc.pkg
 
 echo "${INSTALL_DEST}/GHC.framework has been purged!"