SDB: remove sdb autocomplete script when uninstall 35/15335/2
authorho.namkoong <ho.namkoong@samsung.com>
Mon, 20 Jan 2014 02:36:36 +0000 (11:36 +0900)
committerho.namkoong <ho.namkoong@samsung.com>
Mon, 20 Jan 2014 02:39:52 +0000 (11:39 +0900)
in ~/.basrc, scripts for enabling sdb autocomplete is inserted.
Removed those scripts when sdb is uninstalled

Change-Id: Ib1fb0b1699e35c6dfc696259048a58f40fe28064
Signed-off-by: ho.namkoong <ho.namkoong@samsung.com>
package/sdb.install.linux
package/sdb.remove.linux

index 5e56579a29494af97ece913d9857e66172b7d726..6ebec65abbd495065a2d6160ba49bb9d0c8a3923 100755 (executable)
@@ -12,10 +12,10 @@ mv -f ${SDB_AC_SRC_PATH} ${SDB_AC_DST_PATH}
 
 if [ -f "${BASH_RC}" ]; then
     if [ -z $(grep "source ~/\.sdb/\.sdb-completion\.bash" "${BASH_RC}") ]; then
-        echo -e "\n# Enable programmable sdb completion features.\nsource ~/.sdb/.sdb-completion.bash\n" >> "${BASH_RC}"
+        echo -e "# Enable programmable sdb completion features.\nsource ~/.sdb/.sdb-completion.bash\n" >> "${BASH_RC}"
     fi
 else
-    echo -e "\n# Enable programmable sdb completion features.\nsource ~/.sdb/.sdb-completion.bash\n" >> "${BASH_RC}"
+    echo -e "# Enable programmable sdb completion features.\nsource ~/.sdb/.sdb-completion.bash\n" >> "${BASH_RC}"
 fi
 
 # . /etc/bash_completion
index fa1fc1c60f974b99dcde5d5c654ad58f060dc91c..306a5b44767201c8fa3cea5e81522f7be88d0f89 100755 (executable)
@@ -1,10 +1,14 @@
 #!/bin/bash -ex
 SDB_PATH=tools/sdb
-${INSTALLED_PATH}/${SDB_PATH} kill-server
-SDB_AC_NAME=sdb-autocomplete
+if [ -f ${INSTALLED_PATH}/${SDB_PATH}]; then
+    ${INSTALLED_PATH}/${SDB_PATH} kill-server
+fi
 
 rm -rf ${INSTALLED_PATH}/${SDB_PATH}
 rm -rf ~/.sdb
+if [ -f ~/.bashrc ]; then
+    sed -i -E '/# Enable programmable sdb completion features\.|source ~\/\.sdb\/\.sdb-completion\.bash/d' ~/.bashrc
+fi
 
 exit 0