[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-ports
Subject:    Proposal 3 first cut -- depending on non-executables
From:       asami () cs ! berkeley ! edu (Satoshi Asami)
Date:       1995-11-22 12:53:15
[Download RAW message or body]

Please try the following patch (relative to -current).  Now you should
be able to depend on a non-executable in {FETCH,BUILD,RUN}_DEPENDS.

Just specify the full pathname (you can use ${PREFIX} and such)
instead of the command name.  bsd.port.mk will detect the "/" at the
beginning and use a "test -e" instead of "which -s".  You can even
depend on a directory name (although the message still says "file").

The side effect of this is that if you really depend on an executable
which is in a non-standard place (thus you need a full pathname), and
the file is there but without the execute permission, it will
(erroneously) think everything's fine and the build will fail.  But I
don't think we have to worry about such a pathological case. ;)

Satoshi
-------
Index: bsd.port.mk
===================================================================
RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v
retrieving revision 1.187
diff -u -r1.187 bsd.port.mk
--- bsd.port.mk	1995/11/17 16:49:40	1.187
+++ bsd.port.mk	1995/11/22 12:41:31
@@ -1005,16 +1005,34 @@
 	@for i in ${DEPENDS_TMP}; do \
 		prog=`/bin/echo $$i | /usr/bin/sed -e 's/:.*//'`; \
 		dir=`/bin/echo $$i | /usr/bin/sed -e 's/.*://'`; \
-		${ECHO_MSG} "===>  ${PKGNAME} depends on executable:  $$prog ($$dir)"; \
+		if expr "$$prog" : \\/ >/dev/null; then \
+			${ECHO_MSG} "===>  ${PKGNAME} depends on file:  $$prog ($$dir)"; \
+		else \
+			${ECHO_MSG} "===>  ${PKGNAME} depends on executable:  $$prog ($$dir)"; \
+		fi; \
 	done
 .else
 	@for i in ${DEPENDS_TMP}; do \
 		prog=`/bin/echo $$i | /usr/bin/sed -e 's/:.*//'`; \
 		dir=`/bin/echo $$i | /usr/bin/sed -e 's/.*://'`; \
-		if which -s "$$prog"; then \
-			${ECHO_MSG} "===>  ${PKGNAME} depends on executable: $$prog - found"; \
+		if expr "$$prog" : \\/ >/dev/null; then \
+			if [ -e "$$prog" ]; then \
+				${ECHO_MSG} "===>  ${PKGNAME} depends on file: $$prog - found"; \
+				notfound=0; \
+			else \
+				${ECHO_MSG} "===>  ${PKGNAME} depends on file: $$prog - not found"; \
+				notfound=1; \
+			fi; \
 		else \
-			${ECHO_MSG} "===>  ${PKGNAME} depends on executable: $$prog - not found"; \
+			if which -s "$$prog"; then \
+				${ECHO_MSG} "===>  ${PKGNAME} depends on executable: $$prog - found"; \
+				notfound=0; \
+			else \
+				${ECHO_MSG} "===>  ${PKGNAME} depends on executable: $$prog - not found"; \
+				notfound=1; \
+			fi; \
+		fi; \
+		if [ $$notfound != 0 ]; then \
 			${ECHO_MSG} "===>  Verifying build for $$prog in $$dir"; \
 			if [ ! -d "$$dir" ]; then \
 				${ECHO_MSG} ">> No directory for $$prog.  Skipping.."; \


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic