Hi

On Sat, Feb 06, 2010 at 11:39:09AM +0100, J.M.Roth wrote:
> Package: ntop
> Version: 3:3.3-11+b2
> Severity: normal
> Tags: patch
> 
> 
> First, postrm does not check for the possible location of the init.cfg file 
> in /var/lib/ntop/ => fixed

True and intentional. With the debian package /etc/ntop/init.cfg is
the place where it should be.

> Second, there is no ntop/createuser entry in debconf, as none is added in the 
> config file => check removed

True. But it has been so in the past. It is still there to make
transitions possible. However it has not been there for quite some
time, so it could potentially be removed.
But the way you propose would cause users to be removed always which
is not good.

> Also done some cosmetic changes like indenting etc.

Ok.

> 
> --- postrm      2010-02-06 11:13:56.000000000 +0100
> +++ postrm.new  2010-02-06 11:26:30.000000000 +0100
> @@ -3,37 +3,35 @@
>  if [ "$1" = "purge" ] ; then
> 
>    # source debconf library
> -if [ -f  /usr/share/debconf/confmodule ] ; then
> +  if [ -f /usr/share/debconf/confmodule ]; then
>      . /usr/share/debconf/confmodule
> -fi
> +  fi
> 
> -  INIT="/etc/ntop/init.cfg"
> -  if [ -f $INIT ] ; then
> +  for f in /var/lib/ntop/init.cfg /etc/ntop/init.cfg; do
> +    if [ -f $f ]; then
> +      INIT=$f
> +    fi
> +  done
> +  if [ -n "$INIT" ]; then
>      # parse config file for user
> -if [ -f "$INIT" ] ; then
>      . $INIT
> -fi

What happens if there are no /var/lib/ntop/init.cfg /etc/ntop/init.cfg
files? Then the installation would break. I do not like this one.
The inclusion of /var/lib/ntop/init.cfg can be argued but the
if [ -f "$INIT" ] ; then
line should really be there!
 
>      # remove user
>      if grep -q ^$USER: /etc/passwd; then
> -      db_get ntop/createuser
> -      CREATEUSER=$RET
> -      if [ "$CREATEUSER" = "true" ]; then
> -        deluser $USER;
> -      fi
> +      deluser $USER
>      fi
>    fi

This is old code that should be removed by now. It is a transition
for old systems where this was available. So if the user was created
it should also be removed.

>    # Remove init.cfg file and dir
> -  if [ -d /etc/ntop ] ; then
> -    rm -rf /etc/ntop;
> +  if [ -d /etc/ntop ]; then
> +    rm -rf /etc/ntop
>    fi
>    # remove stored data
> -  if [ -d /var/lib/ntop ] ; then
> -    rm -rf /var/lib/ntop;
> +  if [ -d /var/lib/ntop ]; then
> +    rm -rf /var/lib/ntop
>    fi
> -  if [ -d /var/log/ntop ] ; then
> -    rm -rf /var/log/ntop;
> +  if [ -d /var/log/ntop ]; then
> +    rm -rf /var/log/ntop
>    fi

This is the cosmetic part, right?

The space between the ] and the ; character is actually needed
sometimes. Maybe not in Debian but I keep that rule so I know
it always work.

Best regards,

// Ola

>    db_purge
> 
> -- System Information:
> Debian Release: 5.0.4
>   APT prefers stable
>   APT policy: (500, 'stable')
> Architecture: i386 (i686)
> 
> Kernel: Linux 2.6.26-2-686 (SMP w/2 CPU cores)
> Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
> Shell: /bin/sh linked to /bin/bash
> 
> Versions of packages ntop depends on:
> ii  adduser             3.110                add and remove users and groups
> ii  debconf [debconf-2. 1.5.24               Debian configuration management 
> sy
> ii  libc6               2.7-18lenny2         GNU C Library: Shared libraries
> ii  libcairo2           1.6.4-7              The Cairo 2D vector graphics 
> libra
> ii  libfontconfig1      2.6.0-3              generic font configuration 
> library
> ii  libfreetype6        2.3.7-2+lenny1       FreeType 2 font engine, shared 
> lib
> ii  libgdbm3            1.8.3-3              GNU dbm database routines 
> (runtime
> ii  libglib2.0-0        2.16.6-3             The GLib library of C routines
> ii  libpango1.0-0       1.20.5-5             Layout and rendering of 
> internatio
> ii  libpcap0.8          0.9.8-5              system interface for user-level 
> pa
> ii  libpixman-1-0       0.10.0-2             pixel-manipulation library for X 
> a
> ii  libpng12-0          1.2.27-2+lenny2      PNG library - runtime
> ii  librrd4             1.3.1-4              Time-series data storage and 
> displ
> ii  libssl0.9.8         0.9.8g-15+lenny6     SSL shared libraries
> ii  libx11-6            2:1.1.5-2            X11 client-side library
> ii  libxcb-render-util0 0.2.1+git1-1         utility libraries for X C 
> Binding 
> ii  libxcb-render0      1.1-1.2              X C Binding, render extension
> ii  libxcb1             1.1-1.2              X C Binding
> ii  libxml2             2.6.32.dfsg-5+lenny1 GNOME XML library
> ii  libxrender1         1:0.9.4-2            X Rendering Extension client 
> libra
> ii  zlib1g              1:1.2.3.3.dfsg-12    compression library - runtime
> 
> ntop recommends no packages.
> 
> Versions of packages ntop suggests:
> ii  graphviz      2.20.2-3                   rich set of graph drawing tools
> ii  gsfonts       1:8.11+urwcyr1.0.7~pre44-3 Fonts for the Ghostscript 
> interpre
> 
> -- debconf information:
> * ntop/interfaces: eth0
> * ntop/user: ntop
> 
> 
> 

-- 
 --------------------- Ola Lundqvist ---------------------------
/  o...@debian.org                     Annebergsslingan 37      \
|  o...@inguza.com                      654 65 KARLSTAD          |
|  http://inguza.com/                  +46 (0)70-332 1551       |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9 /
 ---------------------------------------------------------------



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to