NetBSD Problem Report #8219
Received: (qmail 11430 invoked from network); 18 Aug 1999 00:11:42 -0000
Message-Id: <199908180011.CAA04803@lyssa.zhadum.de>
Date: Wed, 18 Aug 1999 02:11:38 +0200 (CEST)
From: Matthias Scheler <tron@lyssa.zhadum.de>
Reply-To: tron@lyssa.zhadum.de
To: gnats-bugs@gnats.netbsd.org
Subject: Conflict check in "pkg_add" is broken
X-Send-Pr-Version: 3.95
>Number: 8219
>Category: pkg
>Synopsis: Conflict check in "pkg_add" is broken
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: hubertf
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Aug 17 17:20:01 +0000 1999
>Closed-Date: Thu Aug 19 07:19:09 +0000 1999
>Last-Modified: Thu Aug 19 07:19:48 +0000 1999
>Originator: Matthias Scheler
>Release: 990817
>Organization:
Matthias Scheler http://www.sighardstrasse.de/~tron/
>Environment:
System: NetBSD lyssa.zhadum.de 1.4J NetBSD 1.4J (LYSSA) #0: Tue Aug 17 11:29:45 CEST 1999 tron@lyssa.zhadum.de:/src/sys/compile/LYSSA i386
>Description:
The code in "pkg_add" which checks for conflicts during installation creates
too generic patterns:
if ((s=strrchr(PkgName, '-')) != NULL){
strcpy(buf, PkgName);
buf[s-PkgName+1]='*';
buf[s-PkgName+2]='\0';
So "foobar-x.y" gets turned into "foobar-*" which will match sub packages
like "foobar-sub-x.y", too.
>How-To-Repeat:
Try to add e.g. the "teTeX" meta package:
tron@lyssa:/usr/pkgsrc/print/teTeX#pkg_add /src/packages/All/teTeX-1.0.6.tgz
pkg_add: other version 'teTeX-sharesrc-1.0' already installed
>Fix:
None given.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback
State-Changed-By: hubertf
State-Changed-When: Tue Aug 17 19:15:28 PDT 1999
State-Changed-Why:
Problem analyzed & fix sent back to the PR submitter.
Please see other mail!
- Hubert
Responsible-Changed-From-To: pkg-manager->hubertf
Responsible-Changed-By: hubertf
Responsible-Changed-When: Tue Aug 17 19:15:28 PDT 1999
Responsible-Changed-Why:
I'll handle this. - Hubert
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
To: Matthias Scheler <tron@lyssa.zhadum.de>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/8219: Conflict check in "pkg_add" is broken
Date: Wed, 18 Aug 1999 04:19:13 +0200 (MET DST)
On Wed, 18 Aug 1999, Matthias Scheler wrote:
> if ((s=strrchr(PkgName, '-')) != NULL){
> strcpy(buf, PkgName);
> buf[s-PkgName+1]='*';
> buf[s-PkgName+2]='\0';
Please try this instead (untested):
if ((s=strrchr(PkgName, '-')) != NULL){
strcpy(buf, PkgName);
strcpy(s+1, "[0-9]*"); <=== use this instead of
the two buf[] assignments
if (findmatchingname()) { ...
This is what the rest of the code uses these days...
Let me know if this fixes your problems. Thanks!
- Hubert
--
NetBSD - Better for your uptime than Viagra
From: Matthias Scheler <tron@zhadum.de>
To: Hubert Feyrer <hubert.feyrer@rz.uni-regensburg.de>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/8219: Conflict check in "pkg_add" is broken
Date: Wed, 18 Aug 1999 09:34:01 +0200
On Wed, Aug 18, 1999 at 04:19:13AM +0200, Hubert Feyrer wrote:
> Please try this instead (untested):
>
> if ((s=strrchr(PkgName, '-')) != NULL){
> strcpy(buf, PkgName);
> strcpy(s+1, "[0-9]*"); <=== use this instead of
> the two buf[] assignments
That can't work. I'll try this:
if ((s=strrchr(PkgName, '-')) != NULL){
strcpy(buf, PkgName);
strcpy(&buf[s-PkgName+1],"[0-9]*");
> Let me know if this fixes your problems.
Yes, that works.
Kind regards
--
Matthias Scheler http://www.sighardstrasse.de/~tron/
State-Changed-From-To: feedback->closed
State-Changed-By: tron
State-Changed-When: Thu Aug 19 00:19:09 PDT 1999
State-Changed-Why:
I applied a fix based on Hubert's suggestion.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.