summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2006-04-06 17:57:34 +0000
committerjlam <jlam>2006-04-06 17:57:34 +0000
commite1a93a9b559f4fc3edae444c2285b97dd8e17de6 (patch)
tree3aa46c0c627b06bfc12b54cdffde4d412bcd1523
parent0affb758e72c0d47db2176f4354b61d6982f8577 (diff)
downloadpkgsrc-e1a93a9b559f4fc3edae444c2285b97dd8e17de6.tar.gz
Resurrect INFO_DIR for another purpose -- if defined, it sets the
directory containing the "dir" file that is updated. This allows packages to install info files in one place but update the dir file in a separate location.
-rw-r--r--mk/install/bsd.pkginstall.mk20
-rw-r--r--mk/install/info-files19
2 files changed, 26 insertions, 13 deletions
diff --git a/mk/install/bsd.pkginstall.mk b/mk/install/bsd.pkginstall.mk
index b15fde049cb..ba4538df970 100644
--- a/mk/install/bsd.pkginstall.mk
+++ b/mk/install/bsd.pkginstall.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkginstall.mk,v 1.44 2006/03/20 01:48:58 jlam Exp $
+# $NetBSD: bsd.pkginstall.mk,v 1.45 2006/04/06 17:57:34 jlam Exp $
#
# This Makefile fragment is included by bsd.pkg.mk and implements the
# common INSTALL/DEINSTALL scripts framework. To use the pkginstall
@@ -470,6 +470,12 @@ ${_INSTALL_DIRS_FILE}: ../../mk/install/dirs
${TOUCH} ${TOUCH_ARGS} ${.TARGET}; \
fi
+# INFO_DIR, if defined, specifies the directory path containing the "dir"
+# index file that should be updated. If the pathname is relative,
+# then it is taken to be relative to ${PREFIX}. This shouldn't
+# be needed unless "dir" is not in the same directory as the
+# installed info files.
+#
_INSTALL_INFO_FILES_FILE= ${_PKGINSTALL_DIR}/info-files
_INSTALL_INFO_FILES_DATAFILE= ${_PKGINSTALL_DIR}/info-files-data
_INSTALL_UNPACK_TMPL+= ${_INSTALL_INFO_FILES_FILE}
@@ -511,12 +517,18 @@ ${_INSTALL_INFO_FILES_FILE}: ../../mk/install/info-files
install-script-data: install-script-data-info-files
install-script-data-info-files:
.if defined(INFO_FILES)
- ${_PKG_SILENT}${_PKG_DEBUG} \
+ ${_PKG_SILENT}${_PKG_DEBUG}${_FUNC_STRIP_PREFIX}; \
if ${TEST} -x ${INSTALL_FILE}; then \
${INFO_FILES_cmd} | \
while read file; do \
- ${ECHO} "# INFO: $$file" \
- >> ${INSTALL_FILE}; \
+ infodir=${INFO_DIR:Q}; \
+ infodir=`strip_prefix "$$infodir"`; \
+ case "$$infodir" in \
+ "") ${ECHO} "# INFO: $$file" \
+ >> ${INSTALL_FILE} ;; \
+ *) ${ECHO} "# INFO: $$file $$infodir" \
+ >> ${INSTALL_FILE} ;; \
+ esac; \
done; \
cd ${PKG_DB_TMPDIR} && ${SETENV} ${INSTALL_SCRIPTS_ENV} \
${_PKG_DEBUG_SCRIPT} ${INSTALL_FILE} ${PKGNAME} \
diff --git a/mk/install/info-files b/mk/install/info-files
index 036438af4ab..4b2a50a121d 100644
--- a/mk/install/info-files
+++ b/mk/install/info-files
@@ -1,4 +1,4 @@
-# $NetBSD: info-files,v 1.3 2006/03/19 23:58:14 jlam Exp $
+# $NetBSD: info-files,v 1.4 2006/04/06 17:57:34 jlam Exp $
#
# Generate an +INFO_FILES script that handles info file registration for
# the package.
@@ -18,11 +18,12 @@ UNPACK,|UNPACK,+INFO_FILES)
# same directory as the info files).
#
# Lines starting with "# INFO: " are data read by this script that
-# name the info files that will be added or removed from the "dir"
-# index files.
+# name the info files and directory containing the "dir" index that will
+# that will be updated. If the directory is not specified, then the
+# "dir" index is assumed to be in the same directory as the info file.
#
-# # INFO: /usr/pkg/info/bar.info
-# # INFO: /usr/pkg/info/baz.info
+# # INFO: /usr/pkg/info/bar.info /usr/pkg/info
+# # INFO: /usr/pkg/info/baz.info /usr/pkg/info
#
# For each INFO entry, if the path is relative, that it is taken to be
# relative to ${PKG_PREFIX}.
@@ -48,7 +49,7 @@ exitcode=0
case $ACTION in
ADD)
${SED} -n "/^\# INFO: /{s/^\# INFO: //;p;}" ${SELF} | ${SORT} -u |
- { while read file; do
+ { while read file infodir; do
case $file in
"") continue ;;
[!/]*) file="${PKG_PREFIX}/$file" ;;
@@ -63,7 +64,7 @@ ADD)
;;
esac
- infodir="${file%/*}"
+ ${TEST} -n "$infodir" || infodir="${file%/*}"
infoindex="$infodir/dir"
nentries="`${GREP} -c '^\*' $infoindex 2>/dev/null`"
case "$nentries" in
@@ -82,7 +83,7 @@ ADD)
REMOVE)
${SED} -n "/^\# INFO: /{s/^\# INFO: //;p;}" ${SELF} | ${SORT} -u |
- { while read file; do
+ { while read file infodir; do
case $file in
"") continue ;;
[!/]*) file="${PKG_PREFIX}/$file" ;;
@@ -97,7 +98,7 @@ REMOVE)
;;
esac
- infodir="${file%/*}"
+ ${TEST} -n "$infodir" || infodir="${file%/*}"
infoindex="$infodir/dir"
${ECHO} " $file"
${INSTALL_INFO} --info-dir="$infodir" --delete $file >/dev/null 2>&1