pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Reduced the number of complicated regexp substituti...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/93cd6a0fe5c7
branches:  trunk
changeset: 500480:93cd6a0fe5c7
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Oct 09 08:48:44 2005 +0000

description:
Reduced the number of complicated regexp substitutions by introducing an
intermediate .for variable. Fail gracefully if a dependency directory
does not exist.

diffstat:

 mk/reduce-depends.mk |  27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diffs (41 lines):

diff -r 02e985c2eb07 -r 93cd6a0fe5c7 mk/reduce-depends.mk
--- a/mk/reduce-depends.mk      Sun Oct 09 05:11:32 2005 +0000
+++ b/mk/reduce-depends.mk      Sun Oct 09 08:48:44 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: reduce-depends.mk,v 1.2 2004/10/06 21:51:41 jlam Exp $
+# $NetBSD: reduce-depends.mk,v 1.3 2005/10/09 08:48:44 rillig Exp $
 #
 # Copyright (c) 2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -58,17 +58,20 @@
 #
 _DEPENDS_PKGPATHS=     # empty
 .for _dep_ in ${_DEPENDS}
-.  if !defined(_DEPENDS_PKGPATH.${_dep_:C/^[^:]*://:C/:.*$//})
-_DEPENDS_PKGPATH.${_dep_:C/^[^:]*://:C/:.*$//}!=                       \
-       cd ${_dep_:C/^[^:]*://:C/:.*$//} && ${PWD_CMD}
-.  endif
-_DEPENDS_PKGPATH.${_DEPENDS_PKGPATH.${_dep_:C/^[^:]*://:C/:.*$//}}?=   \
-       ${_dep_:C/^[^:]*://:C/:.*$//}
-_DEPENDS.${_DEPENDS_PKGPATH.${_dep_:C/^[^:]*://:C/:.*$//}}+=           \
-       ${_dep_:C/:.*$//}
-.  if empty(_DEPENDS_PKGPATHS:M${_DEPENDS_PKGPATH.${_dep_:C/^[^:]*://:C/:.*$//}})
-_DEPENDS_PKGPATHS+=    ${_DEPENDS_PKGPATH.${_dep_:C/^[^:]*://:C/:.*$//}}
-.  endif
+.  for _depdir_ in ${_dep_:C/^[^:]*://:C/:.*$//}
+.    if !defined(_DEPENDS_PKGPATH.${_depdir_})
+.      if exists(${_depdir_})
+_DEPENDS_PKGPATH.${_depdir_}!= cd ${_depdir_:Q} && ${PWD_CMD}
+.      else
+PKG_FAIL_REASON+=      "[reduce-depends.mk] "${PKGPATH:Q}" depends on "${_depdir_:Q}", but the latter does not exist."
+.      endif
+.    endif
+_DEPENDS_PKGPATH.${_DEPENDS_PKGPATH.${_depdir_}}?=     ${_depdir_}
+_DEPENDS.${_DEPENDS_PKGPATH.${_depdir_}}+=             ${_dep_:C/:.*$//}
+.    if empty(_DEPENDS_PKGPATHS:M${_DEPENDS_PKGPATH.${_depdir_}})
+_DEPENDS_PKGPATHS+=    ${_DEPENDS_PKGPATH.${_depdir_}}
+.    endif
+.  endfor
 .endfor
 
 # This next block of code sets REDUCED_DEPENDS to the strictest set of



Home | Main Index | Thread Index | Old Index