[hardy] tirc prerm script has syntax error; causes failure on uninstall

Bug #281129 reported by Steve Beattie
8
Affects Status Importance Assigned to Milestone
tirc (Ubuntu)
Won't Fix
Low
Unassigned
Hardy
Fix Released
Low
Unassigned

Bug Description

Binary package hint: tirc

steve@h-i-upgrade-ia32:~$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 8.04.1
Release: 8.04
Codename: hardy

steve@h-i-upgrade-ia32:~$ apt-cache policy tirc
tirc:
  Installed: 1.2-11
  Candidate: 1.2-11
  Version table:
 *** 1.2-11 0
        500 http://192.168.1.210 hardy/universe Packages
        100 /var/lib/dpkg/status

steve@h-i-upgrade-ia32:~$ sudo apt-get remove tirc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  tirc
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 385kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 329810 files and directories currently installed.)
Removing tirc ...
[: 11: missing ]
/var/lib/dpkg/info/tirc.prerm: 11: remove: not found

Looking at the contents of /var/lib/dpkg/info/tirc.prerm, it contains the follwoing bit of shell code:

  if [ \( "$1" = "upgrade" || "$1" = "remove" \) -a -L /usr/doc/$pkg ]; then
    rm -f /usr/doc/$pkg
  fi

Unfortunately, while || is valid for or'ing the result of two programs,
it does not work inside of a test/'[' statement; -o needs to be used
instead; i.e. the code needs to be changed to:

--- /var/lib/dpkg/info/tirc.prerm.orig 2008-10-10 02:42:40.576821990 -0400
+++ /var/lib/dpkg/info/tirc.prerm 2008-10-10 02:42:50.792795439 -0400
@@ -6,6 +6,6 @@

 pkg=tirc

-if [ \( "$1" = "upgrade" || "$1" = "remove" \) -a -L /usr/doc/$pkg ]; then
+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/$pkg ]; then
   rm -f /usr/doc/$pkg
 fi

While tirc has been dropped from intrepid, I noticed this in
a test upgrade from hardy to the intrepid beta.

Changed in tirc:
assignee: nobody → andrewsomething
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :
Changed in tirc:
assignee: andrewsomething → nobody
status: Confirmed → Triaged
Revision history for this message
Luca Falavigna (dktrkranz) wrote :

This has been deleted in Intrepid, marking as won't fix.
Anyway, this could be fixed for Hardy, ACK from motu-sru.

Changed in tirc:
status: Triaged → Won't Fix
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Sponsored to hardy-proposed.

Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into hardy-proposed, please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in tirc:
status: Confirmed → Fix Committed
Revision history for this message
Steve Beattie (sbeattie) wrote :

I can reconfirm that tirc 1.2-11 from hardy has the described problem, and that the package in hardy-proposed, tirc 1.2-11ubuntu0.1, uninstalls successfully. A token effort at using tirc as an irc client didn't show any obvious regressions, either.

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in tirc:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.