dpkg - updating a package can break dependencies

Bernhard Fischer rep.dot.nop at gmail.com
Mon Mar 19 13:41:48 UTC 2007


On Fri, Feb 23, 2007 at 03:28:22PM +0200, Kim B. Heino wrote:
>Hello,
>
>When installing a new package with dpkg dependencies are checked 
>correctly. But when I try to update an existing package, the 
>dependencies are checked against the old package, not against new 
>package. Thus the new package can break dependencies.
>
>Attached patch fixes this problem. It should apply cleanly to todays 
>snapshot.

I have applied this untested hunk as r18158 to trunk

Thanks for the report.

>--- busybox/archival/dpkg.c.orig	2007-02-23 10:20:07.000000000 +0200
>+++ busybox/archival/dpkg.c	2007-02-23 15:17:59.000000000 +0200
>@@ -643,11 +643,9 @@
> 		return -1;
> 	}
> 	num = search_package_hashtable(new_node->name, new_node->version, VER_EQUAL);
>-	if (package_hashtable[num] == NULL) {
>-		package_hashtable[num] = new_node;
>-	} else {
>-		free_package(new_node);
>-	}
>+	if (package_hashtable[num] != NULL)
>+		free_package(package_hashtable[num]);
>+	package_hashtable[num] = new_node;
> 	return num;
> }



More information about the busybox mailing list