NetBSD Problem Report #44778

From cheusov@tut.by  Mon Mar 28 09:16:53 2011
Return-Path: <cheusov@tut.by>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id F2B8963BB73
	for <gnats-bugs@gnats.netbsd.org>; Mon, 28 Mar 2011 09:16:52 +0000 (UTC)
Message-Id: <s938vvztxj6.fsf@centos.imb.invention.com>
Date: Mon, 28 Mar 2011 12:16:45 +0300
From: cheusov@tut.by
Reply-To:
To: gnats-bugs@gnats.netbsd.org
Cc:
Subject: pkg_delete -A doesn't work
X-Send-Pr-Version: 3.113.1
X-GNATS-Notify:

>Number:         44778
>Category:       pkg
>Synopsis:       pkg_delete -A doesn't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    agc
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 28 09:20:00 +0000 2011
>Last-Modified:  Tue Apr 26 13:07:34 +0000 2011
>Originator:     Aleksey Cheusov
>Release:        Linux 2.6.18-194.32.1.el5xen
>Organization:
<organization of PR author (multiple lines)>
>Environment:
System: Linux centos.imb.invention.com 2.6.18-194.32.1.el5xen #1 SMP Wed Jan 5 19:32:33 EST 2011 i686 i686 i386 GNU/Linux
Architecture: i686

>Description:
"pkg_delete -A" doesn't work as it is documented.

     -A    Recursively remove all automatically installed packages that
           were needed by the given packages and are no longer required.
           See also the -R flag.

Example is below. Package abcde is installed. All dependencies including
id3lib are marked as "installed as a dependency".  abcde depends on
id3v2 which in turn depends on id3lib.  After "pkg_delete -A abcde"
id3lib is kept installed and nothing depends on it (see pkg_leaves
output).

pkg_bin_summary is from pkg_summary-utils, it is a wrapper
over pkg_info -XB.

   # pkg_bin_summary -f PKGNAME,PKGPATH,REQUIREDBY,DEPENDS,automatic abcde 
id3v2 id3lib
   PKGNAME=abcde-2.3.99.7
   DEPENDS=cd-discid>=0.7
   DEPENDS=id3-[0-9]*
   DEPENDS=id3v2-[0-9]*
   DEPENDS=cdparanoia>=3.0.9.7
   DEPENDS=mkcue>=2.1
   DEPENDS=gsed>=4.2
   DEPENDS=bash-[0-9]*
   PKGPATH=audio/abcde

   PKGNAME=id3v2-0.1.12
   REQUIREDBY=abcde-2.3.99.7
   DEPENDS=id3lib>=3.8.3nb1
   PKGPATH=audio/id3v2
   automatic=yes

   PKGNAME=id3lib-3.8.3nb5
   REQUIREDBY=id3v2-0.1.12
   PKGPATH=audio/id3lib
   automatic=yes

   # pkg_delete -A abcde
   gsed-4.2.1: unregistering info file /usr/pkg/info/sed.info
   bash-4.2: unregistering info file /usr/pkg/info/bash.info
   bash-4.2: removing /usr/pkg/bin/bash from /etc/shells
   # pkg_leaves
   id3lib-3.8.3nb5
   # pkg_bin_summary -f PKGNAME,PKGPATH,REQUIREDBY,DEPENDS,automatic id3lib
   PKGNAME=id3lib-3.8.3nb5
   PKGPATH=audio/id3lib
   automatic=yes

   #

Another example. 1) Check for auto-installed leaf packages, 2) remove
ctwm with a help of "pkg_delete -A", 3) check for leaf packages again.

ctwm is built with modular Xorg.

In this example "nih deps -rI" shows a dependency graph
of installed packages.

   # pkg_leaves
   # nih deps -rI ctwm | sort -k2 
   jpeg ctwm
   libXext ctwm
   libXmu ctwm
   libXpm ctwm
   m4 ctwm
   libICE libSM
   libXau libX11
   libXdmcp libX11
   libxcb libX11
   libX11 libXext
   libX11 libXmu
   libXext libXmu
   libXt libXmu
   libX11 libXpm
   libXext libXpm
   libXt libXpm
   libICE libXt
   libSM libXt
   libX11 libXt
   libXau libxcb
   libXdmcp libxcb
   # pkg_delete -A ctwm          
   m4-1.4.16: unregistering info file /usr/pkg/info/m4.info
   # pkg_leaves
   libXt-1.0.8
   libXext-1.1.1
   #

>How-To-Repeat:

>Fix:

Unknown
>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->agc
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Tue, 26 Apr 2011 13:07:34 +0000
Responsible-Changed-Why:
Over to maintainer.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.