PERFORCE change 101927 for review
Gabor Kovesdan
gabor at FreeBSD.org
Wed Jul 19 13:38:57 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=101927
Change 101927 by gabor at gabor_spitfire on 2006/07/19 13:38:42
Add some checks against DESTDIR. It can't be /, or can't have a
trailing slash, but has to be an absolute path. These checks
can be ignored by setting IGNORE_PATH_CHECKS.
Affected files ...
.. //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#43 edit
Differences ...
==== //depot/projects/soc2006/gabor_ports/Mk/bsd.port.mk#43 (text+ko) ====
@@ -1307,12 +1307,31 @@
.endif
DISTNAME?= ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
-# Disallow setting DESTDIR to /.
-.if defined(DESTDIR) && ${DESTDIR} == "/"
+# These do some path checks if DESTDIR is set correctly.
+# You can force skipping these test by defining IGNORE_PATH_CHECKS
+.if !defined(IGNORE_PATH_CHECKS)
+.if defined(DESTDIR)
+.if (${DESTDIR:C,(^.).*,\1,} != "/")
+.if ${DESTDIR} == "/"
+.BEGIN:
+ @${ECHO_MSG} "You can't set DESTDIR to /. Please re-run make with"
+ @${ECHO_MSG} "DESTDIR unset."
+ @${FALSE}
+.else
+.BEGIN:
+ @${ECHO_MSG} "DESTDIR must be defined as an absolute path so that when 'make'"
+ @${ECHO_MSG} "is invoked in the work area DESTDIR points to the right place."
+ @${FALSE}
+.endif
+.endif
+.if (${DESTDIR:C,^.*(/)$$,\1,} == "/")
.BEGIN:
- @${ECHO_MSG} "You can't set DESTDIR to /. Unset DESTDIR and re-run make."
+ @${ECHO_MSG} "DESTDIR can't have a trailing slash. Please remove the trailing"
+ @${ECHO_MSG} "slash and re-run 'make'"
@${FALSE}
.endif
+.endif
+.endif
# These need to be absolute since we don't know how deep in the ports
# tree we are and thus can't go relative. They can, of course, be overridden
More information about the p4-projects
mailing list