[Pkg-samba-maint] r1676 - trunk/samba/debian

vorlon at alioth.debian.org vorlon at alioth.debian.org
Thu Dec 13 09:16:06 UTC 2007


Author: vorlon
Date: 2007-12-13 09:16:06 +0000 (Thu, 13 Dec 2007)
New Revision: 1676

Modified:
   trunk/samba/debian/changelog
   trunk/samba/debian/samba-common.postinst
Log:
switch to using sed -i, cleanup to facilitate switching to ucf

Modified: trunk/samba/debian/changelog
===================================================================
--- trunk/samba/debian/changelog	2007-12-13 08:19:53 UTC (rev 1675)
+++ trunk/samba/debian/changelog	2007-12-13 09:16:06 UTC (rev 1676)
@@ -1,3 +1,9 @@
+samba (3.0.28-2) UNRELEASED; urgency=low
+
+  * 
+
+ -- Steve Langasek <vorlon at debian.org>  Thu, 13 Dec 2007 01:15:49 -0800
+
 samba (3.0.28-1) unstable; urgency=high
 
   * New upstream release. Security fix

Modified: trunk/samba/debian/samba-common.postinst
===================================================================
--- trunk/samba/debian/samba-common.postinst	2007-12-13 08:19:53 UTC (rev 1675)
+++ trunk/samba/debian/samba-common.postinst	2007-12-13 09:16:06 UTC (rev 1676)
@@ -13,9 +13,6 @@
 	cp -a /usr/share/samba/smb.conf /etc/samba/
 fi
 
-# Static tempfile location, dpkg-style
-TMPFILE=/etc/samba/smb.conf.dpkg-tmp
-
 # ------------------------- Debconf questions start ---------------------
 
 # Is the user configuring with debconf, or he/she prefers swat/manual
@@ -34,21 +31,19 @@
 	                  s/&/\\\&/g
 	                  s/\\\$/\\\\\\\$/g'`
 
-	sed -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i
+	sed -i -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i
 		/^[[:space:]]*\[global\]/,/^[[:space:]]*\[/ \
 			s/^\([[:space:]]*\)workgroup[[:space:]]*=.*/\1workgroup = ${WORKGROUP}/i" \
-		< /etc/samba/smb.conf >${TMPFILE}
-	mv -f ${TMPFILE} /etc/samba/smb.conf
+		/etc/samba/smb.conf
 
 	# Encrypt passwords?
 	db_get samba-common/encrypt_passwords || true
 	ENCRYPT_PASSWORDS="${RET}"
 
-	sed -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i
+	sed -i -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i
 		/^[[:space:]]*\[global\]/,/^[[:space:]]*\[/ \
 		        s/^\([[:space:]]*\)encrypt passwords[[:space:]]*=.*/\1encrypt passwords = ${ENCRYPT_PASSWORDS}/i" \
-		< /etc/samba/smb.conf >${TMPFILE}
-	mv -f ${TMPFILE} /etc/samba/smb.conf
+		/etc/samba/smb.conf
 
 	# Install DHCP support
 	db_get samba-common/dhcp && DHCPVAL="$RET"
@@ -56,14 +51,13 @@
 	if [ "$DHCPVAL" = true ] && [ "$RET" != true ] && \
 	   ! grep -q dhcp.conf /etc/samba/smb.conf
 	then
-		sed -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i
+		sed -i -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i
 			/^[[:space:]]*\[global\]/,/^[[:space:]]*\[/ {
 				/wins server[[:space:]]*=/a \\
 \\
 # If we receive WINS server info from DHCP, override the options above. \\
    include = /etc/samba/dhcp.conf
-}" < /etc/samba/smb.conf > ${TMPFILE}
-		mv -f ${TMPFILE} /etc/samba/smb.conf
+}" /etc/samba/smb.conf
 	elif [ "$RET" != true ] && grep -q dhcp.conf /etc/samba/smb.conf
 	then
 		:
@@ -77,21 +71,19 @@
 
 	if grep -qi "^[[:space:]]*passdb backend[[:space:]]*=.*unixsam" /etc/samba/smb.conf
 	then
-		sed -e 's/^\([[:space:]]*\)passdb backend/\1passdb backend/i
+		sed -i -e 's/^\([[:space:]]*\)passdb backend/\1passdb backend/i
 			/^[[:space:]]*passdb backend/ {
 				s/unixsam/guest/i
-			}' < /etc/samba/smb.conf > ${TMPFILE}
-		mv -f ${TMPFILE} /etc/samba/smb.conf
+			}' /etc/samba/smb.conf
 	fi
 
 	if [ -n "$2" ] && dpkg --compare-versions "$2" lt 3.0.23b-2 \
 	   && grep -qi "^[[:space:]]*passdb backend[[:space:]]*=.*guest" /etc/samba/smb.conf
 	then
-		sed -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i
+		sed -i -e "s/^\([[:space:]]*\)\[global\]/\1\[global\]/i
 			/^[[:space:]]*\[global\]/,/^[[:space:]]*\[/ \
 			        s/^\([[:space:]]*passdb backend[[:space:]]*=[^,]*\),\?[[:space:]]*guest[[:space:]]*$/\1/i" \
-			< /etc/samba/smb.conf >${TMPFILE}
-		mv -f ${TMPFILE} /etc/samba/smb.conf
+			/etc/samba/smb.conf
 	fi
 fi
 




More information about the Pkg-samba-maint mailing list