I think I am finally closing in on this old bug. At least I believe I understand now the mechanism of the bug where "apt-get upgrade" wants to install packages although they are already installed. The other one where "fink -b install" doesn't want to realize that files are available on the server is most likely related, but I haven't yet understood the mechanism completely.

Dave Vasilevsky wrote:

On Jun 29, 2005, at 8:07 AM, Martin Costabel wrote:

Using a local server for unstable debs, I have a long-standing quibble with apt-get: It often doesn't understand that a package is already installed and "apt-get dist-upgrade" downloads and installs many packages, sometimes hundreds of packages, whose exact same version is already installed. I have complained about this on the lists and have a bug tracker item open, but apparently no one else understands this either, although it has been observed by others already years ago, at least every time a new bindist comes out.


Martin,

We know that this happens, and it kinda sucks. But I've never been able to figure it out exactly. I usually end up accidentally letting an apt-get upgrade finish, and then the problem goes away. Since I don't know how to reproduce it, it just leaves me kinda confused and without any way to test further.

If anybody can reproduce it consistently, please tell me how so I can debug it.

This one comes from the "Installed-Size:" field in the DEBIAN/control file. apt-get compares package versions not only by their version-revision number, but also by a VersionHash number which is computed by taking into account several fields of the control file (in apt-pkg/deb/deblistparser.cc), in particular the Installed-Size field. Therefore two copies of the same package with the same version, but different Installed-Size values are considered different, and in the apt-cache commands "dump", "show", "showpkg" they are listed as separate versions.

The Installed-Size field is computed by fink, and until a year ago fink changed its mind several times about the way how (and if) to compute this value. I find quite a few packages on my systems that don't have any Installed-Size field at all. In addition, packages compiled on different machines can often have different values for this field.

The result is that when a package is installed locally, but the same version on the bindist server has a different Installed-Size, apt-get upgrade will download and install the remote version.

I have a symmetrical problem with fink --use-binary-dist: It very often, and apparently randomly, refuses to use the binary dist, although the package it is going to install does exist there.

If I understand correctly how fink determines if a package is apt-gettable, it can trip over the problem with different Installed-Size fields, too: It looks at the output of "apt-cache dump" and if the remote version has a different Installed-Size from the locally installed version, the dump shows the same version with several different "File:" fields; if the last one of these is /sw/var/lib/dpkg/status, the version is marked as not apt-gettable, although the version may exist on the remote server. I don't understand, however, how this can happen for a package version that is not yet locally installed, which is where I am seeing this happen. Perhaps something to do with the apt cache files in /sw/var/cache/apt/ installed by the Fink installer.

So it looks like not much can be done about these annoying problems, unless of course we remove the Installed-Size field from the VersionHash computation in apt. This would be a small one-line patch that would probably save us a lot of trouble in the future, but I can also see reasons not to do it and to learn to live with the annoying behavior.

--
Martin




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to