[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r1576 - glibc-package/branches/glibc-2.4/debian/debhelper.in



Author: barbier
Date: 2006-05-29 23:12:56 +0000 (Mon, 29 May 2006)
New Revision: 1576

Modified:
   glibc-package/branches/glibc-2.4/debian/debhelper.in/libc.postinst
Log:
Reuse code from locales.postinst to determine whether a newline
is appended to /etc/ld.so.conf; it is a little but less efficient,
but much simpler.


Modified: glibc-package/branches/glibc-2.4/debian/debhelper.in/libc.postinst
===================================================================
--- glibc-package/branches/glibc-2.4/debian/debhelper.in/libc.postinst	2006-05-29 09:23:32 UTC (rev 1575)
+++ glibc-package/branches/glibc-2.4/debian/debhelper.in/libc.postinst	2006-05-29 23:12:56 UTC (rev 1576)
@@ -146,12 +146,11 @@
     fi
 
     # Add support for /etc/ld.so.conf.d
-    if ! [ -e /etc/ld.so.conf ] ; then 
-       touch /etc/ld.so.conf
+    if [ -e /etc/ld.so.conf ]; then
+	[ -z "$(tail -n 1 /etc/ld.so.conf)" ] || echo >> /etc/ld.so.conf
+    else
+	touch /etc/ld.so.conf
     fi
-    if [ $(awk 'END {print NR}' /etc/ld.so.conf) != $(cat /etc/ld.so.conf | wc -l) ] ; then
-       echo >> /etc/ld.so.conf
-    fi
     if ! grep -q '^include /etc/ld.so.conf.d/*.conf$' /etc/ld.so.conf ; then
        echo 'include /etc/ld.so.conf.d/*.conf' >> /etc/ld.so.conf
     fi



Reply to: