From 95bfe5ff669cf3a9ab9b6791e49567b4be8dab03 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Tue, 8 Sep 2009 15:14:05 -0500
Subject: linhes-config: catch the error when trying to create etcnet dir

---
 abs/core-testing/LinHES-config/PKGBUILD             | 2 +-
 abs/core-testing/LinHES-config/mv_network.py        | 5 ++++-
 abs/mv-core/MythVantage-config/install_functions.sh | 6 +++---
 abs/mv-core/MythVantage-config/mv_network.py        | 5 ++++-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/abs/core-testing/LinHES-config/PKGBUILD b/abs/core-testing/LinHES-config/PKGBUILD
index bc36fc0..31b9ffb 100644
--- a/abs/core-testing/LinHES-config/PKGBUILD
+++ b/abs/core-testing/LinHES-config/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=LinHES-config
 pkgver=2.0
-pkgrel=94
+pkgrel=96
 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev )
 pkgdesc="Install and configure your system"
 depends=(bc libstatgrab  mysql-python expect curl dnsutils parted 
diff --git a/abs/core-testing/LinHES-config/mv_network.py b/abs/core-testing/LinHES-config/mv_network.py
index 3f8de3b..b80e4cc 100755
--- a/abs/core-testing/LinHES-config/mv_network.py
+++ b/abs/core-testing/LinHES-config/mv_network.py
@@ -263,7 +263,10 @@ def setup_interface(netdev,systemconfig):
 
     optionfile=etcnetdir+"/"+netdev+"/options"
     if not os.path.exists(optionfile):
-        os.makedirs(etcnetdir+"/"+netdev)
+	try:
+            os.makedirs(etcnetdir+"/"+netdev)
+	except:
+            pass
         mv_common.cp_and_log(systemconfig["TEMPLATES"]+"/etcnet/eth/options", optionfile)
 
     if netinfo["isactive"] == "1" :
diff --git a/abs/mv-core/MythVantage-config/install_functions.sh b/abs/mv-core/MythVantage-config/install_functions.sh
index 72023bd..83a2bed 100755
--- a/abs/mv-core/MythVantage-config/install_functions.sh
+++ b/abs/mv-core/MythVantage-config/install_functions.sh
@@ -16,8 +16,8 @@ found_remote=1
 function update_db_settings () {
 
  printhl "  setting database value $1 to $2 for $hostname"
- $MYSQLCMD_C "delete from settings where value='${1}' and hostname=\"$hostname\";"
- $MYSQLCMD_C "REPLACE INTO  settings set value='${1}', data='${2}' , hostname=\"$hostname\";"
+ $MYSQLCMD_C "delete from settings where value='${1}' and hostname=\"$hostname\";"  2>/dev/null
+ $MYSQLCMD_C "REPLACE INTO  settings set value='${1}', data='${2}' , hostname=\"$hostname\";" 2>/dev/null
 }
 
 function random_theme () {
@@ -296,7 +296,7 @@ function request_dhcp(){
                 update_db_settings HostNETMASK$ndev "$TEMPVAR"
                 TEMPVAR=`grep new_routers /tmp/dhcpinfo.$ndev |cut -d\= -f2`
                 update_db_settings HostGW$ndev "$TEMPVAR"
-                TEMPVAR=`grep new_domain_name_servers /tmp/dhcpinfo.$ndev |cut  -d\= -f2`
+                TEMPVAR=`grep new_domain_name_servers /tmp/dhcpinfo.$ndev |cut  -d\= -f2| tr -d \"|tr -d \'|cut -d" " -f 1`
                 update_db_settings HostDNS$ndev "$TEMPVAR"
             fi
         fi
diff --git a/abs/mv-core/MythVantage-config/mv_network.py b/abs/mv-core/MythVantage-config/mv_network.py
index 3f8de3b..b80e4cc 100755
--- a/abs/mv-core/MythVantage-config/mv_network.py
+++ b/abs/mv-core/MythVantage-config/mv_network.py
@@ -263,7 +263,10 @@ def setup_interface(netdev,systemconfig):
 
     optionfile=etcnetdir+"/"+netdev+"/options"
     if not os.path.exists(optionfile):
-        os.makedirs(etcnetdir+"/"+netdev)
+	try:
+            os.makedirs(etcnetdir+"/"+netdev)
+	except:
+            pass
         mv_common.cp_and_log(systemconfig["TEMPLATES"]+"/etcnet/eth/options", optionfile)
 
     if netinfo["isactive"] == "1" :
-- 
cgit v0.12