[Lunar-commits] r27013 - lunar/branches/stable/var/lib/lunar/functions

Auke Kok sofar at lunar-linux.org
Mon Mar 3 19:12:43 CET 2008


Author: sofar
Date: 2008-03-03 19:12:43 +0100 (Mon, 03 Mar 2008)
New Revision: 27013

Modified:
   lunar/branches/stable/var/lib/lunar/functions/misc.lunar
   lunar/branches/stable/var/lib/lunar/functions/view.lunar
Log:
Merge from theedge: ld_add|remove, utf-8 view support


Modified: lunar/branches/stable/var/lib/lunar/functions/misc.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/misc.lunar	2008-02-28 22:19:01 UTC (rev 27012)
+++ lunar/branches/stable/var/lib/lunar/functions/misc.lunar	2008-03-03 18:12:43 UTC (rev 27013)
@@ -24,8 +24,44 @@
 #                                                          #
 ############################################################
 
+# function : ld_add
+# usage    : ld_add <directory>
+# purpose  : Add a path to ld.so.conf
 
+ld_add() {
+	debug_msg "ld_add ($@)"
 
+	if [ ! -z "$1" ] && [ -d "$1" ] ; then
+		if [ ! `grep -s $1 /etc/ld.so.conf` ] ; then
+			verbose_msg "Adding $1 to ld.so.conf"
+			echo "$1" >> /etc/ld.so.conf
+			ldconfig
+		fi
+	fi
+}
+
+# function : ld_remove
+# usage    : ld_remove <directory>
+# purpose  : Remove a path from ld.so.conf
+
+ld_remove() {
+	debug_msg "ld_remove ($@)"
+
+	if [ ! -z "$1" ] && [ -d "$1" ] ; then
+		if [ `grep -s $1 /etc/ld.so.conf` ] ; then
+
+			TMP_LD_CONF=$(temp_create "ldsoconf")
+			verbose_msg "Removing $1 from ld.so.conf"
+
+			grep -v $1 /etc/ld.so.conf > $TMP_LD_CONF
+			cat $TMP_LD_CONF > /etc/ld.so.conf
+			ldconfig
+
+			temp_destroy $TMP_LD_CONF
+		fi
+	fi
+}
+
 # function : directories
 # usage    : VARIABLE=`directories < dirlistfile`
 # purpose  : to determine the directories from a given list

Modified: lunar/branches/stable/var/lib/lunar/functions/view.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/view.lunar	2008-02-28 22:19:01 UTC (rev 27012)
+++ lunar/branches/stable/var/lib/lunar/functions/view.lunar	2008-03-03 18:12:43 UTC (rev 27013)
@@ -14,13 +14,14 @@
     # show a file $1
     case $(file -b $1 | cut -d' ' -f1) in
       ASCII) cat $1         | ${PAGER:-less} ;;
+      UTF-8) cat $1         | ${PAGER:-less} ;;
       bzip2) cat $1 | bzcat | ${PAGER:-less} ;;
        gzip) cat $1 | zcat  | ${PAGER:-less} ;;
        data) cat $1         | ${PAGER:-less} ;;
     esac
   else
     cat | ${PAGER:-less}
-  fi  
-}  
+  fi
+}
 
 



More information about the Lunar-commits mailing list