Subject: pkg/8219: Conflict check in "pkg_add" is broken
To: None <gnats-bugs@gnats.netbsd.org>
From: Matthias Scheler <tron@lyssa.zhadum.de>
List: netbsd-bugs
Date: 08/17/1999 17:20:54
>Number:         8219
>Category:       pkg
>Synopsis:       Conflict check in "pkg_add" is broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 17 17:20:01 1999
>Last-Modified:
>Originator:     Matthias Scheler
>Organization:
Matthias Scheler                            http://www.sighardstrasse.de/~tron/
>Release:        990817
>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.
>Audit-Trail:
>Unformatted: