Subject: foo-x.y vs. foo-part-u.v
To: None <tech-pkg@netbsd.org>
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
List: tech-pkg
Date: 06/10/1999 18:06:54
We currently have the problem with meta-style packages that collect
several packages under one name (nethack comes to mind, several others
exist), that we can't call the meta-style-package just foo-x.y, as the
magic in bsd.pkg.mk will recognize any installed foo-part-u.v as an old
version of foo-x.y (by just looking for foo-*), and stopping installion.

The '*' in the foo-* should only match the version number of any installed
foo-packages, but instead it happily matches any foo-part packages as
well. That's annoying, and we have worked around this by naming them
foo-all-x.y, but this is not a nice solution.

I've had a closer look at our version numbers, and as we can't do an
eqivalent of the regular expression '[^-]+' in shell globs, and ALL our
version numbers begin with a digit, I'd suggest that we don't look for
foo-* to find any "old" versions, but for foo-[0-9]* instead. 

A patch for this is attached below. 

Any objections to apply it?


 - Hubert


@@ -1081,7 +1088,7 @@
                exit 1;                                                 \
        fi
 .endif # CONFLICTS
-       ${_PKG_SILENT}${_PKG_DEBUG}found="`${PKG_INFO} -e \"${PKGNAME:C/-[^-]*$/-*/}\" || ${TRUE}`"; \ 
+       ${_PKG_SILENT}${_PKG_DEBUG}found="`${PKG_INFO} -e \"${PKGNAME:C/-[^-]*$/-[0-9]*/}\" || ${TRUE}`"; \ 
        if [ "$$found" != "" ]; then                                    \
                ${ECHO_MSG} "===>  $$found is already installed - perhaps an older version?"; \
                ${ECHO_MSG} "      If so, you may wish to \`\`pkg_delete $$found'' and install"; \


-- 
NetBSD - Better for your uptime than Viagra