pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk/pkgtasks



Module Name:    pkgsrc
Committed By:   jlam
Date:           Thu Aug 10 05:37:32 UTC 2017

Modified Files:
        pkgsrc/mk/pkgtasks: directories.mk files.mk

Log Message:
mk/pkgtasks: Assert that directories for target files will exist.

For target files listed in CONF_FILES (and other config file
variables), assert that the containing directories are named in
MAKE_DIRS or one of the other directory variables.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 pkgsrc/mk/pkgtasks/directories.mk
cvs rdiff -u -r1.4 -r1.5 pkgsrc/mk/pkgtasks/files.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/pkgtasks/directories.mk
diff -u pkgsrc/mk/pkgtasks/directories.mk:1.1 pkgsrc/mk/pkgtasks/directories.mk:1.2
--- pkgsrc/mk/pkgtasks/directories.mk:1.1       Thu Jun  1 02:06:04 2017
+++ pkgsrc/mk/pkgtasks/directories.mk   Thu Aug 10 05:37:32 2017
@@ -1,4 +1,4 @@
-# $NetBSD: directories.mk,v 1.1 2017/06/01 02:06:04 jlam Exp $
+# $NetBSD: directories.mk,v 1.2 2017/08/10 05:37:32 jlam Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -98,6 +98,11 @@ _REQD_DIRS_PERMS=    ${REQD_DIRS_PERMS:S|^$
 # Assert that the variables have the right number of words and
 # that no directory is listed in more than one variable.
 #
+# _ALL_DIRS.directories
+#      List of directories named in MAKE_DIRS, OWN_DIRS, REQD_DIRS,
+#      MAKE_DIRS_PERMS, OWN_DIRS_PERMS, and REQD_DIRS_PERMS.  This
+#      variable is used in pkgsrc/mk/pkgtasks/files.mk.
+#
 _ALL_DIRS.directories= # empty
 .for _var_ in MAKE_DIRS OWN_DIRS REQD_DIRS
 .  for d in ${${_var_}}

Index: pkgsrc/mk/pkgtasks/files.mk
diff -u pkgsrc/mk/pkgtasks/files.mk:1.4 pkgsrc/mk/pkgtasks/files.mk:1.5
--- pkgsrc/mk/pkgtasks/files.mk:1.4     Thu Aug 10 05:25:10 2017
+++ pkgsrc/mk/pkgtasks/files.mk Thu Aug 10 05:37:32 2017
@@ -1,4 +1,4 @@
-# $NetBSD: files.mk,v 1.4 2017/08/10 05:25:10 jlam Exp $
+# $NetBSD: files.mk,v 1.5 2017/08/10 05:37:32 jlam Exp $
 #
 # Copyright (c) 2017 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -151,11 +151,24 @@ PKG_FAIL_REASON+=       ${t:Q}" is liste
 .if defined(PKG_SYSCONFSUBDIR) && !empty(PKG_SYSCONFSUBDIR)
 # Always create ${PKG_SYSCONFDIR} if ${PKG_SYSCONFSUBDIR} is non-empty.
 MAKE_DIRS_PERMS+=      ${PKG_SYSCONFDIR} ${PKG_SYSCONFDIR_PERMS}
+_ALL_DIRS.directories+=        ${PKG_SYSCONFDIR}
 .elif !empty(_ALL_TARGET_FILES.files:M${PKG_SYSCONFDIR}/*)
 # Create ${PKG_SYSCONFDIR} if any target files are in that directory.
 MAKE_DIRS+=            ${PKG_SYSCONFDIR}
+_ALL_DIRS.directories+=        ${PKG_SYSCONFDIR}
 .endif
 
+# Assert that the directories that contain target files are listed in
+# one of the directory variables.  This makes use of
+# ${_ALL_DIRS.directories}, which is defined in directories.mk.
+#
+.for t in ${_ALL_TARGET_FILES.files:O:u}
+_FILEMATCH.${t}=       ${_ALL_DIRS.directories:@d@${t:M${d}/*}@}
+.  if empty(_FILEMATCH.${t})
+PKG_FAIL_REASON+=      "This package may need MAKE_DIRS+="${t:C|/[^/]*$||:Q}
+.  endif
+.endfor
+
 _PKGTASKS_DATA.files=  ${_PKGTASKS_DIR}/files
 _PKGTASKS_DATAFILES+=  ${_PKGTASKS_DATA.files}
 



Home | Main Index | Thread Index | Old Index