Package: dbconfig-common
Version: 1.8.38ubuntu1
Severity: major

  When I upgrade my package version from 1.5.5 --> 1.12, with mysql's script
for upgrade named : 1.6, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.8,
1.9, 1.10,
  1.10.1, 1.10.2, 1.10.3, 1.10.4 1.11 and 1.12

To have a transcript, you can use the /usr/share/doc/dbconfig-
common/examples/db-test-mysql-2.1

1. Rename the package:
/usr/share/doc/dbconfig-common/examples/db-test-mysql-2.1 to
/usr/share/doc/dbconfig-common/examples/db-test-mysql-1.5.5
don't forget to update your changelog
2. install the first package (dpkg -i your_package_name_1.5.5_all.deb).

3. Create a new package db-test-mysql-1.12 with mysql upgrade's files from:
mysql-upgrade_1.6, mysql-upgrade_1.7, mysql-upgrade_1.7.1,
mysql-upgrade_1.7.2,
mysql-upgrade_1.7.3, ... mysql-upgrade_1.10.1, mysql-upgrade_1.10.2,
mysql-upgrade_1.10.3, mysql-upgrade_1.11, mysql-upgrade_1.12 with a script
to upgrade the version
of the database: update mytable set version='1.10.1' for example for
mysql-upgrade_1.10.1;

4. Generate your package

5. Upgrade your package (dpkg -i your_package_name_1.12_all.deb)

The result is:

    applying upgrade sql for 1.5.5 -> 1.6.
    applying upgrade sql for 1.5.5 -> 1.7.
    applying upgrade sql for 1.5.5 -> 1.7.1.
    applying upgrade sql for 1.5.5 -> 1.7.2.
    applying upgrade sql for 1.5.5 -> 1.7.3.
    applying upgrade sql for 1.5.5 -> 1.7.4.
    applying upgrade sql for 1.5.5 -> 1.7.5.
    applying upgrade sql for 1.5.5 -> 1.7.6.
    applying upgrade sql for 1.5.5 -> 1.8.
    applying upgrade sql for 1.5.5 -> 1.9.
    applying upgrade sql for 1.5.5 -> 1.10.

Some scripts (1.10.1, 1.10.2, 1.10.3, 1.10.4 1.11 and 1.12) are not applied.


I suggest that the function dbc_find_upgrades() that sort files and return
the list of the files sorted, in /usr/share/dbconfig-common/dpkg/postinst,
be corrected.

Specially replace this script:
from line 248 to 258:

    # if we haven't already placed it
    if [ ! "$placed" ]; then
        # if the this version is less than the next sorted one
        if dpkg --compare-versions $f lt $s; then
            # insert it here
            tlist="$tlist $f $s"
            placed="yes"
        else
            # it's not less, so append the sorted one and continue
            tlist="$tlist $s"
        fi
    fi

with:
    # if we haven't already placed it
        if [ ! "$placed" ]; then
            # if the this version is less than the next sorted one
            if dpkg --compare-versions $f lt $s; then
                # insert it here
                tlist="$tlist $f"
                placed="yes"
            fi
        fi
        tlist="$tlist $s"

  I am using Ubuntu GNU/Linux 8.04 LTS, kernel 2.6.24-23-server and libc6
Version: 2.7-10ubuntu5

-- 
*Ghislain Mokolomboka*

*Dvidea
Paris Innovation Massena - Hall B - 7ème étage
15, rue Jean-Baptiste Berlier
75013 Paris
www.dvidea.com
Tel: +33 1 55 43 79 04
Fax: +33 1 55 43 75 01*

Reply via email to