[SCM] icecast2/master: d/icecast2.postinst: Change ed calls to sed. (Closes: #740667)

unit193-guest at users.alioth.debian.org unit193-guest at users.alioth.debian.org
Mon Apr 27 21:47:57 UTC 2015


The following commit has been merged in the master branch:
commit 68ea0324e4b96be241b4569eefe0eba6547d0b44
Author: Unit 193 <unit193 at ubuntu.com>
Date:   Thu Apr 2 21:06:10 2015 -0400

    d/icecast2.postinst: Change ed calls to sed. (Closes: #740667)

diff --git a/debian/icecast2.postinst b/debian/icecast2.postinst
index 0fb621f..a34c79a 100644
--- a/debian/icecast2.postinst
+++ b/debian/icecast2.postinst
@@ -41,11 +41,7 @@ db_get icecast2/icecast-setup
 if test "$RET" = "true"; then
 	if [ -f /etc/default/icecast2 -a -f /etc/icecast2/icecast.xml ]; then
 		echo "Configuring icecast2.." >&2
-		cat << _EOF_ \
-		| ed /etc/default/icecast2 2>/dev/null 1>&2 || true
-%s/^.*ENABLE=.*$/ENABLE=true/
-wq
-_EOF_
+		sed -i s/^.*ENABLE=.*$/ENABLE=true/ /etc/default/icecast2 2>/dev/null 1>&2 || true
 
 		db_get icecast2/sourcepassword
 		ICESOURCE=$RET
@@ -55,14 +51,11 @@ _EOF_
 		ICEADMIN=$RET
 		db_get icecast2/hostname
 		ICEHOST=$RET
-		cat << _EOF_ \
-		| ed /etc/icecast2/icecast.xml 2>/dev/null 1>&2 || true
-%s/<source-password>[^<]*<\/source-password>/<source-password>$ICESOURCE<\/source-password>/
-%s/<relay-password>[^<]*<\/relay-password>/<relay-password>$ICERELAY<\/relay-password>/
-%s/<admin-password>[^<]*<\/admin-password>/<admin-password>$ICEADMIN<\/admin-password>/
-%s/<hostname>[^<]*<\/hostname>/<hostname>$ICEHOST<\/hostname>/
-wq
-_EOF_
+		sed -i 	-e "s|<source-password>[^<]*</source-password>|<source-password>$ICESOURCE</source-password>|" \
+			-e "s|<relay-password>[^<]*</relay-password>|<relay-password>$ICERELAY</relay-password>|" \
+			-e "s|<admin-password>[^<]*</admin-password>|<admin-password>$ICEADMIN</admin-password>|" \
+			-e "s|<hostname>[^<]*</hostname>|<hostname>$ICEHOST</hostname>|" \
+			/etc/icecast2/icecast.xml 2>/dev/null 1>&2 || true
 		echo "Done Configuring icecast2.." >&2
 	fi
 fi

-- 
icecast2 packaging



More information about the pkg-multimedia-commits mailing list