[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#355439: gcc-4.0-base: Debian changelog and copyright lost after upgrade



Matthias Klose wrote:
Sven Joachim writes:

Package: gcc-4.0-base
Version: 4.0.2-10
Severity: serious

It looks as if bug #346171 has raised its ugly head again, since somehow the
files /usr/share/doc/gcc-4.0-base{copyright, changelog.Debian.gz} disappeared
after the upgrade from 4.0.2-9 to 4.0.2-10:


oops, found it, still a libstdc++6-4.0-dev.preinst


No, there is nothing wrong with this preinst. It looks as follows:

,----
| #! /bin/sh -e
|
| case "$1" in
|     upgrade)
| 	# upgrading from older experimental gcc-4.0 package
| 	if [ -d /usr/include/c++/4.0 ] && [ ! -h /usr/include/c++/4.0 ]; then
| 	    mv /usr/include/c++/4.0 /usr/include/c++/4.0.0
| 	    ln -s 4.0.0 /usr/include/c++/4.0
| 	fi
| esac
|
`----

This does nothing in /usr/share/doc.  Actually, there is nothing wrong with
any maintainer script in version 4.0.2-10.  The problem was that the scripts
in the _previous_ version were bad.  Explanation:

After some investigation I found out the reason for the lost changelog and
copyright files.  The problem lies actually in the previous (4.0.2-9) versions
of lib64gcc1 and libgcc1.  These packages contain the files
/usr/share/doc/lib{,64}gcc1/{changelog.Debian.gz,copyright}.  But the preinst
scripts inadvertedly changed the directories to symlinks when upgrading from
an older version:

,----
| #! /bin/sh -e
|
| case "$1" in
|     upgrade)
| 	docdir=/usr/share/doc/libgcc1
| 	if [ -d $docdir ] && [ ! -h $docdir ]; then
| 	    rm -rf $docdir
| 	    ln -s gcc-4.0-base $docdir
| 	fi
| esac
|
`----

is the libgcc1 preinst, for instance.  So /usr/share/doc/libgcc1 became a
symlink to /usr/share/doc/gcc-base-4.0, but /var/lib/dpkg/info/libgcc1.list
still contains the lines

/usr/share/doc/libgcc1/copyright	
/usr/share/doc/libgcc1/changelog.Debian.gz

, with /usr/share/doc/libgcc1 being the same place as
/usr/share/doc/gcc-4.0-base.  You see the problem?  Upgrading to libgcc1
4.0.2-10, dpkg will remove these two files, since they are not in the new
package.  Thus, if the libgcc1 package is unpacked _after_ gcc-4.0-base, the
copyright and Debian changelog are lost, and exactly that happened to me as I
could tell from dpkg's log, an excerpt containing only the affected packages
follows:

2006-03-05 16:27:06 upgrade lib64gcc1 1:4.0.2-9 1:4.0.2-10
2006-03-05 16:27:06 status half-configured lib64gcc1 1:4.0.2-9
2006-03-05 16:27:06 status unpacked lib64gcc1 1:4.0.2-9
2006-03-05 16:27:06 status half-installed lib64gcc1 1:4.0.2-9
2006-03-05 16:27:06 status half-installed lib64gcc1 1:4.0.2-9
2006-03-05 16:27:06 status unpacked lib64gcc1 1:4.0.2-10
2006-03-05 16:27:06 status unpacked lib64gcc1 1:4.0.2-10
2006-03-05 16:27:16 upgrade gcc-4.0-base 4.0.2-9 4.0.2-10
2006-03-05 16:27:16 status half-configured gcc-4.0-base 4.0.2-9
2006-03-05 16:27:16 status unpacked gcc-4.0-base 4.0.2-9
2006-03-05 16:27:16 status half-installed gcc-4.0-base 4.0.2-9
2006-03-05 16:27:16 status half-installed gcc-4.0-base 4.0.2-9
2006-03-05 16:27:16 status unpacked gcc-4.0-base 4.0.2-10
2006-03-05 16:27:16 status unpacked gcc-4.0-base 4.0.2-10
2006-03-05 16:27:16 upgrade libgcc1 1:4.0.2-9 1:4.0.2-10
2006-03-05 16:27:16 status half-configured libgcc1 1:4.0.2-9
2006-03-05 16:27:16 status unpacked libgcc1 1:4.0.2-9
2006-03-05 16:27:16 status half-installed libgcc1 1:4.0.2-9
2006-03-05 16:27:16 status half-installed libgcc1 1:4.0.2-9
2006-03-05 16:27:16 status unpacked libgcc1 1:4.0.2-10
2006-03-05 16:27:16 status unpacked libgcc1 1:4.0.2-10
2006-03-05 16:27:17 status unpacked gcc-4.0-base 4.0.2-10
2006-03-05 16:27:17 status half-configured gcc-4.0-base 4.0.2-10
2006-03-05 16:27:17 status installed gcc-4.0-base 4.0.2-10
2006-03-05 16:27:17 status unpacked libgcc1 1:4.0.2-10
2006-03-05 16:27:17 status half-configured libgcc1 1:4.0.2-10
2006-03-05 16:27:24 status installed libgcc1 1:4.0.2-10
2006-03-05 16:27:35 status unpacked lib64gcc1 1:4.0.2-10
2006-03-05 16:27:35 status half-configured lib64gcc1 1:4.0.2-10
2006-03-05 16:27:35 status installed lib64gcc1 1:4.0.2-10

So the explanation is found.  How to get out of this mess and ensure proper
upgrading of the gcc-4.0 packages is another matter, which is left as an
exercise for you. ;-)

Arguably, it might be a bug in dpkg that it even installed the 4.0.2-9
versions of the packages, since /usr/share/doc/libgcc1/copyright and
/usr/share/doc/gcc-4.0-base/copyright were the same file in these versions and
dpkg should have detected that during unpacking.  I will check the long list
of dpkg bugs to see whether such an issue has already been reported.







Reply to: