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.000000000 +0900
+++ debian/postrm       2007-12-07 06:19:45.000000000 +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]

Reply via email to