Error in postinstall script

Bug #6371 reported by Yann Rouillard
4
Affects Status Importance Assigned to Milestone
preload (Ubuntu)
Fix Released
Low
MOTU Reviewers Team

Bug Description

I get the following error when I try to install preload:
/var/lib/dpkg/info/preload.postinst: line 25: [: =: unary operator expected

full output is:
sudo apt-get install preload
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  preload
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0B/31.6kB of archives.
After unpacking 176kB of additional disk space will be used.
Selecting previously deselected package preload.
(Reading database ... 136104 files and directories currently installed.)
Unpacking preload (from .../preload_0.2-4_i386.deb) ...
Setting up preload (0.2-4) ...
/var/lib/dpkg/info/preload.postinst: line 25: [: =: unary operator expected
Starting preload: preload.

Revision history for this message
Yann Rouillard (yann-pleiades) wrote : Simple bug fix patch

The error was caused by missing quotes around a variable:

case "$1" in
    configure)

    # This was supposed to go to /var/lib/preload/
    # (rm this after etch=stable?)
    if [ $2 = '0.2-1' ] ; then
        rm /var/cache/preload.state || true
    fi
    ;;

variable $2 is empty when the package is installed for the first time, hence the error message.

Changed in preload:
assignee: nobody → motureviewers
Changed in preload:
status: Unconfirmed → Fix Committed
Revision history for this message
Zak B. Elep (zakame) wrote :

Thanks for the patch! =) Please set to "Fix Committed" only if the updated package has been uploaded into the archive, to which end I'm now working on.

Changed in preload:
status: Fix Committed → In Progress
Zak B. Elep (zakame)
Changed in preload:
status: In Progress → Fix Committed
Zak B. Elep (zakame)
Changed in preload:
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.