summary refs log tree commit diff stats
path: root/tools/niminst
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@gmail.com>2016-06-06 01:16:25 +0100
committerDominik Picheta <dominikpicheta@gmail.com>2016-06-06 01:16:25 +0100
commit6c88debd5c85c9d2246b9ecc020e830c161f3de3 (patch)
tree48b66bc909301559766d9dfbd4b730733ca2ba0e /tools/niminst
parentcb76f266faadfbae54016b43d67b244f0217a7e4 (diff)
downloadNim-6c88debd5c85c9d2246b9ecc020e830c161f3de3.tar.gz
Fixed deinstall script after recent install changes.
Diffstat (limited to 'tools/niminst')
-rw-r--r--tools/niminst/deinstall.tmpl25
-rw-r--r--tools/niminst/install.tmpl4
2 files changed, 23 insertions, 6 deletions
diff --git a/tools/niminst/deinstall.tmpl b/tools/niminst/deinstall.tmpl
index 7349abcb4..bbc91d8f3 100644
--- a/tools/niminst/deinstall.tmpl
+++ b/tools/niminst/deinstall.tmpl
@@ -1,5 +1,5 @@
 #? stdtmpl(subsChar='?') | standard
-#proc generateDeinstallScript(c: ConfigData): string = 
+#proc generateDeinstallScript(c: ConfigData): string =
 #  result = "#! /bin/sh\n# Generated by niminst\n"
 #  var proj = c.name.toLower
 
@@ -12,7 +12,7 @@ if [ $# -eq 1 ] ; then
       echo "  /usr/bin"
       echo "  /usr/local/bin"
       echo "  /opt"
-      echo "  <some other dir> (treated like '/opt')"
+      echo "  <some other dir> (treated similar '/opt')"
       exit 1
       ;;
     "/usr/bin")
@@ -21,6 +21,7 @@ if [ $# -eq 1 ] ; then
       libdir=/usr/lib/?proj
       docdir=/usr/share/?proj/doc
       datadir=/usr/share/?proj/data
+      nimbleDir="/opt/nimble/pkgs/?c.nimblePkgName-?c.version/"
       ;;
     "/usr/local/bin")
       bindir=/usr/local/bin
@@ -28,6 +29,15 @@ if [ $# -eq 1 ] ; then
       libdir=/usr/local/lib/?proj
       docdir=/usr/local/share/?proj/doc
       datadir=/usr/local/share/?proj/data
+      nimbleDir="/opt/nimble/pkgs/?c.nimblePkgName-?c.version/"
+      ;;
+    "/opt")
+      bindir="/opt/?proj/bin"
+      configdir="/opt/?proj/config"
+      libdir="/opt/?proj/lib"
+      docdir="/opt/?proj/doc"
+      datadir="/opt/?proj/data"
+      nimbleDir="/opt/nimble/pkgs/?c.nimblePkgName-?c.version/"
       ;;
     *)
       bindir="$1/?proj/bin"
@@ -35,6 +45,7 @@ if [ $# -eq 1 ] ; then
       libdir="$1/?proj/lib"
       docdir="$1/?proj/doc"
       datadir="$1/?proj/data"
+      nimbleDir="$1/?proj"
       ;;
   esac
   echo "removing files..."
@@ -43,7 +54,7 @@ if [ $# -eq 1 ] ; then
   #let f = ff.toUnix
   rm -f $bindir/?f.skipRoot
 #end for
-#for ff in items(c.cat[fcConfig]): 
+#for ff in items(c.cat[fcConfig]):
   #let f = ff.toUnix
   rm -f $configdir/?f.skipRoot
 #end for
@@ -51,6 +62,12 @@ if [ $# -eq 1 ] ; then
   rm -rf $datadir
   rm -rf $libdir
 
+  ## Nimble pkg stuff
+  #for f in items(c.cat[fcNimble]):
+    rm -f $nimbleDir/?f.toUnix
+  #end for
+  rm -f $nimbleDir/?{c.nimblePkgName}.nimble
+
   echo "deinstallation successful"
 else
   echo "?c.displayName deinstallation script"
@@ -59,6 +76,6 @@ else
   echo "  /usr/bin"
   echo "  /usr/local/bin"
   echo "  /opt"
-  echo "  <some other dir> (treated like '/opt')"
+  echo "  <some other dir> (treated similar '/opt')"
   exit 1
 fi
diff --git a/tools/niminst/install.tmpl b/tools/niminst/install.tmpl
index 21768a88f..fa503fa36 100644
--- a/tools/niminst/install.tmpl
+++ b/tools/niminst/install.tmpl
@@ -23,7 +23,7 @@ if [ $# -eq 1 ] ; then
       echo "  /usr/bin"
       echo "  /usr/local/bin"
       echo "  /opt"
-      echo "  <some other dir> (treated like '/opt')"
+      echo "  <some other dir> (treated similar to '/opt')"
       echo "To deinstall, use the command:"
       echo "sh deinstall.sh DIR"
       exit 1
@@ -127,7 +127,7 @@ else
   echo "  /usr/bin"
   echo "  /usr/local/bin"
   echo "  /opt"
-  echo "  <some other dir> (treated like '/opt')"
+  echo "  <some other dir> (treated similar to '/opt')"
   echo "To deinstall, use the command:"
   echo "sh deinstall.sh DIR"
   exit 1