pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk - Move all CHECK_FILES_SKIP definitions to a centra...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c2b3d740894e
branches:  trunk
changeset: 487489:c2b3d740894e
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Sat Jan 15 10:50:17 2005 +0000

description:
- Move all CHECK_FILES_SKIP definitions to a central place in bsd.pkg.mk.
- Move the previous block of code down in the file so that all used variables
  are defined (specially PKG_SYSCONFDIR).  Fixes a problem noticed by
  kristerw@'s bulk build in comms/minicom.
- Ignore diff's return code, which aborts make in NetBSD 1.6.2.  Also noticed
  by kristerw@'s bulk build.
- Use full paths to do the checks, instead of relative to ${PREFIX}.  Less
  ambiguity.  Matches should be turned into regular expressions that anchor
  to a whole line (tried that, but found some problems).
- Turn CHECK_FILES to NO by default.  As said in the previous point, there
  are still some problems that have to be fixed and minor improvements to
  be done.  And I have no time to fix this ATM.  Yes, this definitely needs
  more testing.  I'm sorry for all the noise.  (But hey!  you should set and
  try this feature locally! ;-)

diffstat:

 mk/bsd.pkg.install.mk |  22 +-----------------
 mk/bsd.pkg.mk         |  61 +++++++++++++++++++++++++++++++++++---------------
 mk/texinfo.mk         |   7 +-----
 3 files changed, 44 insertions(+), 46 deletions(-)

diffs (167 lines):

diff -r 499260704701 -r c2b3d740894e mk/bsd.pkg.install.mk
--- a/mk/bsd.pkg.install.mk     Sat Jan 15 09:33:48 2005 +0000
+++ b/mk/bsd.pkg.install.mk     Sat Jan 15 10:50:17 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.install.mk,v 1.68 2005/01/14 18:02:38 jmmv Exp $
+# $NetBSD: bsd.pkg.install.mk,v 1.69 2005/01/15 10:50:17 jmmv Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk to use the common
 # INSTALL/DEINSTALL scripts.  To use this Makefile fragment, simply:
@@ -190,16 +190,6 @@
 MESSAGE_SUBST+=                RCD_SCRIPTS_DIR=${RCD_SCRIPTS_DIR}
 MESSAGE_SUBST+=                RCD_SCRIPTS_EXAMPLEDIR=${RCD_SCRIPTS_EXAMPLEDIR}
 
-.if defined(PKG_DEVELOPER) && ${CHECK_FILES} == "YES"
-.  for e c in ${CONF_FILES} ${SUPPORT_FILES}
-CHECK_FILES_SKIP+=     ${c:S/${PREFIX}\///}/.pkgsrc
-.  endfor
-.  for e c u g m in ${CONF_FILES_PERMS} ${SUPPORT_FILES_PERMS}
-CHECK_FILES_SKIP+=     ${c:S/${PREFIX}\///}/.pkgsrc
-.  endfor
-.  undef e c u g m
-.endif
-
 # OWN_DIRS contains a list of directories for this package that should be
 #       created and should attempt to be destroyed by the INSTALL/DEINSTALL
 #      scripts.  MAKE_DIRS is used the same way, but the package admin
@@ -221,16 +211,6 @@
 FILES_SUBST+=          OWN_DIRS=${OWN_DIRS:Q}
 FILES_SUBST+=          OWN_DIRS_PERMS=${OWN_DIRS_PERMS:Q}
 
-.if defined(PKG_DEVELOPER) && ${CHECK_FILES} == "YES"
-.  for d in ${MAKE_DIRS} ${OWN_DIRS}
-CHECK_FILES_SKIP+=     ${d:S/${PREFIX}\///}
-.  endfor
-.  for d o g m in ${MAKE_DIRS_PERMS} ${OWN_DIRS_PERMS}
-CHECK_FILES_SKIP+=     ${d:S/${PREFIX}\///}
-.  endfor
-.  undef d o g m
-.endif
-
 # PKG_CREATE_USERGROUP indicates whether the INSTALL script should
 #      automatically add any needed users/groups to the system using
 #      useradd/groupadd.  It is either YES or NO and defaults to YES.
diff -r 499260704701 -r c2b3d740894e mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Sat Jan 15 09:33:48 2005 +0000
+++ b/mk/bsd.pkg.mk     Sat Jan 15 10:50:17 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1562 2005/01/14 18:02:38 jmmv Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1563 2005/01/15 10:50:17 jmmv Exp $
 #
 # This file is in the public domain.
 #
@@ -105,7 +105,7 @@
 CLEANDEPENDS?=         NO
 DEINSTALLDEPENDS?=     NO      # add -R to pkg_delete
 REINSTALL?=            NO      # reinstall upon update
-CHECK_FILES?=          YES     # run check-files after install
+CHECK_FILES?=          NO      # run check-files after install
 CHECK_FILES_STRICT?=   NO      # make check-files very strict on errors
 CHECK_SHLIBS?=         YES     # run check-shlibs after install
 SHLIB_HANDLING?=       YES     # do automatic shared lib handling
@@ -808,17 +808,6 @@
 MESSAGE_SUBST_SED=     ${MESSAGE_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/}
 .endif
 
-# A list of file names that will be skipped when analyzing file lists in
-# the check-files target.  This is useful to avoid getting errors triggered
-# by changes in directories not really handled by pkgsrc.
-CHECK_FILES_SKIP+=     emul/linux/proc
-
-CHECK_FILES_SKIP_CMD=
-.for name in ${CHECK_FILES_SKIP}
-CHECK_FILES_SKIP_CMD+= | ${GREP} -v ${name}
-.endfor
-.undef name
-
 # If pkgsrc is supposed to ensure that tests are run before installation
 # of the package, then the build targets should be "build test", otherwise
 # just "build" suffices.  _PKGSRC_BUILD_TARGETS is used in the "all",
@@ -3068,6 +3057,39 @@
 .  endif   # USE_LANGUAGES
 .endif
 
+# CHECK_FILES_SKIP is a list of file names that will be skipped when
+# analyzing file lists in the check-files target.  This is useful to
+# avoid getting errors triggered by changes in directories not really
+# handled by pkgsrc.
+#
+# We have to do this here, i.e., quite late in bsd.pkg.mk parsing, so
+# that the variables used in them are defined.  Otherwise we may get
+# problems with the 'for' expressions.
+.if defined(INFO_DIR)
+CHECK_FILES_SKIP+=     ${PREFIX}/${INFO_DIR}/dir
+.endif
+CHECK_FILES_SKIP+=     ${PREFIX}/emul/linux/proc
+
+.for e c in ${CONF_FILES} ${SUPPORT_FILES}
+CHECK_FILES_SKIP+=     ${c}/.pkgsrc
+.endfor
+.for e c o g m in ${CONF_FILES_PERMS} ${SUPPORT_FILES_PERMS}
+CHECK_FILES_SKIP+=     ${c}/.pkgsrc
+.endfor
+.for d in ${MAKE_DIRS} ${OWN_DIRS}
+CHECK_FILES_SKIP+=     ${d}
+.endfor
+.for d o g m in ${MAKE_DIRS_PERMS} ${OWN_DIRS_PERMS}
+CHECK_FILES_SKIP+=     ${d}
+.endfor
+.undef e c d o g m
+
+CHECK_FILES_SKIP_CMD=
+.for name in ${CHECK_FILES_SKIP}
+CHECK_FILES_SKIP_CMD+= | ${GREP} -v ${name}
+.endfor
+.undef name
+
 # Check if the generated PLIST matches the list of really installed files.
 #
 .PHONY: check-files
@@ -3076,11 +3098,11 @@
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        errors=0;                                                       \
        diff -u ${WRKDIR}/.prefix.pre ${WRKDIR}/.prefix.post            \
-               >${WRKDIR}/.files.diff;                                 \
-       ${GREP} '^+/' ${WRKDIR}/.files.diff | ${SED} 's|^+${PREFIX}/||' \
-               | ${SORT} >${WRKDIR}/.files.added;                      \
-       ${GREP} '^-/' ${WRKDIR}/.files.diff | ${SED} 's|^-${PREFIX}/||' \
-               | ${SORT} >${WRKDIR}/.files.deleted;                    \
+               >${WRKDIR}/.files.diff || ${TRUE};                      \
+       ${GREP} '^+/' ${WRKDIR}/.files.diff | ${SED} "s|^+||" | ${SORT} \
+               >${WRKDIR}/.files.added;                                \
+       ${GREP} '^-/' ${WRKDIR}/.files.diff | ${SED} "s|^-||" | ${SORT} \
+               >${WRKDIR}/.files.deleted;                              \
        if ${TEST} `${WC} -l ${WRKDIR}/.files.deleted |                 \
                ${AWK} '{ print $$1; }'` -gt 0;                         \
        then                                                            \
@@ -3089,7 +3111,8 @@
                ${SED} "s|^|        |" <${WRKDIR}/.files.deleted;       \
                errors=1;                                               \
        fi;                                                             \
-       ${GREP} '^[A-Za-z]' ${PLIST} | ${SORT} >${WRKDIR}/.files.expected; \
+       ${GREP} '^[A-Za-z]' ${PLIST} | ${SED} "s|^|${PREFIX}/|" |       \
+               ${SORT} >${WRKDIR}/.files.expected;                     \
        if ! ${CMP} -s ${WRKDIR}/.files.expected ${WRKDIR}/.files.added; then \
                echo "*** The PLIST does not match installed files!";   \
                echo "    The following files were not expected in ${PREFIX}:";\
diff -r 499260704701 -r c2b3d740894e mk/texinfo.mk
--- a/mk/texinfo.mk     Sat Jan 15 09:33:48 2005 +0000
+++ b/mk/texinfo.mk     Sat Jan 15 10:50:17 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: texinfo.mk,v 1.26 2005/01/14 18:41:00 jmmv Exp $
+# $NetBSD: texinfo.mk,v 1.27 2005/01/15 10:50:18 jmmv Exp $
 #
 # Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -56,11 +56,6 @@
 # files and the Info dir file.
 INFO_DIR?=     info
 
-# The 'dir' file has to be skipped from the check-files functionality
-# because it does not belong to any package (thus it is not registered
-# in any PLIST).
-CHECK_FILES_SKIP+=     ${INFO_DIR}/dir
-
 # Does the system have the install-info command?
 # Any version will fit (really?).
 _INSTALL_INFO=



Home | Main Index | Thread Index | Old Index