Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Apr 2001 14:23:35 -0700 (PDT)
From:      sburke@corp.namesafe.com
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/26468: pkg_delete clears dependencies after running post-deinstall script.
Message-ID:  <200104092123.f39LNZt43968@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         26468
>Category:       bin
>Synopsis:       pkg_delete clears dependencies after running post-deinstall script.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 09 14:30:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     SEan Burke
>Release:        4.3 BETA
>Organization:
NameSafe, Inc.
>Environment:
FreeBSD zardoz.corp.namesafe.com 4.3-BETA FreeBSD 4.3-BETA #1: Thu Apr  5 18:09:04 PDT 2001     root@dev1.corp.namesafe.com:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
pkg_delete does not clear the +REQUIRED_BY entries in the deleted 
package's dependencies until after running the post-deinstall script.
As a result, if the post-deinstall script attempts to delete other
packages that are required by the package being deleted, those packages
cannot be deleted because they appear to still be required.
>How-To-Repeat:
Create a package Foo-1.0, with "@pkgdep Bar-1.0" in the pkg-plist.
Next, in Foo's post-deinstall script, do "pkg_delete Bar-1.0".
Deleting the package Foo-1.0 generates the error:
pkg_delete: package `Bar-1.0' is required by these other packages
and may not be deinstalled 
Foo-1.0
>Fix:
In /usr/src/usr.sbin/pkg_install/delete/perform.c,
move the loop beginning at line 258:

    for (p = Plist.head; p ; p = p->next) {
        if (p->type != PLIST_PKGDEP)
            continue;
        if (Verbose)
            printf("Attempting to remove dependency on package `%s'\n", p->name);
        if (!Fake)
            undepend(p, pkg);
    }

To line 225, following the call to delete_package().

This will ensure that the package dependencies are up to date
when the post-deinstall script is called.

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104092123.f39LNZt43968>