From 4a1cc56a4d52ed3024aeb1f60c09e135a6ae6446 Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Mon, 23 Sep 2013 14:44:16 -0500
Subject: keylaunch: keylaunch.install: check if mythtv home exist before
 creating symlink

---
 abs/core/keylaunch/PKGBUILD          |  2 +-
 abs/core/keylaunch/keylaunch.install | 13 ++++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/abs/core/keylaunch/PKGBUILD b/abs/core/keylaunch/PKGBUILD
index d869044..173cdff 100644
--- a/abs/core/keylaunch/PKGBUILD
+++ b/abs/core/keylaunch/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=keylaunch
 pkgver=1.3.9
-pkgrel=7
+pkgrel=8
 arch=('i686' 'x86_64')
 pkgdesc="KeyLaunch is a small utility for binding commands to a hot key. "
 url="http://www.oroborus.org/"
diff --git a/abs/core/keylaunch/keylaunch.install b/abs/core/keylaunch/keylaunch.install
index faa176b..87f8fde 100644
--- a/abs/core/keylaunch/keylaunch.install
+++ b/abs/core/keylaunch/keylaunch.install
@@ -9,13 +9,16 @@ pre_install() {
 # arg 1:  the new package version
 post_install() {
  MHOME=`cat /etc/passwd | grep "mythtv" | cut -d":" -f6`
- if [ ! -e $MHOME/.keylaunchrc ]
+ if [ ! -z $MHOME ]
  then
-	echo "setting symlink for keylaunch"
- 	ln -s /etc/keylaunchrc $MHOME/.keylaunchrc
+    if [ ! -e $MHOME/.keylaunchrc ]
+    then
+	    echo "setting symlink for keylaunch"
+ 	    ln -s /etc/keylaunchrc $MHOME/.keylaunchrc
+    fi
+    echo "updating .keylaunchrc to run mythtv-setup as user"
+    sed -i 's/key=..*s:sudo\ \/usr\/bin\/mythtv-setup/key=..*s:\/usr\/bin\/mythtv-setup/g' $MHOME/.keylaunchrc 
  fi
- echo "updating .keylaunchrc to run mythtv-setup as user"
- sed -i 's/key=..*s:sudo\ \/usr\/bin\/mythtv-setup/key=..*s:\/usr\/bin\/mythtv-setup/g' $MHOME/.keylaunchrc 
 }
 
 # arg 1:  the new package version
-- 
cgit v0.12

