Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144426040
D52879.id163407.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D52879.id163407.diff
View Options
diff --git a/Makefile.inc1 b/Makefile.inc1
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -605,6 +605,8 @@
.endif
.endif # !defined(_MKSHOWCONFIG)
+PKG_NAME_PREFIX?= FreeBSD
+
.if make(*package*)
.if !defined(PKG_TIMESTAMP)
.if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git)
@@ -618,7 +620,6 @@
.endif
PKG_WORKERS_COUNT?= 1
-PKG_NAME_PREFIX?= FreeBSD
PKG_MAINTAINER?= re@FreeBSD.org
PKG_WWW?= https://www.FreeBSD.org
.export PKG_NAME_PREFIX
@@ -1371,6 +1372,28 @@
.endif
.endif
+#
+# Don't allow installworld or installkernel on a pkgbase system. This avoids
+# accidentally updating a pkgbase system with install{world,kernel}, causing
+# the installed system to become out of date with the package database.
+#
+# Skip the check if DESTDIR is defined on the assumption the user knows what
+# they're doing. This means the check can be disabled for the running system
+# using DESTDIR=/.
+#
+.if !make(distributeworld) && !defined(DESTDIR)
+_installcheck_world: __installcheck_PKG
+_installcheck_kernel: __installcheck_PKG
+__installcheck_PKG: .PHONY
+.if exists(${LOCALBASE}/sbin/pkg-static)
+ @if ${LOCALBASE}/sbin/pkg-static info -e ${PKG_NAME_PREFIX}-runtime; then \
+ echo >&2 "ERROR: This target should not be used on a system installed from packages." ; \
+ echo >&2 " To override this check, set DESTDIR=/."; \
+ false; \
+ fi
+.endif
+.endif
+
.if !defined(DB_FROM_SRC)
#
# Check for missing UIDs/GIDs.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 9:25 AM (1 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28563009
Default Alt Text
D52879.id163407.diff (1 KB)
Attached To
Mode
D52879: Makefile: Don't allow install{world,kernel} with pkgbase
Attached
Detach File
Event Timeline
Log In to Comment