NetBSD Problem Report #42907

From cheusov@tut.by  Mon Mar  1 19:31:14 2010
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 AB47863C347
	for <gnats-bugs@gnats.netbsd.org>; Mon,  1 Mar 2010 19:31:14 +0000 (UTC)
Message-Id: <87hboz7saq.fsf@asrock.chizhovka.net>
Date: Mon, 01 Mar 2010 21:31:09 +0200
From: cheusov@tut.by
To: gnats-bugs@gnats.NetBSD.org
Subject: REQUIRES/PROVIDES variable in pkg_summary(5) is sometimes set incorrectly
X-Send-Pr-Version: 3.95

>Number:         42907
>Category:       pkg
>Synopsis:       Errors in REQUIRES/PROVIDES variables in pkg_summary(5)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    reed
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 01 19:35:00 +0000 2010
>Closed-Date:    Thu Dec 02 11:16:18 +0000 2010
>Last-Modified:  Thu Dec 02 11:20:02 +0000 2010
>Originator:     Aleksey Cheusov
>Release:        NetBSD 5.0_STABLE
>Organization:
>Environment:
System: NetBSD asrock.chizhovka.net 5.0_STABLE NetBSD 5.0_STABLE (GENERIC) #0: Sat Feb 20 12:33:43 EET 2010 cheusov@asrock.chizhovka.net:/srv/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
pkg_summary(5) describes PROVIDES and REQUIRES variables in the
following way.

     PROVIDES
             (optional) A list of shared libraries provided by the package,
             including major version number, one per line.  If missing, this
             package does not provide shared libraries.

     REQUIRES
             (optional) A list of shared libraries needed by the package,
             including major version number, one per line.  If missing, this
             package does not require shared libraries.

If present REQUIRES variable *usually* means that the package requires
the specified library which is provided (listed in PROVIDES) by some
other package or by the base system (e.g. in /lib or /usr/lib).

But there are packages that list a library in REQUIRES not provided by
any other package. Actually the package itself provides it but it is
not listed in PROVIDES.

For example, 'pkg_info -X perl' shows the following

   ...
   REQUIRES=/usr/pkg/lib/perl5/5.10.0/x86_64-netbsd-thread-multi/CORE/libperl.so

This file is provided by perl package itself but it is not listed in
PROVIDES.

Some package management tools may check PROVIDES/REQUIRES consistency
just before installing the package. Therefore the problem described
above may make some packages uninstallable with such tools.

This problem was shortly discussed here
http://mail-index.netbsd.org/tech-pkg/2010/03/01/msg005067.html

>How-To-Repeat:
There are more affected packages than just perl.
Have a look at wip/pkg_summary-utils. There you'll find
pkg_lint_summary utility. With a help of it you can find other examples of
PROVIDES/REQUIRES inconsistencies. Typescript is below

$ ftp ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/5.0.1_2009Q4/All/pkg_summary.bz2
$ bzcat pkg_summary.bz2 | pkg_lint_summary -l

>Fix:

>Release-Note:

>Audit-Trail:
From: "Jeremy C. Reed" <reed@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/42907 CVS commit: pkgsrc/mk/flavor/pkg
Date: Mon, 3 May 2010 16:46:36 +0000

 Module Name:	pkgsrc
 Committed By:	reed
 Date:		Mon May  3 16:46:36 UTC 2010

 Modified Files:
 	pkgsrc/mk/flavor/pkg: metadata.mk

 Log Message:
 From Aleksey Cheusov
 http://mail-index.netbsd.org/tech-pkg/2010/03/05/msg005088.html
 http://mail-index.netbsd.org/tech-pkg/2010/03/05/msg005090.html

 This fixes problem where some packages didn't list correct
 REQUIRES or PROVIDES.
 Symlinks are removed from PROVIDES.
 Libraries provided by same package are removed from REQUIRES.

 Also see pkg PR #42907


 To generate a diff of this commit:
 cvs rdiff -u -r1.33 -r1.34 pkgsrc/mk/flavor/pkg/metadata.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 31 Jul 2010 23:27:32 +0000
State-Changed-Why:
reed@ fixed it
(if I misunderstand and it's not fully fixed, let me know)


From: Aleksey Cheusov <cheusov@tut.by>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
	 dholland@NetBSD.org
Subject: Re: pkg/42907 (Errors in REQUIRES/PROVIDES variables in pkg_summary(5))
Date: Mon, 02 Aug 2010 20:21:26 +0300

 > Synopsis: Errors in REQUIRES/PROVIDES variables in pkg_summary(5)

 > State-Changed-From-To: open->closed
 > State-Changed-By: dholland@NetBSD.org
 > State-Changed-When: Sat, 31 Jul 2010 23:27:32 +0000
 > State-Changed-Why:
 > reed@ fixed it
 > (if I misunderstand and it's not fully fixed, let me know)

 No, please reopen it. I sent working patch to Jeremy >2 months ago and
 still wait for his response. I tested my patch on several Linux bulk builds
 (rebuild all packages) and it worked perfectly.  There are only two
 remaining issues: misc/openoffice2-bin and mail/sympa.

    l: not_found /usr/pkg/ mail/sympa sympa-5.4.4nb2

    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libmsgbaseutil.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/libfreetype.so.6 misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libnss3.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libsmime3.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libmozz.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libgcc_s.so.1 misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libnspr4.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libsoftokn3.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libplc4.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libmozjs.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libxpcom_compat.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libprldap50.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libxpcom.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libstdc++.so.6 misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libssl3.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libplds4.so misc/openoffice2-bin openoffice2-bin-2.4.3
    l: not_found /usr/pkg/openoffice.org2.4/program/components/../libldap50.so misc/openoffice2-bin openoffice2-bin-2.4.3

 Obviously OpenOffice can easily be fixed, the problem
 in it is in .. in a path.

 Again, you can use 'pkg_lint_summary -l' for testing.
 For comparison run the following command:
    ftp -o - \
       ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/i386/5.0.2_2010Q2/All/pkg_summary.bz2 |
    bzcat | pkg_lint_summary -l

 pkg_lint_summary is a part of wip/pkg_summary-utils.

 Patch is below.

 Index: mk/flavor/pkg/metadata.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/metadata.mk,v
 retrieving revision 1.34
 diff -u -r1.34 metadata.mk
 --- mk/flavor/pkg/metadata.mk	3 May 2010 16:46:36 -0000	1.34
 +++ mk/flavor/pkg/metadata.mk	2 Aug 2010 17:06:00 -0000
 @@ -64,11 +64,11 @@
  	bins=`${AWK} '/(^|\/)(bin|sbin|libexec)\// { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
  	case ${OBJECT_FMT:Q}"" in					\
  	ELF)								\
 -		libs=`${AWK} '/(^|\/)lib\/lib.*\.so(\.[0-9]+)?$$/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
 +		libs=`${AWK} '/\/lib.*\.so(\.[0-9]+)*$$/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
  		if ${TEST} -n "$$bins" -o -n "$$libs"; then		\
  			requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} '$$2 == "=>" && $$3 ~ "/" { print $$3 }' | ${SORT} -u`; \
  		fi;							\
 -		linklibs=`${AWK} '/.*\.so(\.[0-9]+)?$$/ { print "${DESTDIR}${PREFIX}/" $$0 }' ${_PLIST_NOKEYWORDS}`; \
 +		linklibs=`${AWK} '/.*\.so(\.[0-9]+)*$$/ { print "${DESTDIR}${PREFIX}/" $$0 }' ${_PLIST_NOKEYWORDS}`; \
  		for i in $$linklibs; do					\
  			if ${TEST} -r $$i -a ! -x $$i -a ! -h $$i; then	\
  				${TEST} ${PKG_DEVELOPER:Uno:Q}"" = "no" || \
 @@ -78,7 +78,7 @@
  		done;							\
  		;;							\
  	Mach-O)								\
 -		libs=`${AWK} '/(^|\/)lib\/lib.*\.dylib/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
 +		libs=`${AWK} '/\/lib.*\.dylib/ { print "${DESTDIR}${PREFIX}/" $$0 } END { exit 0 }' ${_PLIST_NOKEYWORDS}`; \
  		if ${TEST} "$$bins" != "" -o "$$libs" != ""; then	\
  			requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} '/compatibility version/ { print $$1 }' | ${SORT} -u`; \
  		fi;							\
 @@ -89,7 +89,6 @@
  		${SORT} | uniq -c | awk '$$1 == 2 {print $$2}'`; \
  	for i in "" $$libs; do						\
  		${TEST} "$$i" != "" || continue;			\
 -		${TEST} -h "$$i" && echo "$$i" | grep '[.]so$$' > /dev/null && continue;	\
  		${ECHO} "PROVIDES=$${i}";				\
  	done | ${SED} -e 's,^PROVIDES=${DESTDIR},PROVIDES=,'		\
  		>> ${.TARGET}.tmp;					\

 -- 
 Best regards, Aleksey Cheusov.

State-Changed-From-To: closed->open
State-Changed-By: obache@NetBSD.org
State-Changed-When: Thu, 05 Aug 2010 11:17:54 +0000
State-Changed-Why:
Problem still exists.


Responsible-Changed-From-To: pkg-manager->reed
Responsible-Changed-By: reed@NetBSD.org
Responsible-Changed-When: Sat, 04 Sep 2010 16:15:09 +0000
Responsible-Changed-Why:
I will take this.


State-Changed-From-To: open->closed
State-Changed-By: reed@NetBSD.org
State-Changed-When: Thu, 02 Dec 2010 11:16:18 +0000
State-Changed-Why:
Committed fix. Thank you.


From: "Jeremy C. Reed" <reed@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/42907 CVS commit: pkgsrc/mk/flavor/pkg
Date: Thu, 2 Dec 2010 11:15:10 +0000

 Module Name:	pkgsrc
 Committed By:	reed
 Date:		Thu Dec  2 11:15:10 UTC 2010

 Modified Files:
 	pkgsrc/mk/flavor/pkg: metadata.mk

 Log Message:
 Better match library names to improve REQUIRES/PROVIDES.
 This is from cheusov via PR #42907.
 (I have been using this for months, as I had noticed some of the same
 problems.)


 To generate a diff of this commit:
 cvs rdiff -u -r1.35 -r1.36 pkgsrc/mk/flavor/pkg/metadata.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>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.