https://wiki.haskell.org/index.php?title=User:Benmachine/uninstall.sh&feed=atom&action=history
User:Benmachine/uninstall.sh - Revision history
2024-03-19T11:29:51Z
Revision history for this page on the wiki
MediaWiki 1.35.5
https://wiki.haskell.org/index.php?title=User:Benmachine/uninstall.sh&diff=51843&oldid=prev
Benmachine at 00:53, 6 September 2012
2012-09-06T00:53:33Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 00:53, 6 September 2012</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><<del class="diffchange diffchange-inline">code</del>></div></td>
<td class="diff-marker">+</td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><<ins class="diffchange diffchange-inline">pre</ins>></div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#!/bin/bash -eu</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>#!/bin/bash -eu</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># Usage: ./uninstall.sh [--force | --no-unregister] pkgname</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># Usage: ./uninstall.sh [--force | --no-unregister] pkgname</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 31:</td>
<td colspan="2" class="diff-lineno">Line 31:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>then rm -rfv -- ~/.cabal/share/doc/$1 # then wipe the docs as well</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>then rm -rfv -- ~/.cabal/share/doc/$1 # then wipe the docs as well</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>fi</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>fi</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div></<del class="diffchange diffchange-inline">code</del>></div></td>
<td class="diff-marker">+</td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div></<ins class="diffchange diffchange-inline">pre</ins>></div></td>
</tr>
<!-- diff cache key wikidb_haskell:diff:wikidiff2:1.12:old-51842:rev-51843:1.10.0 -->
</table>
Benmachine
https://wiki.haskell.org/index.php?title=User:Benmachine/uninstall.sh&diff=51842&oldid=prev
Benmachine: New page: <code> #!/bin/bash -eu # Usage: ./uninstall.sh [--force | --no-unregister] pkgname # Specify the version as well! # if you set VER in the environment to e.g. "-7.0.1" you can use # the gh...
2012-09-06T00:52:09Z
<p>New page: <code> #!/bin/bash -eu # Usage: ./uninstall.sh [--force | --no-unregister] pkgname # Specify the version as well! # if you set VER in the environment to e.g. "-7.0.1" you can use # the gh...</p>
<p><b>New page</b></p><div><code><br />
#!/bin/bash -eu<br />
# Usage: ./uninstall.sh [--force | --no-unregister] pkgname<br />
# Specify the version as well!<br />
<br />
# if you set VER in the environment to e.g. "-7.0.1" you can use<br />
# the ghc-pkg associated with a different GHC version<br />
: ${VER:=}<br />
<br />
if [ "$1" == "--force" ]<br />
then force=--force; shift; # passed to ghc-pkg unregister<br />
else force=<br />
fi<br />
<br />
if [ "$1" == "--no-unregister" ]<br />
then shift # skip unregistering and just delete files<br />
else<br />
if [ "$(ghc-pkg$VER latest $1)" != "$1" ]<br />
then <br />
# full version not specified: list options and exit<br />
ghc-pkg$VER list $1; exit 1<br />
fi<br />
ghc-pkg$VER unregister $force $1<br />
fi<br />
<br />
# wipe library files<br />
rm -rfv -- ~/.cabal/lib/$1/ghc-$(ghc$VER --numeric-version)/<br />
<br />
# if the directory is left empty, i.e. not on any other GHC version<br />
if rmdir -- ~/.cabal/lib/$1 <br />
then rm -rfv -- ~/.cabal/share/doc/$1 # then wipe the docs as well<br />
fi<br />
</code></div>
Benmachine