Modified debian/postinst script - check and remove obsolete
authorDragan Dosen <bane@nekkar.carnet.hr>
Tue, 2 Sep 2008 14:53:15 +0000 (16:53 +0200)
committerDragan Dosen <bane@nekkar.carnet.hr>
Tue, 2 Sep 2008 14:53:15 +0000 (16:53 +0200)
"Include /etc/apache2/sites-enabled/[^.#]*" from Apache2
configuration file /etc/apache2/apache2.conf.

debian/changelog
debian/postinst

index 81acff0..48f4c80 100644 (file)
@@ -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 <ddosen@ffzg.hr>  Tue,  2 Sep 2008 16:35:39 +0200
+
 apache2-cn (2.2-3) stable; urgency=low
 
   * Detekcija apache2-cn/sarge konfiguracije (rijeseno: #3160).
index 941cdcc..0588a0f 100755 (executable)
@@ -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.
 #