2020-12-20 20:49:25 +01:00
|
|
|
# $NetBSD: check-files.mk,v 1.37 2020/12/20 19:49:25 gutteridge Exp $
|
2006-11-09 22:29:26 +01:00
|
|
|
#
|
|
|
|
# This file checks that the list of installed files matches the PLIST.
|
|
|
|
# For that purpose it records the file list of LOCALBASE before and
|
|
|
|
# after the installation of the package and compares these lists with
|
|
|
|
# the PLIST.
|
|
|
|
#
|
|
|
|
# User-settable variables:
|
|
|
|
#
|
|
|
|
# CHECK_FILES
|
|
|
|
# "yes" to enable the check, "no" to disable it.
|
|
|
|
#
|
2017-10-02 16:14:04 +02:00
|
|
|
# Default value: "yes"
|
2006-11-09 22:29:26 +01:00
|
|
|
#
|
|
|
|
# CHECK_FILES_STRICT
|
|
|
|
# When set to "yes", VARBASE and PKG_SYSCONFDIR are checked in
|
|
|
|
# addition to LOCALBASE.
|
|
|
|
#
|
|
|
|
# Package-settable variables:
|
|
|
|
#
|
|
|
|
# CHECK_FILES_SKIP
|
|
|
|
# A list of regular expressions (FIXME: all other checks use shell
|
|
|
|
# patterns) that names files to be skipped. This is useful to
|
|
|
|
# avoid getting errors triggered by changes in directories not
|
|
|
|
# really handled by pkgsrc.
|
|
|
|
#
|
2005-06-23 10:31:20 +02:00
|
|
|
|
2007-03-16 11:29:22 +01:00
|
|
|
_VARGROUPS+= check-files
|
|
|
|
_USER_VARS.check-files= CHECK_FILES CHECK_FILES_STRICT
|
|
|
|
_PKG_VARS.check-files= CHECK_FILES_SKIP
|
|
|
|
|
2006-05-08 23:29:07 +02:00
|
|
|
CHECK_FILES?= yes
|
2005-06-23 10:31:20 +02:00
|
|
|
CHECK_FILES_STRICT?= no
|
|
|
|
|
2005-12-29 23:32:20 +01:00
|
|
|
# Info index files updated when a new info file is added.
|
2006-03-20 02:48:57 +01:00
|
|
|
.if defined(INFO_FILES)
|
2009-05-08 22:46:29 +02:00
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/.*/dir
|
2005-06-23 10:31:20 +02:00
|
|
|
.endif
|
2005-12-29 23:32:20 +01:00
|
|
|
|
|
|
|
# Perl's perllocal.pod index that is regenerated when a local module
|
|
|
|
# is added.
|
|
|
|
#
|
2005-08-20 00:07:46 +02:00
|
|
|
CHECK_FILES_SKIP+= ${PERL5_INSTALLARCHLIB}/perllocal.pod
|
2005-12-29 23:32:20 +01:00
|
|
|
|
2006-01-07 20:51:42 +01:00
|
|
|
# R's index files that are regenerated when a local module
|
|
|
|
# is added.
|
|
|
|
#
|
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/lib/R/doc/html/packages.html
|
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/lib/R/doc/html/search/index.txt
|
|
|
|
|
2007-08-13 07:05:11 +02:00
|
|
|
CHECK_FILES_SKIP+= ${PKG_DBDIR}/.*
|
|
|
|
|
2008-02-09 00:13:35 +01:00
|
|
|
# We don't care about what's under linux/proc and linux32/proc in Linux
|
|
|
|
# emulation, which just holds run-time generated data.
|
2005-12-29 23:32:20 +01:00
|
|
|
#
|
2005-09-25 02:34:12 +02:00
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/emul/linux/proc.*
|
2008-02-09 00:13:35 +01:00
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/emul/linux32/proc.*
|
2005-12-29 23:32:20 +01:00
|
|
|
|
2017-06-01 04:15:10 +02:00
|
|
|
# The reference-count meta-data directory used by the {de,}install scripts.
|
2005-09-25 02:34:12 +02:00
|
|
|
CHECK_FILES_SKIP+= ${PKG_DBDIR}.refcount.*
|
2005-12-29 23:32:20 +01:00
|
|
|
|
2007-03-16 11:17:13 +01:00
|
|
|
# Some people have their distfiles and binary packages below ${LOCALBASE}.
|
|
|
|
CHECK_FILES_SKIP+= ${PACKAGES}/.*
|
|
|
|
CHECK_FILES_SKIP+= ${DISTDIR}/.*
|
|
|
|
|
2007-09-12 12:22:53 +02:00
|
|
|
# For unprivileged builds, VARBASE is below LOCALBASE.
|
2007-09-27 15:57:12 +02:00
|
|
|
.if !empty(CHECK_FILES_STRICT:M[Nn][Oo])
|
2007-09-12 12:22:53 +02:00
|
|
|
CHECK_FILES_SKIP+= ${VARBASE}/.*
|
2007-09-27 15:57:12 +02:00
|
|
|
.endif
|
2007-09-12 12:22:53 +02:00
|
|
|
|
2020-12-20 20:49:25 +01:00
|
|
|
# Files that are outside of ${PREFIX} in directories we already know we'll
|
2005-12-29 23:32:20 +01:00
|
|
|
# be using for mutable data.
|
|
|
|
#
|
2005-08-20 04:45:05 +02:00
|
|
|
.for d in ${MAKE_DIRS} ${OWN_DIRS}
|
2005-09-25 02:34:12 +02:00
|
|
|
CHECK_FILES_SKIP+= ${d:C/^([^\/])/${PREFIX}\/\1/}.*
|
2005-06-23 10:31:20 +02:00
|
|
|
.endfor
|
2017-06-01 00:56:22 +02:00
|
|
|
.for _var_ in MAKE_DIRS_PERMS OWN_DIRS_PERMS
|
|
|
|
. if empty(${_var_}) || empty(${_var_}:C/.*/4/:M*:S/4 4 4 4//gW)
|
|
|
|
. for d o g m in ${${_var_}}
|
2005-09-25 02:34:12 +02:00
|
|
|
CHECK_FILES_SKIP+= ${d:C/^([^\/])/${PREFIX}\/\1/}.*
|
2017-06-01 00:56:22 +02:00
|
|
|
. endfor
|
|
|
|
. endif
|
2005-06-23 10:31:20 +02:00
|
|
|
.endfor
|
2005-12-29 23:32:20 +01:00
|
|
|
|
2005-12-29 23:39:09 +01:00
|
|
|
# Mutable X11 font database files
|
2006-09-22 23:53:56 +02:00
|
|
|
.if (defined(FONTS_DIRS.x11) && !empty(FONTS_DIRS.x11:M*))
|
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/.*/encodings.dir
|
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/.*/fonts.dir
|
|
|
|
.endif
|
|
|
|
.if (defined(FONTS_DIRS.ttf) && !empty(FONTS_DIRS.ttf:M*)) || \
|
|
|
|
(defined(FONTS_DIRS.type1) && !empty(FONTS_DIRS.type1:M*))
|
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/.*/fonts.scale
|
|
|
|
.endif
|
2006-02-23 15:38:07 +01:00
|
|
|
.if (defined(FONTS_DIRS.ttf) && !empty(FONTS_DIRS.ttf:M*)) || \
|
|
|
|
(defined(FONTS_DIRS.type1) && !empty(FONTS_DIRS.type1:M*)) || \
|
|
|
|
(defined(FONTS_DIRS.x11) && !empty(FONTS_DIRS.x11:M*))
|
2006-09-17 19:02:38 +02:00
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/.*/fonts.cache-1
|
2006-02-23 15:38:07 +01:00
|
|
|
.endif
|
2005-12-29 23:39:09 +01:00
|
|
|
|
2017-06-14 18:23:09 +02:00
|
|
|
# Mutable icon theme cache files
|
|
|
|
.if !empty(ICON_THEMES:M[Yy][Ee][Ss])
|
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/share/icons/.*/icon-theme.cache
|
|
|
|
.endif
|
|
|
|
|
2009-10-21 20:00:00 +02:00
|
|
|
# Mutable charset.alias file
|
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/lib/charset.alias
|
|
|
|
|
2012-05-22 09:59:31 +02:00
|
|
|
# Mutable locale.alias file
|
|
|
|
CHECK_FILES_SKIP+= ${PREFIX}/share/locale/locale.alias
|
|
|
|
|
2006-10-09 14:25:44 +02:00
|
|
|
_CHECK_FILES_SKIP_FILTER= ${GREP} -vx ${CHECK_FILES_SKIP:@f@-e ${DESTDIR:Q}${f:Q}@}
|
2005-06-23 10:31:20 +02:00
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
# These are the files generated and used by the check-files implementation
|
|
|
|
# used across several check-files targets.
|
|
|
|
#
|
2006-06-09 15:59:06 +02:00
|
|
|
# _CHECK_FILES_ERRMSG.* are the files that contain the error
|
2005-06-23 10:31:20 +02:00
|
|
|
# messages discovered during each stage of file-checking.
|
|
|
|
#
|
|
|
|
# _CHECK_FILES_PRE.* are the file lists generated before any files
|
|
|
|
# from the package are installed.
|
|
|
|
#
|
|
|
|
# _CHECK_FILES_POST.* are the file lists generated after all files
|
|
|
|
# from the package are installed.
|
|
|
|
#
|
|
|
|
# The "pre" and "post" file lists are compared against each other to
|
|
|
|
# determine if the package is installing files where it shouldn't be.
|
|
|
|
#
|
2006-06-09 15:59:06 +02:00
|
|
|
_CHECK_FILES_ERRMSG.prefix= ${ERROR_DIR}/check-files-prefix
|
2005-06-23 10:31:20 +02:00
|
|
|
_CHECK_FILES_PRE.prefix= ${WRKDIR}/.prefix.pre
|
|
|
|
_CHECK_FILES_POST.prefix= ${WRKDIR}/.prefix.post
|
|
|
|
|
2006-06-09 15:59:06 +02:00
|
|
|
_CHECK_FILES_ERRMSG.sysconfdir= ${ERROR_DIR}/.check-files-sysconfdir
|
2005-06-23 10:31:20 +02:00
|
|
|
_CHECK_FILES_PRE.sysconfdir= ${WRKDIR}/.sysconfdir.pre
|
|
|
|
_CHECK_FILES_POST.sysconfdir= ${WRKDIR}/.sysconfdir.post
|
|
|
|
|
2006-06-09 15:59:06 +02:00
|
|
|
_CHECK_FILES_ERRMSG.varbase= ${ERROR_DIR}/.check-files-varbase
|
2005-06-23 10:31:20 +02:00
|
|
|
_CHECK_FILES_PRE.varbase= ${WRKDIR}/.varbase.pre
|
|
|
|
_CHECK_FILES_POST.varbase= ${WRKDIR}/.varbase.post
|
|
|
|
|
2006-06-09 15:59:06 +02:00
|
|
|
_CHECK_FILES_ERRMSGS= # empty
|
|
|
|
_CHECK_FILES_ERRMSGS+= ${_CHECK_FILES_ERRMSG.prefix}
|
2005-06-23 10:31:20 +02:00
|
|
|
.if empty(CHECK_FILES_STRICT:M[nN][oO])
|
2006-06-09 15:59:06 +02:00
|
|
|
_CHECK_FILES_ERRMSGS+= ${_CHECK_FILES_ERRMSG.sysconfdir}
|
|
|
|
_CHECK_FILES_ERRMSGS+= ${_CHECK_FILES_ERRMSG.varbase}
|
2005-06-23 10:31:20 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
# _CHECK_FILES_PRE holds the list of targets that are built as part of
|
|
|
|
# building the check-files-pre target. These targets should cause the
|
|
|
|
# "pre" file lists to be generated.
|
|
|
|
#
|
2014-02-20 10:15:15 +01:00
|
|
|
_CHECK_FILES_PRE= #
|
2005-06-23 10:31:20 +02:00
|
|
|
_CHECK_FILES_PRE+= ${_CHECK_FILES_PRE.prefix}
|
|
|
|
.if empty(CHECK_FILES_STRICT:M[nN][oO])
|
|
|
|
_CHECK_FILES_PRE+= ${_CHECK_FILES_PRE.sysconfdir}
|
|
|
|
_CHECK_FILES_PRE+= ${_CHECK_FILES_PRE.varbase}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
# _CHECK_FILES_POST holds the list of targets that are built as part of
|
|
|
|
# building the check-files-post target. These targets should cause the
|
|
|
|
# "post" file lists to be generated.
|
|
|
|
#
|
2014-02-20 10:15:15 +01:00
|
|
|
_CHECK_FILES_POST= #
|
2005-06-23 10:31:20 +02:00
|
|
|
_CHECK_FILES_POST+= ${_CHECK_FILES_POST.prefix}
|
|
|
|
.if empty(CHECK_FILES_STRICT:M[nN][oO])
|
|
|
|
_CHECK_FILES_POST+= ${_CHECK_FILES_POST.sysconfdir}
|
|
|
|
_CHECK_FILES_POST+= ${_CHECK_FILES_POST.varbase}
|
|
|
|
.endif
|
|
|
|
|
2007-01-06 21:15:26 +01:00
|
|
|
.if empty(CHECK_FILES:M[nN][oO])
|
|
|
|
privileged-install-hook: check-files
|
|
|
|
.endif
|
|
|
|
|
2005-06-23 10:31:20 +02:00
|
|
|
###########################################################################
|
|
|
|
# check-files-pre and check-files-post targets and subtargets
|
|
|
|
#
|
|
|
|
.PHONY: check-files-pre check-files-post
|
2014-02-20 10:15:15 +01:00
|
|
|
check-files-pre: check-files-pre-message ${_CHECK_FILES_PRE}
|
|
|
|
check-files-post: check-files-post-message ${_CHECK_FILES_POST}
|
2005-06-23 10:31:20 +02:00
|
|
|
|
|
|
|
.PHONY: check-files-pre-message check-files-post-message
|
|
|
|
check-files-pre-message:
|
2008-01-23 15:30:59 +01:00
|
|
|
@${STEP_MSG} "Generating pre-install file lists"
|
2005-06-23 10:31:20 +02:00
|
|
|
|
|
|
|
check-files-post-message:
|
2008-01-23 15:30:59 +01:00
|
|
|
@${STEP_MSG} "Generating post-install file lists"
|
2005-06-23 10:31:20 +02:00
|
|
|
|
|
|
|
${_CHECK_FILES_PRE.prefix} ${_CHECK_FILES_POST.prefix}:
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-10-09 14:25:44 +02:00
|
|
|
${FIND} ${DESTDIR}${PREFIX}/. \( -type f -o -type l \) -print 2>/dev/null \
|
2006-05-10 18:09:08 +02:00
|
|
|
| ${SED} -e 's,/\./,/,' \
|
2006-08-22 20:50:56 +02:00
|
|
|
| ${_CHECK_FILES_SKIP_FILTER} \
|
|
|
|
| ${SORT} > ${.TARGET} \
|
2005-06-23 10:31:20 +02:00
|
|
|
|| ${TRUE}
|
|
|
|
|
|
|
|
${_CHECK_FILES_PRE.sysconfdir} ${_CHECK_FILES_POST.sysconfdir}:
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-10-09 14:25:44 +02:00
|
|
|
${FIND} ${DESTDIR}${PKG_SYSCONFDIR}/. -print 2>/dev/null \
|
2006-05-10 18:09:08 +02:00
|
|
|
| ${SED} -e 's,/\./,/,' \
|
2006-08-22 20:50:56 +02:00
|
|
|
| ${_CHECK_FILES_SKIP_FILTER} \
|
|
|
|
| ${SORT} > ${.TARGET} \
|
2005-06-23 10:31:20 +02:00
|
|
|
|| ${TRUE}
|
|
|
|
|
|
|
|
${_CHECK_FILES_PRE.varbase} ${_CHECK_FILES_POST.varbase}:
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-10-09 14:25:44 +02:00
|
|
|
${FIND} ${DESTDIR}${VARBASE}/. -print 2>/dev/null \
|
2006-05-10 18:09:08 +02:00
|
|
|
| ${SED} -e 's,/\./,/,' \
|
2006-08-22 20:50:56 +02:00
|
|
|
| ${_CHECK_FILES_SKIP_FILTER} \
|
|
|
|
| ${SORT} > ${.TARGET} \
|
2005-06-23 10:31:20 +02:00
|
|
|
|| ${TRUE}
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
# check-files targets and subtargets
|
|
|
|
#
|
|
|
|
.PHONY: check-files-prefix check-files-sysconfdir check-files-varbase
|
2006-06-09 15:59:06 +02:00
|
|
|
check-files-prefix: ${_CHECK_FILES_ERRMSG.prefix}
|
|
|
|
check-files-sysconfdir: ${_CHECK_FILES_ERRMSG.sysconfdir}
|
|
|
|
check-files-varbase: ${_CHECK_FILES_ERRMSG.varbase}
|
2005-06-23 10:31:20 +02:00
|
|
|
|
|
|
|
# The check-files target looks at the cookie files generated by the
|
|
|
|
# check-files-* subtargets, and if they are non-empty, then they
|
|
|
|
# contain the error messages collected during the build of each
|
|
|
|
# subtarget.
|
|
|
|
#
|
|
|
|
.PHONY: check-files
|
2006-06-09 18:12:08 +02:00
|
|
|
.if !empty(CHECK_FILES_SUPPORTED:M[nN][oO])
|
|
|
|
check-files:
|
|
|
|
@${DO_NADA}
|
|
|
|
.else
|
2006-06-09 15:59:06 +02:00
|
|
|
check-files: check-files-message ${_CHECK_FILES_ERRMSGS} error-check
|
2006-06-09 18:12:08 +02:00
|
|
|
.endif
|
2006-06-09 15:59:06 +02:00
|
|
|
|
|
|
|
.PHONY: check-files-message
|
|
|
|
check-files-message:
|
|
|
|
@${STEP_MSG} "Checking file-check results for ${PKGNAME}"
|
2005-06-23 10:31:20 +02:00
|
|
|
|
2005-08-15 19:33:31 +02:00
|
|
|
# Check ${PREFIX} for files which are not listed in the generated ${PLIST}
|
|
|
|
# and vice-versa.
|
|
|
|
#
|
2006-06-07 22:28:59 +02:00
|
|
|
_CHECK_FILES_DIFF= ${WRKDIR}/.check_files_diff
|
|
|
|
_CHECK_FILES_ADDED= ${WRKDIR}/.check_files_added
|
|
|
|
_CHECK_FILES_DELETED= ${WRKDIR}/.check_files_deleted
|
|
|
|
_CHECK_FILES_EXPECTED= ${WRKDIR}/.check_files_expected
|
|
|
|
_CHECK_FILES_MISSING= ${WRKDIR}/.check_files_missing
|
|
|
|
_CHECK_FILES_MISSING_SKIP= ${WRKDIR}/.check_files_missing_skip
|
|
|
|
_CHECK_FILES_MISSING_REAL= ${WRKDIR}/.check_files_missing_real
|
|
|
|
_CHECK_FILES_EXTRA= ${WRKDIR}/.check_files_extra
|
|
|
|
|
|
|
|
${_CHECK_FILES_DIFF}: ${_CHECK_FILES_PRE.prefix} ${_CHECK_FILES_POST.prefix}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
${DIFF} -u ${_CHECK_FILES_PRE.prefix} \
|
|
|
|
${_CHECK_FILES_POST.prefix} \
|
2006-06-09 18:41:09 +02:00
|
|
|
> ${.TARGET} || ${TRUE}
|
2006-06-07 22:28:59 +02:00
|
|
|
|
|
|
|
${_CHECK_FILES_ADDED}: ${_CHECK_FILES_DIFF}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
${GREP} '^+/' ${_CHECK_FILES_DIFF} | ${SED} "s|^+||" | ${SORT} \
|
2006-06-09 18:41:09 +02:00
|
|
|
> ${.TARGET}
|
2006-06-07 22:28:59 +02:00
|
|
|
|
|
|
|
${_CHECK_FILES_DELETED}: ${_CHECK_FILES_DIFF}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
${GREP} '^-/' ${_CHECK_FILES_DIFF} | ${SED} "s|^-||" | ${SORT} \
|
2006-06-09 18:41:09 +02:00
|
|
|
> ${.TARGET}
|
2006-06-07 22:28:59 +02:00
|
|
|
|
|
|
|
${_CHECK_FILES_EXPECTED}: plist
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-10-09 14:25:44 +02:00
|
|
|
${GREP} '^[^@]' ${PLIST} | ${SED} "s|^|${DESTDIR}${PREFIX}/|" | ${SORT} \
|
2006-06-09 18:41:09 +02:00
|
|
|
> ${.TARGET}
|
2006-06-07 22:28:59 +02:00
|
|
|
|
|
|
|
${_CHECK_FILES_MISSING}: ${_CHECK_FILES_EXPECTED} ${_CHECK_FILES_ADDED}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
${DIFF} -u ${_CHECK_FILES_EXPECTED} ${_CHECK_FILES_ADDED} | \
|
|
|
|
${GREP} '^-[^-]' | ${SED} "s|^-||" | \
|
|
|
|
while read file; do \
|
2007-08-21 23:44:23 +02:00
|
|
|
${TEST} -f "$$file" -o -h "$$file" || ${ECHO} "$$file"; \
|
2006-06-09 18:41:09 +02:00
|
|
|
done > ${.TARGET}
|
2006-06-07 22:28:59 +02:00
|
|
|
|
|
|
|
${_CHECK_FILES_MISSING_REAL}: ${_CHECK_FILES_MISSING}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
${CAT} ${_CHECK_FILES_MISSING} | ${_CHECK_FILES_SKIP_FILTER} \
|
2006-06-09 18:41:09 +02:00
|
|
|
> ${.TARGET} || ${TRUE}
|
2006-06-07 22:28:59 +02:00
|
|
|
|
|
|
|
${_CHECK_FILES_MISSING_SKIP}: \
|
|
|
|
${_CHECK_FILES_MISSING} \
|
|
|
|
${_CHECK_FILES_MISSING_REAL}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
${DIFF} -u ${_CHECK_FILES_MISSING} \
|
|
|
|
${_CHECK_FILES_MISSING_REAL} | \
|
|
|
|
${GREP} '^-[^-]' | ${SED} "s|^-||" \
|
2006-06-09 18:41:09 +02:00
|
|
|
> ${.TARGET}
|
2006-12-15 14:15:06 +01:00
|
|
|
|
2006-06-07 22:28:59 +02:00
|
|
|
${_CHECK_FILES_EXTRA}: ${_CHECK_FILES_EXPECTED} ${_CHECK_FILES_ADDED}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
${DIFF} -u ${_CHECK_FILES_EXPECTED} ${_CHECK_FILES_ADDED} | \
|
|
|
|
${GREP} '^+[^+]' | ${SED} "s|^+||" | \
|
|
|
|
while read file; do \
|
2007-08-21 23:44:23 +02:00
|
|
|
${TEST} ! -f "$$file" -a ! -h "$$file" || ${ECHO} "$$file"; \
|
2006-06-09 18:41:09 +02:00
|
|
|
done > ${.TARGET}
|
2006-06-07 22:28:59 +02:00
|
|
|
|
2006-06-09 15:59:06 +02:00
|
|
|
${_CHECK_FILES_ERRMSG.prefix}: \
|
2006-06-07 22:28:59 +02:00
|
|
|
${_CHECK_FILES_DELETED} \
|
|
|
|
${_CHECK_FILES_MISSING} \
|
|
|
|
${_CHECK_FILES_MISSING_REAL} \
|
|
|
|
${_CHECK_FILES_MISSING_SKIP} \
|
|
|
|
${_CHECK_FILES_EXTRA}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN}${RM} -f ${.TARGET}
|
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
if ${_NONZERO_FILESIZE_P} ${_CHECK_FILES_DELETED}; then \
|
|
|
|
${ECHO} "The following files have been deleted" \
|
|
|
|
"from ${PREFIX}!"; \
|
|
|
|
${SED} "s|^| |" ${_CHECK_FILES_DELETED}; \
|
2006-06-09 18:41:09 +02:00
|
|
|
fi >> ${.TARGET}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
if ${_NONZERO_FILESIZE_P} ${_CHECK_FILES_MISSING_REAL}; then \
|
|
|
|
${ECHO} "************************************************************"; \
|
|
|
|
${ECHO} "The following files are in the" \
|
2013-03-08 16:32:52 +01:00
|
|
|
"PLIST but not in ${DESTDIR}${PREFIX}:"; \
|
2006-06-07 22:28:59 +02:00
|
|
|
${SED} "s|^| |" ${_CHECK_FILES_MISSING_REAL}; \
|
2006-06-09 18:41:09 +02:00
|
|
|
fi >> ${.TARGET}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
if ${_NONZERO_FILESIZE_P} ${_CHECK_FILES_EXTRA}; then \
|
|
|
|
${ECHO} "************************************************************"; \
|
|
|
|
${ECHO} "The following files are in" \
|
2013-03-08 16:32:52 +01:00
|
|
|
"${DESTDIR}${PREFIX} but not in the PLIST:"; \
|
2006-06-07 22:28:59 +02:00
|
|
|
${SED} "s|^| |" ${_CHECK_FILES_EXTRA}; \
|
2006-06-09 18:41:09 +02:00
|
|
|
fi >> ${.TARGET}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
if ${_NONZERO_FILESIZE_P} ${_CHECK_FILES_MISSING_SKIP}; then \
|
|
|
|
${ECHO} "************************************************************"; \
|
|
|
|
${ECHO} "The following files are in both the" \
|
|
|
|
"PLIST and CHECK_FILES_SKIP:"; \
|
|
|
|
${SED} "s|^| |" ${_CHECK_FILES_MISSING_SKIP}; \
|
2006-06-09 18:41:09 +02:00
|
|
|
fi >> ${.TARGET}
|
2005-06-23 10:31:20 +02:00
|
|
|
|
2017-04-01 22:55:39 +02:00
|
|
|
# Check ${PKG_SYSCONFDIR} for files which are not in the PLIST and are
|
|
|
|
# also not copied into place by the INSTALL scripts.
|
2005-06-23 10:31:20 +02:00
|
|
|
#
|
2006-06-09 15:59:06 +02:00
|
|
|
${_CHECK_FILES_ERRMSG.sysconfdir}: \
|
2006-06-07 22:28:59 +02:00
|
|
|
${_CHECK_FILES_PRE.sysconfdir} \
|
|
|
|
${_CHECK_FILES_POST.sysconfdir}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
if ${CMP} -s ${_CHECK_FILES_PRE.sysconfdir} \
|
|
|
|
${_CHECK_FILES_POST.sysconfdir}; then \
|
|
|
|
${DO_NADA}; \
|
2006-11-12 21:57:55 +01:00
|
|
|
else \
|
2006-06-07 22:28:59 +02:00
|
|
|
${ECHO} "************************************************************"; \
|
|
|
|
${ECHO} "The package has modified ${PKG_SYSCONFDIR}" \
|
|
|
|
"contents directly!"; \
|
|
|
|
${ECHO} " The offending files/directories are:"; \
|
|
|
|
${DIFF} -u ${_CHECK_FILES_PRE.sysconfdir} \
|
|
|
|
${_CHECK_FILES_POST.sysconfdir} | \
|
|
|
|
${GREP} '^+[^+]' | ${SED} "s|^+| |"; \
|
2006-06-09 18:41:09 +02:00
|
|
|
fi > ${.TARGET}
|
2005-06-23 10:31:20 +02:00
|
|
|
|
|
|
|
# Check ${VARBASE} for files which are not in the PLIST and are also
|
|
|
|
# not created by the INSTALL scripts.
|
|
|
|
#
|
2006-06-09 15:59:06 +02:00
|
|
|
${_CHECK_FILES_ERRMSG.varbase}: \
|
2006-06-07 22:28:59 +02:00
|
|
|
${_CHECK_FILES_PRE.varbase} \
|
|
|
|
${_CHECK_FILES_POST.varbase}
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-07 22:28:59 +02:00
|
|
|
if ${CMP} -s ${_CHECK_FILES_PRE.varbase} \
|
|
|
|
${_CHECK_FILES_POST.varbase}; then \
|
|
|
|
${DO_NADA}; \
|
|
|
|
else \
|
|
|
|
${ECHO} "************************************************************"; \
|
|
|
|
${ECHO} "The package has modified ${VARBASE}" \
|
|
|
|
"contents directly!"; \
|
|
|
|
${ECHO} " The offending files/directories are:"; \
|
|
|
|
${DIFF} -u ${_CHECK_FILES_PRE.varbase} \
|
|
|
|
${_CHECK_FILES_POST.varbase} | \
|
|
|
|
${GREP} '^+[^+]' | ${SED} "s|^+| |"; \
|
2006-06-09 18:41:09 +02:00
|
|
|
fi > ${.TARGET}
|
2005-06-23 11:02:46 +02:00
|
|
|
|
|
|
|
###########################################################################
|
First pass at implementing support for package system flavors other
than pkgsrc's current one. This is an important lead-up to any project
that redesigns the pkg_* tools in that it doesn't tie us to past design
(mis)choices. This commit mostly deals with rearranging code, although
there was a considerable amount of rewriting done in cases where I
thought the code was somewhat messy and was difficult to understand.
The design I chose for supporting multiple package system flavors is
that the various depends, install, package, etc. modules would define
default targets and variables that may be overridden in files from
pkgsrc/mk/flavor/${PKG_FLAVOR}. The default targets would do the
sensible thing of doing nothing, and pkgsrc infrastructure would rely
on the appropriate things to be defined in pkgsrc/mk/flavor to do the
real work. The pkgsrc/mk/flavor directory contains subdirectories
corresponding to each package system flavor that we support. Currently,
I only have "pkg" which represents the current pkgsrc-native package
flavor. I've separated out most of the code where we make assumptions
about the package system flavor, mostly either because we directly
use the pkg_* tools, or we make assumptions about the package meta-data
directory, or we directly manipulate the package meta-data files, and
placed it into pkgsrc/mk/flavor/pkg.
There are several new modules that have been refactored out of bsd.pkg.mk
as part of these changes: check, depends, install, package, and update.
Each of these modules has been slimmed down by rewriting them to avoid
some recursive make calls. I've also religiously documented which
targets are "public" and which are "private" so that users won't rely
on reaching into pkgsrc innards to call a private target.
The "depends" module is a complete overhaul of the way that we handle
dependencies. There is now a separate "depends" phase that occurs
before the "extract" phase where dependencies are installed. This
differs from the old way where dependencies were installed just before
extraction occurred. The reduce-depends.mk file is now replaced by
a script that is invoked only once during the depends phase and is
used to generate a cookie file that holds the full set of reduced
dependencies. It is now possible to type "make depends" in a package
directory and all missing dependencies will be installed.
Future work on this project include:
* Resolve the workflow design in anticipation of future work on
staged installations where "package" conceptually happens before
"install".
* Rewrite the buildlink3 framework to not assume the use of the
pkgsrc pkg_* tools.
* Rewrite the pkginstall framework to provide a standard pkg_*
tool to perform the actions, and allowing a purely declarative
file per package to describe what actions need to be taken at
install or deinstall time.
* Implement support for the SVR4 package flavor. This will be
proof that the appropriate abstractions are in place to allow
using a completely different set of package management tools.
2006-06-04 01:11:42 +02:00
|
|
|
# check-files-clean removes the state files related to the "check-files"
|
|
|
|
# target so that the check-files-{pre,post} targets may be re-run.
|
2005-06-23 11:02:46 +02:00
|
|
|
#
|
First pass at implementing support for package system flavors other
than pkgsrc's current one. This is an important lead-up to any project
that redesigns the pkg_* tools in that it doesn't tie us to past design
(mis)choices. This commit mostly deals with rearranging code, although
there was a considerable amount of rewriting done in cases where I
thought the code was somewhat messy and was difficult to understand.
The design I chose for supporting multiple package system flavors is
that the various depends, install, package, etc. modules would define
default targets and variables that may be overridden in files from
pkgsrc/mk/flavor/${PKG_FLAVOR}. The default targets would do the
sensible thing of doing nothing, and pkgsrc infrastructure would rely
on the appropriate things to be defined in pkgsrc/mk/flavor to do the
real work. The pkgsrc/mk/flavor directory contains subdirectories
corresponding to each package system flavor that we support. Currently,
I only have "pkg" which represents the current pkgsrc-native package
flavor. I've separated out most of the code where we make assumptions
about the package system flavor, mostly either because we directly
use the pkg_* tools, or we make assumptions about the package meta-data
directory, or we directly manipulate the package meta-data files, and
placed it into pkgsrc/mk/flavor/pkg.
There are several new modules that have been refactored out of bsd.pkg.mk
as part of these changes: check, depends, install, package, and update.
Each of these modules has been slimmed down by rewriting them to avoid
some recursive make calls. I've also religiously documented which
targets are "public" and which are "private" so that users won't rely
on reaching into pkgsrc innards to call a private target.
The "depends" module is a complete overhaul of the way that we handle
dependencies. There is now a separate "depends" phase that occurs
before the "extract" phase where dependencies are installed. This
differs from the old way where dependencies were installed just before
extraction occurred. The reduce-depends.mk file is now replaced by
a script that is invoked only once during the depends phase and is
used to generate a cookie file that holds the full set of reduced
dependencies. It is now possible to type "make depends" in a package
directory and all missing dependencies will be installed.
Future work on this project include:
* Resolve the workflow design in anticipation of future work on
staged installations where "package" conceptually happens before
"install".
* Rewrite the buildlink3 framework to not assume the use of the
pkgsrc pkg_* tools.
* Rewrite the pkginstall framework to provide a standard pkg_*
tool to perform the actions, and allowing a purely declarative
file per package to describe what actions need to be taken at
install or deinstall time.
* Implement support for the SVR4 package flavor. This will be
proof that the appropriate abstractions are in place to allow
using a completely different set of package management tools.
2006-06-04 01:11:42 +02:00
|
|
|
.PHONY: check-files-clean
|
|
|
|
check-clean: check-files-clean
|
|
|
|
check-files-clean:
|
2008-02-07 22:36:13 +01:00
|
|
|
${RUN} \
|
2006-06-09 15:59:06 +02:00
|
|
|
${RM} -f ${_CHECK_FILES_ERRMSGS} \
|
2006-06-07 22:28:59 +02:00
|
|
|
${_CHECK_FILES_PRE} ${_CHECK_FILES_POST} \
|
|
|
|
${_CHECK_FILES_DIFF} ${_CHECK_FILES_ADDED} \
|
|
|
|
${_CHECK_FILES_DELETED} ${_CHECK_FILES_EXPECTED} \
|
|
|
|
${_CHECK_FILES_MISSING} ${_CHECK_FILES_MISSING_SKIP} \
|
|
|
|
${_CHECK_FILES_MISSING_REAL} ${_CHECK_FILES_EXTRA}
|