Subject: pkg/19218: `make replace' fails if package to be replaced is not installed yet
To: None <gnats-bugs@gnats.netbsd.org>
From: None <svs+pr@grep.ru>
List: netbsd-bugs
Date: 12/01/2002 04:33:30
>Number:         19218
>Category:       pkg
>Synopsis:       `make replace' fails if package to be replaced is not installed yet
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 01 04:34:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Sergey Svishchev
>Release:        1.6G
>Organization:
>Environment:
>Description:

>How-To-Repeat:

>Fix:
--- bsd.pkg.mk  2002/11/26 15:19:50 1.1092
+++ bsd.pkg.mk  2002/11/27 20:10:09
@@ -2555,7 +2555,13 @@
 .endif
 
 .if !target(replace)
-replace: uptodate-pkgtools build real-replace
+replace:
+ @found="`${PKG_INFO} -e \"${PKGWILDCARD}\" || ${TRUE}`";    \
+ if [ "$$found" != "" ]; then          \
+   cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} uptodate-pkgtools build real-replace; \
+ else \
+   ${ECHO} "The package you're trying to replace is not installed yet."; \
+ fi
 .endif
 
 .if !target(undo-replace)

>Release-Note:
>Audit-Trail:
>Unformatted: