NetBSD Problem Report #48694

From jbernard@knox.mines.edu  Mon Mar 31 17:23:41 2014
Return-Path: <jbernard@knox.mines.edu>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 51CEBA5807
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 31 Mar 2014 17:23:41 +0000 (UTC)
Message-Id: <201403311723.s2VHNc0x026263@knox.mines.edu>
Date: Mon, 31 Mar 2014 11:23:38 -0600 (MDT)
From: jbernard@mines.edu
Reply-To: jbernard@mines.edu
To: gnats-bugs@NetBSD.org
Subject: perllink creates and ignores package conflicts
X-Send-Pr-Version: 3.95

>Number:         48694
>Category:       pkg
>Synopsis:       perllink creates and ignores package conflicts
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 31 17:25:00 +0000 2014
>Last-Modified:  Thu Apr 03 11:40:00 +0000 2014
>Originator:     Jim Bernard
>Release:        NetBSD 6.99.31
>Organization:
>Environment:
System: NetBSD 6.99.31: Sat Feb 15 18:45:02 MST 2014 i386
Architecture: i386
Machine: i386
>Description:
	When perl packages are installed, the script perllink (from lang/perl5)
	is used to link bin and man1 files installed within the perl library
	into /usr/pkg/bin and /usr/pkg/man/man1.  These are apparently created
	and deleted unconditionally, without regard to whether doing so may
	conflict with files owned by other packages.  Furthermore, no record of
	their installation is made in the packing list, so other packages installed
	subsequently have no way of knowing whether they may overwrite links
	created by perllink.

>How-To-Repeat:
	I noticed this with textproc/bibparse and textproc/p5-Text-BibTeX,
	which both install binaries called "bibparse" and "biblex".  Those
	from the bibparse package are included in its packing list, while
	those from the p5-Text-BibTeX package are not in its packing list.

	To demonstrate:

	% pkg_add bibparse
	% ls -ltc /usr/pkg/bin | head -10
	total 175178
	-rwxr-xr-x    1 root  wheel     15368 Mar 31 10:42 bibunlex
	-rwxr-xr-x    1 root  wheel     27668 Mar 31 10:42 bibparse
	-rwxr-xr-x    1 root  wheel     19120 Mar 31 10:42 biblex
	-rwxr-xr-x    1 root  wheel       642 Mar 31 10:42 bibdup
	...

	% pkg_add p5-Text-BibTeX
	[no output]

	% ls -ltc /usr/pkg/bin | head -10
	total 175130
	lrwxr-xr-x    1 root  wheel        38 Mar 31 10:43 dumpnames -> ../lib/perl5/vendor_perl/bin/dumpnames
	lrwxr-xr-x    1 root  wheel        37 Mar 31 10:43 bibparse -> ../lib/perl5/vendor_perl/bin/bibparse
	lrwxr-xr-x    1 root  wheel        35 Mar 31 10:43 biblex -> ../lib/perl5/vendor_perl/bin/biblex
	-rwxr-xr-x    1 root  wheel     15368 Mar 31 10:42 bibunlex
	-rwxr-xr-x    1 root  wheel       642 Mar 31 10:42 bibdup
	...
	[The bibparse and biblex files belonging to the bibparse package
	were sliently overwritten by links.  pkg_info -F still reports them
	as belonging to the bibparse package.  Also, the biblex program
	from p5-Text-BibTeX is incompatible with the bibunlex program from
	bibparse, so "biblex somebibfile | bibunlex" fails at this point.]

	% pkg_delete bibparse
	original MD5 checksum failed, not deleting: /usr/pkg/bin/biblex
	original MD5 checksum failed, not deleting: /usr/pkg/bin/bibparse
	pkg_delete: couldn't entirely delete package `bibparse-1.06'

	% ls -ltc /usr/pkg/bin | head -10
	total 175112
	lrwxr-xr-x    1 root  wheel        38 Mar 31 10:43 dumpnames -> ../lib/perl5/vendor_perl/bin/dumpnames
	lrwxr-xr-x    1 root  wheel        37 Mar 31 10:43 bibparse -> ../lib/perl5/vendor_perl/bin/bibparse
	lrwxr-xr-x    1 root  wheel        35 Mar 31 10:43 biblex -> ../lib/perl5/vendor_perl/bin/biblex

	% pkg_delete p5-Text-BibTeX
	[no output]


	Alternatively, install in the opposite order:

	% pkg_add p5-Text-BibTeX
	% ls -ltc /usr/pkg/bin | head -10
	total 175112
	lrwxr-xr-x    1 root  wheel        38 Mar 31 10:46 dumpnames -> ../lib/perl5/vendor_perl/bin/dumpnames
	lrwxr-xr-x    1 root  wheel        37 Mar 31 10:46 bibparse -> ../lib/perl5/vendor_perl/bin/bibparse
	lrwxr-xr-x    1 root  wheel        35 Mar 31 10:46 biblex -> ../lib/perl5/vendor_perl/bin/biblex

	% pkg_add bibparse
	% ls -ltc /usr/pkg/bin | head -10
	total 175178
	-rwxr-xr-x    1 root  wheel     15368 Mar 31 10:46 bibunlex
	-rwxr-xr-x    1 root  wheel     27668 Mar 31 10:46 bibparse
	-rwxr-xr-x    1 root  wheel     19120 Mar 31 10:46 biblex
	-rwxr-xr-x    1 root  wheel       642 Mar 31 10:46 bibdup
	lrwxr-xr-x    1 root  wheel        38 Mar 31 10:46 dumpnames -> ../lib/perl5/vendor_perl/bin/dumpnames
	[The bibparse and biblex links belonging to the p5-Text-BibTeX
	package were overwritten by files.  pkg_info -F reports them as
	belonging to the bibparse package.]

	% pkg_delete p5-Text-BibTeX
	[no output]

	% ls -ltc /usr/pkg/bin | head -10
	total 175130
	-rwxr-xr-x    1 root  wheel     15368 Mar 31 10:46 bibunlex
	-rwxr-xr-x    1 root  wheel       642 Mar 31 10:46 bibdup
	[The bibparse and biblex files belonging to the bibparse pkg were
	silently deleted.  pkg_info -L still reports them as parts of
	the bibparse package.]

	% pkg_delete bibparse
	pkg_delete: Couldn't remove /usr/pkg/bin/biblex
	pkg_delete: Couldn't remove /usr/pkg/bin/bibparse

>Fix:

>Audit-Trail:
From: "OBATA Akio" <obata@lins.jp>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/48694: perllink creates and ignores package conflicts
Date: Tue, 01 Apr 2014 18:32:34 +0900

 There are two way to resolve this issue:
 * move perllink to post-install stage, and record symlinks to PLIST
 * try to remove symbolic links carefully (target is owned)

 Former way is probably safe, but later way may allow co-existence of
 "p5-Text-BibTeX" and "bibparse".

 -- 
 OBATA Akio / obata@lins.jp

From: Jim Bernard <jbernard@mines.edu>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
        jbernard@mines.edu
Subject: Re: pkg/48694: perllink creates and ignores package conflicts
Date: Tue, 1 Apr 2014 05:06:47 -0600

 On Tue, Apr 01, 2014 at 09:35:00AM +0000, OBATA Akio wrote:
 > The following reply was made to PR pkg/48694; it has been noted by GNATS.
 >
 > From: "OBATA Akio" <obata@lins.jp>
 > Subject: Re: pkg/48694: perllink creates and ignores package conflicts
 > Date: Tue, 01 Apr 2014 18:32:34 +0900
 > 
 >  There are two way to resolve this issue:
 >  * move perllink to post-install stage, and record symlinks to PLIST
 >  * try to remove symbolic links carefully (target is owned) 
 >  
 >  Former way is probably safe, but later way may allow co-existence of
 >  "p5-Text-BibTeX" and "bibparse". 

   It would be very nice to allow coexistence of conflicting packages.

   By the way, there are two related conflicts:

   1) I assume there is a silent conflict between btparse and p5-Text-BibTeX,
      since the latter includes at least part of btparse internally, though
      I haven't tried installing both.

   2) The btparse package and the bibparse packages conflict.  In this case,
      the conflicting names are in both PLISTs, so the tools prevent the
      collision, though it would be better to permit coexistence.

   Thanks for the reply.

From: "OBATA Akio" <obata@lins.jp>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/48694: perllink creates and ignores package conflicts
Date: Tue, 01 Apr 2014 20:52:14 +0900

 On Tue, 01 Apr 2014 20:10:01 +0900, Jim Bernard <jbernard@mines.edu> wrote:

 >    It would be very nice to allow coexistence of conflicting packages.
 >   By the way, there are two related conflicts:
 >   1) I assume there is a silent conflict between btparse and p5-Text-BibTeX,
 >       since the latter includes at least part of btparse internally, though
 >       I haven't tried installing both.

 Ah, then, it is better that p5-Text-BibTeX use libbtparse from pkgsrc, instead of
 bundled one, but I don't know whether it is possible or not.

 >    2) The btparse package and the bibparse packages conflict.  In this case,
 >       the conflicting names are in both PLISTs, so the tools prevent the
 >       collision, though it would be better to permit coexistence.

 For coexistence,
 * rename conflict files
 or
 * change installed location

 But former way, users must call programs with unusual name,
 for later way, users need to call programs carefully,
 with full path, or put preferred one before the other one in PATH.

 -- 
 OBATA Akio / obata@lins.jp

From: Jim Bernard <jbernard@mines.edu>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
        jbernard@mines.edu
Subject: Re: pkg/48694: perllink creates and ignores package conflicts
Date: Tue, 1 Apr 2014 09:42:18 -0600

 On Tue, Apr 01, 2014 at 11:55:01AM +0000, OBATA Akio wrote:
 >  For coexistence,
 >  * rename conflict files
 >  or
 >  * change installed location
 >  
 >  But former way, users must call programs with unusual name,
 >  for later way, users need to call programs carefully,
 >  with full path, or put preferred one before the other one in PATH.

   Yes.  Whatever happened to package views?

From: "OBATA Akio" <obata@lins.jp>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/48694: perllink creates and ignores package conflicts
Date: Thu, 03 Apr 2014 20:36:38 +0900

 On Wed, 02 Apr 2014 00:45:00 +0900, Jim Bernard <jbernard@mines.edu> wrote:

 >    Yes.  Whatever happened to package views?

 pkgview is not maintained now.

 -- 
 OBATA Akio / obata@lins.jp

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.