pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/platform Move the pkgdb compatibility error to a Ne...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a8147165f8c2
branches:  trunk
changeset: 443633:a8147165f8c2
user:      maya <maya%pkgsrc.org@localhost>
date:      Fri Dec 18 17:14:58 2020 +0000

description:
Move the pkgdb compatibility error to a NetBSD-specific file to avoid
breakage for users who have other package managers that use /var/db/pkg
(Reported by Frederic Cambus on FreeBSD, OpenBSD)

Adjust warning: specifying PKGDB_DIR in mk.conf should be sufficient
for building packages for the compatibility pkgdb location.

This is still an error message, because:
- While we can handle the existing references of PKGDB_DIR, new ones
might be created.
- It is a minor inconvenience to people building packages from source.

diffstat:

 mk/pkgformat/pkg/pkgformat-vars.mk |   6 +-----
 mk/platform/NetBSD.mk              |  10 +++++++++-
 2 files changed, 10 insertions(+), 6 deletions(-)

diffs (44 lines):

diff -r 16953526e394 -r a8147165f8c2 mk/pkgformat/pkg/pkgformat-vars.mk
--- a/mk/pkgformat/pkg/pkgformat-vars.mk        Fri Dec 18 17:10:54 2020 +0000
+++ b/mk/pkgformat/pkg/pkgformat-vars.mk        Fri Dec 18 17:14:58 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: pkgformat-vars.mk,v 1.10 2020/12/03 10:04:48 wiz Exp $
+# $NetBSD: pkgformat-vars.mk,v 1.11 2020/12/18 17:14:58 maya Exp $
 #
 # This Makefile fragment is included indirectly by bsd.prefs.mk and
 # defines some variables which must be defined earlier than where
@@ -18,10 +18,6 @@
 # This is the package database directory for the default view.
 PKG_DBDIR?=            ${LOCALBASE}/pkgdb
 
-.if exists(/var/db/pkg) && !exists(${PKG_DBDIR})
-PKG_DBDIR_ERROR=       The default package database directory has changed. Please run: mv /var/db/pkg ${PKG_DBDIR}
-.endif
-
 # _PKG_DBDIR is the actual packages database directory where we register
 # packages.
 #
diff -r 16953526e394 -r a8147165f8c2 mk/platform/NetBSD.mk
--- a/mk/platform/NetBSD.mk     Fri Dec 18 17:10:54 2020 +0000
+++ b/mk/platform/NetBSD.mk     Fri Dec 18 17:14:58 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.mk,v 1.61 2020/12/14 21:45:43 js Exp $
+# $NetBSD: NetBSD.mk,v 1.62 2020/12/18 17:14:58 maya Exp $
 #
 # Variable definitions for the NetBSD operating system.
 
@@ -165,6 +165,14 @@
 _OPSYS_SUPPORTS_STACK_CHECK=   yes
 .endif
 
+_OLD_DEFAULT_PKGDB_DIR=        /var/db/pkg
+.if exists(${_OLD_DEFAULT_PKGDB_DIR}) && \
+    (${PKG_DBDIR:U${OLD_DEFAULT_PKGDB_DIR}} != ${_OLD_DEFAULT_PKGDB_DIR})
+PKG_DBDIR_ERROR=       Compatibility pkgdb location exists, but PKG_DBDIR not specified. \
+                       This may cause unexpected issues. To avoid problems, add \
+                       PKG_DBDIR=${_OLD_DEFAULT_PKGDB_DIR} to /etc/mk.conf.
+.endif
+
 _OPSYS_SUPPORTS_CWRAPPERS=     yes
 
 # use readelf in check/bsd.check-vars.mk



Home | Main Index | Thread Index | Old Index