Subject: Re: CVS commit: basesrc
To: None <hubertf@netbsd.org>
From: enami tsugutomo <enami@but-b.or.jp>
List: source-changes
Date: 04/01/2000 13:36:15
Hubert Feyrer <hubertf@netbsd.org> writes:

> Module Name:	basesrc
> Committed By:	hubertf
> Date:		Fri Mar 31 22:12:57 UTC 2000
> 
> Modified Files:
> 	basesrc/usr.sbin/pkg_install/add: perform.c
> 
> Log Message:
> In the "quick depends pre-check" don't only try to replace anything
> after a "-" with the "more liberal pattern", but also anything after
> any pkg wildcard.
> 
> That way if someone has teTeX-share-1.0 installed and pkg_adds
> teTeX-1.0.7 (which wants teTeX-share>1.0.2), it will be caught.

What you want to do is actually following, isn't it?

enami.
Index: perform.c
===================================================================
RCS file: /cvsroot/basesrc/usr.sbin/pkg_install/add/perform.c,v
retrieving revision 1.47
diff -u -r1.47 perform.c
--- perform.c	2000/03/31 22:12:56	1.47
+++ perform.c	2000/04/01 01:57:35
@@ -364,11 +364,12 @@
 			 */
 			char *s;
 			
-			if (((s = strrchr(p->name, '-')) != NULL) || (s = strpbrk(p->name, "<>[]?*{") != NULL)) {
+			if ((s = strpbrk(p->name, "<>[]?*{")) != NULL ||
+			    (s = strrchr(p->name, '-')) != NULL) {
 				char    buf[FILENAME_MAX];
 		
-				(void) snprintf(buf, sizeof(buf), "%.*s[0-9]*",
-					(int)(s - p->name) + 1, p->name);
+				(void) snprintf(buf, sizeof(buf), "%.*s-[0-9]*",
+					(int)(s - p->name), p->name);
 				if (findmatchingname(dbdir, buf, note_whats_installed, installed) > 0) {
 					warnx("pkg `%s' required, but `%s' found installed.\n"
 					      "Please resolve this conflict!", p->name, installed);