Subject: pkg/37277: "pkg_add -u" damages the package database when it fails
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <rillig@NetBSD.org>
List: pkgsrc-bugs
Date: 11/04/2007 16:05:01
>Number:         37277
>Category:       pkg
>Synopsis:       "pkg_add -u" damages the package database when it fails
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 04 16:05:00 +0000 2007
>Originator:     Roland Illig
>Release:        
>Organization:
>Environment:
>Description:
When I run "pkg_add -u" to update packages, it sometimes fails. Unformtunately, the failure is often at a point where the package metadata of the old package has already been removed from the pkgdb, and the new metadata has not yet been installed.

This leads to a loss of dependency information between the installed packages. The list of installed packages is also affected by this.
>How-To-Repeat:

>Fix:
When updating a single package, check the dependencies and conflicts first, _then_ remove the old package, _then_ install the new one.