reassign 249355 anna severity 249355 important tags 249355 patch thanks On Mon, May 17, 2004 at 03:39:47PM -0300, Joey Hess wrote: > I can reproduce this bug using a netboot image on i386. It happens > whether the image is built containing the udebs in testing or those in > unstable. I suspect this is really a bug in libdebian-installer. No, it is not. It is the behaviour of the original code of anna. The attached patch should fix the problem and a potential other bug but is untested. Bastian -- Violence in reality is quite different from theory. -- Spock, "The Cloud Minders", stardate 5818.4
Index: anna.c =================================================================== --- anna.c (revision 15579) +++ anna.c (working copy) @@ -109,19 +109,41 @@ } for (node = (*packages)->list.head; node; node = node->next) { + di_package *q; + di_package_version *pv, *qv; + package = node->data; + if (package->status_want == di_package_status_want_install) + continue; + package->status_want = di_package_status_want_deinstall; - if (package->status_want == di_package_status_want_install) - continue; if (package->type != di_package_type_real_package) continue; - if (is_installed(package, status)) - continue; if (!di_system_package_check_subarchitecture(package, subarchitecture)) continue; + /* If we don't understand the version number, we play safe + * and assume it is not installed */ + if (package->version != NULL && (pv = di_package_version_parse(package))) { + q = di_packages_get_package(status, package->package, 0); + if (q != NULL && q->status == di_package_status_installed && + q->version != NULL && (qv = di_package_version_parse(q))) { + int ret = di_package_version_compare(pv, qv); + di_package_version_free(pv); + di_package_version_free(qv); + /* Install if the version in the archive is higher */ + if (ret > 0) + package->status_want = di_package_status_want_install; + /* Skip futher processing if the version is equal or higher */ + if (ret >= 0) + continue; + } + else + di_package_version_free(pv); + } + if (((di_system_package *)package)->kernel_version) { if (running_kernel && strcmp(running_kernel, ((di_system_package *)package)->kernel_version) == 0)
Attachment:
signature.asc
Description: Digital signature