tech-pkg archive

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

Pkgsrc bootstrap broken on OpenBSD and FreeBSD



Hi,

Bootstrapping is currently broken on OpenBSD and FreeBSD, because of
the newly added checks for /var/db/pkg.

As /var/db/pkg is the default directory for packages DB for their
respective ports system it will always exist on those systems.

From my understanding those checks are only relevant on NetBSD, so I
fixed the issue locally using the diff included below for reference.

But it might be a better option to rework the checks to not bail out?

diff --git a/mk/pkgformat/pkg/pkgformat-vars.mk b/mk/pkgformat/pkg/pkgformat-vars.mk
index d240753b5fa..d8516cd9403 100644
--- a/mk/pkgformat/pkg/pkgformat-vars.mk
+++ b/mk/pkgformat/pkg/pkgformat-vars.mk
@@ -18,7 +18,7 @@ USE_TOOLS+=	date
 # This is the package database directory for the default view.
 PKG_DBDIR?=		${LOCALBASE}/pkgdb
 
-.if exists(/var/db/pkg) && !exists(${PKG_DBDIR})
+.if ${OPSYS} == "NetBSD" && 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
 
diff --git a/pkgtools/pkg_install/files/lib/pkgdb.c b/pkgtools/pkg_install/files/lib/pkgdb.c
index 52e3fa93acf..4daa08d88d9 100644
--- a/pkgtools/pkg_install/files/lib/pkgdb.c
+++ b/pkgtools/pkg_install/files/lib/pkgdb.c
@@ -300,6 +300,7 @@ pkgdb_refcount_dir(void)
 const char *
 pkgdb_get_dir(void)
 {
+#ifdef NETBSD
 	/* Except for the return at this end, this code is for
 	   migration from the previous location /var/db/pkg to the new
 	   default (December 2020). */
@@ -314,6 +315,7 @@ pkgdb_get_dir(void)
 		     "\tmv /var/db/pkg " DEF_LOG_DIR "\n"
 		     "\tmv /var/db/pkg.refcount " DEF_LOG_DIR ".refcount");
 	}
+#endif
 
         return pkgdb_dir;
 }
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index e1fdef9ade7..80368d91baf 100644
--- a/pkgtools/pkg_install/files/lib/version.h
+++ b/pkgtools/pkg_install/files/lib/version.h
@@ -27,6 +27,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION 20201212
+#define PKGTOOLS_VERSION 20201214
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index