From b0aaaaefbf10a1e20c50cb243fd4b21b283930e0 Mon Sep 17 00:00:00 2001 From: Dragan Dosen Date: Tue, 2 Sep 2008 16:53:15 +0200 Subject: [PATCH] Modified debian/postinst script - check and remove obsolete "Include /etc/apache2/sites-enabled/[^.#]*" from Apache2 configuration file /etc/apache2/apache2.conf. --- debian/changelog | 8 ++++++++ debian/postinst | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/debian/changelog b/debian/changelog index 81acff0..48f4c80 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +apache2-cn (2.2-4) stable; urgency=low + + * debian/postinst - brisanje zastarjele Include linije iz + konfiguracijske datoteke /etc/apache2/apache2.conf, linija: + Include /etc/apache2/sites-enabled/[^.#]* (rijeseno: #3926) + + -- Dragan Dosen Tue, 2 Sep 2008 16:35:39 +0200 + apache2-cn (2.2-3) stable; urgency=low * Detekcija apache2-cn/sarge konfiguracije (rijeseno: #3160). diff --git a/debian/postinst b/debian/postinst index 941cdcc..0588a0f 100755 --- a/debian/postinst +++ b/debian/postinst @@ -615,6 +615,25 @@ for file in $CONF $log_mask; do done +# Check and remove obsolete "Include /etc/apache2/sites-enabled/[^.#]*" from +# /etc/apache2/apache2.conf. +# +if egrep -iq "^[[:space:]]*Include[[:space:]]+\/etc\/apache2\/sites-enabled\/\[\^\.\#\]\*$" "$CONF"; then + + cp_echo "CN: Fixing obsolete Include line in $CONF." + CONFTMP=`mktemp $CONF.tmp.XXXXXX` + sed -r "/^[[:space:]]*Include[[:space:]]+\/etc\/apache2\/sites-enabled\/\[\^\.\#\]\*$/Id" \ + "$CONF" > "$CONFTMP" + + if ! egrep -iq "^[[:space:]]*Include[[:space:]]+\/etc\/apache2\/sites-enabled\/$" "$CONFTMP"; then + echo "Include /etc/apache2/sites-enabled/" >> "$CONFTMP" + fi + + cp_mv "$CONFTMP" "$CONF" + need_restart=1 +fi + + # Start Apache2 web server on boot? # This will enable Apache2 in /etc/default/apache2 file. # -- 1.7.10.4