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

Bug#435398: apache2.2-common: a2dissite should distinguish already disabled and missing sites



Package: apache2.2-common
Version: 2.2.3-5
Severity: normal
Tags: patch

a2dissite does not distinguish sites that are already disabled from
those that are missing.  It exits with code 1 in either case, which is
unfortunate for use in postrm scripts and similar situations.  It's
also inconsistent with the other a2* scripts.  Attached is a patch that
improves the behavior.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-2-k7 (SMP w/2 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages apache2.2-common depends on:
ii  apache2-utils                 2.2.3-5    utility programs for webservers
ii  libmagic1                     4.21-2     File type determination library us
ii  lsb-base                      3.1-23.1   Linux Standard Base 3.1 init scrip
ii  mime-support                  3.39-1     MIME files 'mime.types' & 'mailcap
ii  net-tools                     1.60-17    The NET-3 networking toolkit
ii  procps                        1:3.2.7-3  /proc file system utilities

apache2.2-common recommends no packages.

-- no debconf information
--- a2dissite.orig	2007-07-31 15:29:57.000000000 +0200
+++ a2dissite	2007-07-31 15:31:06.000000000 +0200
@@ -19,7 +19,11 @@
 
 if ! [ -e $SYSCONFDIR/sites-enabled/$SITENAME -o \
        -e $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" ]; then
-	echo "This site is already disabled, or does not exist!"
+	if [ -e $SYSCONFDIR/sites-available/$SITENAME ]; then
+		echo "This site is already disabled!"
+		exit 0
+	fi
+	echo "This site does not exist!"
 	exit 1
 fi
 

Reply to: