NetBSD Problem Report #58131

From www@netbsd.org  Tue Apr  9 15:20:45 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5362F1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  9 Apr 2024 15:20:45 +0000 (UTC)
Message-Id: <20240409152043.B0EA81A923A@mollari.NetBSD.org>
Date: Tue,  9 Apr 2024 15:20:43 +0000 (UTC)
From: schaecsn@gmx.com
Reply-To: schaecsn@gmx.com
To: gnats-bugs@NetBSD.org
Subject: empty +REQUIRED_BY
X-Send-Pr-Version: www-1.0

>Number:         58131
>Category:       pkg
>Synopsis:       empty +REQUIRED_BY
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 09 15:25:00 +0000 2024
>Last-Modified:  Wed Apr 24 05:40:01 +0000 2024
>Originator:     Stefan Schaeckeler
>Release:        pkgsrc-2024Q1
>Organization:
>Environment:
NetBSD netbsd 10.0 NetBSD 10.0 (GENERIC) #0: Thu Mar 28 09:08:09 PDT 2024  root@netbsd:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
I have quite a lot of empty +REQUIRED_BY files. That confuses pkg_leave (and perhaps other utilities). How come?

/var/db/pkg$ ls -laSr */+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:26 xpdfopen-0.86nb10/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:08 xetex-0.999996/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  8 21:18 vlna-1.5nb10/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:08 upmendex-1.08/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:08 ttfdump-0.5.5nb11/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:08 ttf2pk-2.0nb12/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:09 sqlite3-3.45.2/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:26 seetexk-20200908nb3/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:47 ruby32-base-3.2.3nb1/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  8 21:18 py311-pspdfutils-3.3.2/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  8 21:18 ps2pkm-1.8nb8/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:07 poppler-utils-24.03.0/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:14 p5-namespace-autoclean-0.29nb4/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:08 p5-Tk-804.035nb3/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:14 p5-Specio-0.48nb1/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:14 p5-Params-ValidationCompiler-0.31nb1/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:10 p5-Package-DeprecationManager-0.18nb1/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:10 p5-Math-Round-0.08/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:08 mendexk-3.6nb2/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 08:08 makejvf-20230917/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:26 lynx-2.8.9.1nb11/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  8 21:18 lcdftypetools-2.110/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:26 gsftopkk-1.19.2nb15/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:26 dvisvgm-2.1.3nb1/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:26 dvipng-1.15nb11/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:26 dviljk-2.6.5nb15/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:26 dvi2tty-6.0.2nb1/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:26 bibtexu-4.02/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:26 bibtex8-4.02/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:46 afm2pl-0.7.1nb10/+REQUIRED_BY
-rw-r--r--  1 root  wheel     0 Apr  9 07:46 abcm2ps-8.13.12nb11/+REQUIRED_BY

>How-To-Repeat:

>Fix:

>Audit-Trail:
From: Jonathan Perkin <jperkin@mnx.io>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/58131: empty +REQUIRED_BY
Date: Wed, 10 Apr 2024 17:57:08 +0100

 * On 2024-04-10 at 17:44 BST, schaecsn@gmx.com wrote:

 >I have quite a lot of empty +REQUIRED_BY files. That confuses pkg_leave 
 >(and perhaps other utilities). How come?

 Hard to say without knowing how you got into that state, but needless to 
 say it's not a correct state to be in!

 You can fix it up by running "pkg_admin rebuild-tree".

 -- 
 Jonathan Perkin   -   mnx.io   -   pkgsrc.smartos.org
 Open Source Complete Cloud   www.tritondatacenter.com

From: Stefan Schaeckeler <schaecsn@gmx.com>
To: gnats-bugs@netbsd.org, pkg-manager@netbsd.org, gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org
Cc: 
Subject: Re: pkg/58131: empty +REQUIRED_BY
Date: Tue, 23 Apr 2024 22:37:23 -0700

 >  * On 2024-04-10 at 17:44 BST, schaecsn@gmx.com wrote:
 >
 >  >I have quite a lot of empty +REQUIRED_BY files. That confuses pkg_leav=
 e
 >  >(and perhaps other utilities). How come?
 >
 >  Hard to say without knowing how you got into that state, but needless t=
 o
 >  say it's not a correct state to be in!
 >
 >  You can fix it up by running "pkg_admin rebuild-tree".


 Hmm, now I know why pkg_leaves did not work.


 - - - snip - - -
 # pkg_info  -Q automatic gcc10-aux-10.3.0nb1
 YES
 - - - snip - - -


 the check in pkg_leaves is against lower case "yes":

 - - - snip - - -
 		if [ ${skip_manual} =3D "yes" ]; then
                         if [ "`${PKG_INFO} -K "${PKG_DBDIR}" -Q automatic =
 ${pkg} 2> /dev/null`" !=3D yes ]; then
 - - - snip - - -


 Having YES capitalized was a user error. Sorry.

 - - - snip - - -
 /var/db/pkg$ grep automatic */+INSTALLED_INFO
 SDL-1.2.15nb43/+INSTALLED_INFO:automatic=3Dyes
 SDL_net-1.2.8nb1/+INSTALLED_INFO:automatic=3Dyes
 TECkit-2.5.12/+INSTALLED_INFO:automatic=3Dyes
 abcm2ps-8.13.12nb11/+INSTALLED_INFO:automatic=3DYES
 ...
 - - - snip - - -


 So, the empty +REQUIRED_BY was not the fault why pkg_leave did not work. T=
 hat's now a feature request, though. Having empty +REQUIRED_BY files delet=
 ed makes inspecting /var/db/pkg/*/ directories more straightforward.

  Stefan

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.