[Lunar-commits] r27011 - lunar/trunk/var/lib/lunar/functions

Moritz Heiber moe at lunar-linux.org
Thu Feb 28 18:25:04 CET 2008


Author: moe
Date: 2008-02-28 18:25:04 +0100 (Thu, 28 Feb 2008)
New Revision: 27011

Modified:
   lunar/trunk/var/lib/lunar/functions/misc.lunar
Log:
Adjusting ld_remove to use a temporary file in order to store the new
ld configuration. Thanks for Stefan for the suggestion.



Modified: lunar/trunk/var/lib/lunar/functions/misc.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/misc.lunar	2008-02-28 07:24:53 UTC (rev 27010)
+++ lunar/trunk/var/lib/lunar/functions/misc.lunar	2008-02-28 17:25:04 UTC (rev 27011)
@@ -46,16 +46,17 @@
 
 ld_remove() {
 	debug_msg "ld_remove ($@)"
+	TMP_LD_CONF=$(temp_create "ldsoconf")
 
 	if [ ! -z "$1" ] && [ -d "$1" ] ; then
 		if [ `grep -s $1 /etc/ld.so.conf` ] ; then
 			verbose_msg "Removing $1 from ld.so.conf"
-			grep -v $1 /etc/ld.so.conf > /etc/ld.so.conf.new
-			rm /etc/ld.so.conf
-			mv /etc/ld.so.conf.new /etc/ld.so.conf
+			grep -v $1 /etc/ld.so.conf > $TMP_LD_CONF
+			cat $TMP_LD_CONF > /etc/ld.so.conf
 			ldconfig
 		fi
 	fi
+	temp_destroy $TMP_LD_CONF
 }
 
 # function : directories



More information about the Lunar-commits mailing list