summaryrefslogtreecommitdiff
path: root/share/mk/bsd.port.mk
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>1998-04-06 21:46:01 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>1998-04-06 21:46:01 +0000
commit407cb528206651b367e51fffd7bca5e8eb3e5d7c (patch)
tree168c5d44cf33f6670831d17cebc9670e879de3a7 /share/mk/bsd.port.mk
parentbb44a07231b1546b874b46a70d862cea198f516c (diff)
existing fetch from cdrom was freebsd specific and would not work on OpenBSD;
Add code to copy or link from cdrom that works with OpenBSD.
Diffstat (limited to 'share/mk/bsd.port.mk')
-rw-r--r--share/mk/bsd.port.mk26
1 files changed, 25 insertions, 1 deletions
diff --git a/share/mk/bsd.port.mk b/share/mk/bsd.port.mk
index be5159c666a..a37cc08991d 100644
--- a/share/mk/bsd.port.mk
+++ b/share/mk/bsd.port.mk
@@ -1,6 +1,6 @@
#-*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4
-# $OpenBSD: bsd.port.mk,v 1.27 1998/04/05 04:20:38 marc Exp $
+# $OpenBSD: bsd.port.mk,v 1.28 1998/04/06 21:46:00 marc Exp $
# $NetBSD: $
#
# bsd.port.mk - 940820 Jordan K. Hubbard.
@@ -676,6 +676,10 @@ MASTER_SITES:= ${MASTER_SITE_OVERRIDE} ${MASTER_SITES}
PATCH_SITES:= ${MASTER_SITE_OVERRIDE} ${PATCH_SITES}
.endif
+# The following is a FreeBSD construct that dopes not work in OpenBSD.
+# Since OpenBSD does not put packages in /cdrom/ports/packages it
+# is safe to leave (but I may remove it in the future).
+#
# Search CDROM first if mounted, symlink instead of copy if
# FETCH_SYMLINK_DISTFILES is set
.if exists(/cdrom/ports/distfiles)
@@ -686,6 +690,21 @@ FETCH_BEFORE_ARGS+= -l
.endif
.endif
+# OpenBSD code to handle ports distfiles on a CDROM. The distfiles
+# are located in /cdrom/distfiles/${DIST_SUBDIR}/ (assuming that the
+# CDROM is mounted on /cdrom).
+#
+.if exists(/cdrom/distfiles)
+CDROM_SITE:= /cdrom/distfiles/${DIST_SUBDIR}
+.if defined(FETCH_SYMLINK_DISTFILES)
+CDROM_COPY:= ${LN}
+CDROM_OPT= -s
+.else
+CDROM_COPY:= ${CP}
+CDROM_OPT= -f
+.endif
+.endif
+
# Derived names so that they're easily overridable.
DISTFILES?= ${DISTNAME}${EXTRACT_SUFX}
PKGNAME?= ${DISTNAME}
@@ -977,6 +996,11 @@ do-fetch:
${ECHO_MSG} ">> Please correct this problem and try again."; \
exit 1; \
fi ; \
+ if [ ! -z ${CDROM_COPY} ]; then \
+ if ${CDROM_COPY} ${CDROM_OPT} ${CDROM_SITE}/$$file .; then \
+ continue; \
+ fi ; \
+ fi ; \
${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
for site in ${MASTER_SITES}; do \
${ECHO_MSG} ">> Attempting to fetch from $${site}."; \