Bug#440384: apt-listchanges: Once package is removed, listchanges.conf is not created even if it is reinstalled.

2007-12-06 Thread Morita Sho

Hi,

> Once package is removed, listchanges.conf is not created even if it is 
reinstalled:


I confirmed this bug, too.

After reviewing apt-listchanges package,
I found an error in postrm script.


On postrm script of apt-listchanges, following `if` statement is used to
check whether ucf command is available.

  if [ ucf --help > /dev/null 2>&1 ]; then

However, this is wrong. `[` is needless.
`[` is a command for check file types and compare values.
`[` cannot be used to check whether any command is available or not.
(See man [ for details.)

Because [ ucf --help > /dev/null 2>&1 ] returns FALSE,
  ucf -p /etc/apt/listchanges.conf
is never called.
And /etc/apt/listchanges.conf is never created on reinstallation.


It should be written like this:

  if ucf --help > /dev/null 2>&1; then

Or, example in ucf uses this form:

  if which ucf >/dev/null; then

Since ucf is a perl script, I think `which` form is faster and better.


I have made a patch to fix this problem.

--- debian/postrm.orig  2007-12-07 06:24:52.0 +0900
+++ debian/postrm   2007-12-07 06:19:45.0 +0900
@@ -11,7 +11,7 @@
 if [ "$1" = "purge" ]; then
 rm -f $hook.disabled
 rm -f /var/lib/apt/listchanges.db
-if [ ucf --help > /dev/null 2>&1 ]; then
+if which ucf > /dev/null; then
 ucf -p /etc/apt/listchanges.conf
 fi
 rm -f /etc/apt/listchanges.conf


Thanks,
--
Morita Sho <[EMAIL PROTECTED]>



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#440384: apt-listchanges: Once package is removed, listchanges.conf is not created even if it is reinstalled.

2007-08-31 Thread KIMURA Yasuhiro
Package: apt-listchanges
Version: 2.74
Severity: normal


Once package is removed, listchanges.conf is not created even if it is 
reinstalled:

fight:~# apt-get remove --purge apt-listchanges
Reading package lists... Done
Building dependency tree   
Reading state information... Done
The following packages will be REMOVED:
  apt-listchanges*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 229kB disk space will be freed.
Do you want to continue [Y/n]? 
(Reading database ... 65946 files and directories currently installed.)
Removing apt-listchanges ...
Purging configuration files for apt-listchanges ...
fight:~# apt-get install apt-listchanges
Reading package lists... Done
Building dependency tree   
Reading state information... Done
The following NEW packages will be installed:
  apt-listchanges
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/66.4kB of archives.
After unpacking 229kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package apt-listchanges.
(Reading database ... 65915 files and directories currently installed.)
Unpacking apt-listchanges (from .../apt-listchanges_2.74_all.deb) ...
Setting up apt-listchanges (2.74) ...
Not replacing deleted config file /etc/apt/listchanges.conf
fight:~# 

dpkg-reconfigure does not work either:

fight:~# dpkg-reconfigure apt-listchanges
Not replacing deleted config file /etc/apt/listchanges.conf
fight:~# 

"ucf --purge /etc/apt/listchanges.conf" solves this situation:

fight:~# ucf --purge /etc/apt/listchanges.conf
fight:~# dpkg-reconfigure apt-listchanges

Creating config file /etc/apt/listchanges.conf with new version
fight:~# 

But I don't think it is right way of reinstallation.

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

Kernel: Linux 2.6.22-1-686 (SMP w/2 CPU cores)
Locale: LANG=ja_JP.eucJP, LC_CTYPE=ja_JP.eucJP (charmap=EUC-JP)
Shell: /bin/sh linked to /bin/bash

Versions of packages apt-listchanges depends on:
ii  apt   0.7.6  Advanced front-end for dpkg
ii  debconf [debconf-2.0] 1.5.14 Debian configuration management sy
ii  debianutils   2.23.1 Miscellaneous utilities specific t
ii  python2.4.4-6An interactive high-level object-o
ii  python-apt0.7.3.1Python interface to libapt-pkg
ii  python-support0.6.4  automated rebuilding support for p
ii  ucf   3.001  Update Configuration File: preserv

Versions of packages apt-listchanges recommends:
ii  postfix [mail-transport-agent 2.4.5-3High-performance mail transport ag

-- debconf information:
* apt-listchanges/confirm: false
* apt-listchanges/which: news
* apt-listchanges/frontend: pager
* apt-listchanges/email-address: root
* apt-listchanges/save-seen: true


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]