head	1.5;
access;
symbols
	pkgsrc-2026Q1:1.5.0.24
	pkgsrc-2026Q1-base:1.5
	pkgsrc-2025Q4:1.5.0.22
	pkgsrc-2025Q4-base:1.5
	pkgsrc-2025Q3:1.5.0.20
	pkgsrc-2025Q3-base:1.5
	pkgsrc-2025Q2:1.5.0.18
	pkgsrc-2025Q2-base:1.5
	pkgsrc-2025Q1:1.5.0.16
	pkgsrc-2025Q1-base:1.5
	pkgsrc-2024Q4:1.5.0.14
	pkgsrc-2024Q4-base:1.5
	pkgsrc-2024Q3:1.5.0.12
	pkgsrc-2024Q3-base:1.5
	pkgsrc-2024Q2:1.5.0.10
	pkgsrc-2024Q2-base:1.5
	pkgsrc-2024Q1:1.5.0.8
	pkgsrc-2024Q1-base:1.5
	pkgsrc-2023Q4:1.5.0.6
	pkgsrc-2023Q4-base:1.5
	pkgsrc-2023Q3:1.5.0.4
	pkgsrc-2023Q3-base:1.5
	pkgsrc-2023Q2:1.5.0.2
	pkgsrc-2023Q2-base:1.5
	pkgsrc-2023Q1:1.4.0.130
	pkgsrc-2023Q1-base:1.4
	pkgsrc-2022Q4:1.4.0.128
	pkgsrc-2022Q4-base:1.4
	pkgsrc-2022Q3:1.4.0.126
	pkgsrc-2022Q3-base:1.4
	pkgsrc-2022Q2:1.4.0.124
	pkgsrc-2022Q2-base:1.4
	pkgsrc-2022Q1:1.4.0.122
	pkgsrc-2022Q1-base:1.4
	pkgsrc-2021Q4:1.4.0.120
	pkgsrc-2021Q4-base:1.4
	pkgsrc-2021Q3:1.4.0.118
	pkgsrc-2021Q3-base:1.4
	pkgsrc-2021Q2:1.4.0.116
	pkgsrc-2021Q2-base:1.4
	pkgsrc-2021Q1:1.4.0.114
	pkgsrc-2021Q1-base:1.4
	pkgsrc-2020Q4:1.4.0.112
	pkgsrc-2020Q4-base:1.4
	pkgsrc-2020Q3:1.4.0.110
	pkgsrc-2020Q3-base:1.4
	pkgsrc-2020Q2:1.4.0.106
	pkgsrc-2020Q2-base:1.4
	pkgsrc-2020Q1:1.4.0.86
	pkgsrc-2020Q1-base:1.4
	pkgsrc-2019Q4:1.4.0.108
	pkgsrc-2019Q4-base:1.4
	pkgsrc-2019Q3:1.4.0.104
	pkgsrc-2019Q3-base:1.4
	pkgsrc-2019Q2:1.4.0.102
	pkgsrc-2019Q2-base:1.4
	pkgsrc-2019Q1:1.4.0.100
	pkgsrc-2019Q1-base:1.4
	pkgsrc-2018Q4:1.4.0.98
	pkgsrc-2018Q4-base:1.4
	pkgsrc-2018Q3:1.4.0.96
	pkgsrc-2018Q3-base:1.4
	pkgsrc-2018Q2:1.4.0.94
	pkgsrc-2018Q2-base:1.4
	pkgsrc-2018Q1:1.4.0.92
	pkgsrc-2018Q1-base:1.4
	pkgsrc-2017Q4:1.4.0.90
	pkgsrc-2017Q4-base:1.4
	pkgsrc-2017Q3:1.4.0.88
	pkgsrc-2017Q3-base:1.4
	pkgsrc-2017Q2:1.4.0.84
	pkgsrc-2017Q2-base:1.4
	pkgsrc-2017Q1:1.4.0.82
	pkgsrc-2017Q1-base:1.4
	pkgsrc-2016Q4:1.4.0.80
	pkgsrc-2016Q4-base:1.4
	pkgsrc-2016Q3:1.4.0.78
	pkgsrc-2016Q3-base:1.4
	pkgsrc-2016Q2:1.4.0.76
	pkgsrc-2016Q2-base:1.4
	pkgsrc-2016Q1:1.4.0.74
	pkgsrc-2016Q1-base:1.4
	pkgsrc-2015Q4:1.4.0.72
	pkgsrc-2015Q4-base:1.4
	pkgsrc-2015Q3:1.4.0.70
	pkgsrc-2015Q3-base:1.4
	pkgsrc-2015Q2:1.4.0.68
	pkgsrc-2015Q2-base:1.4
	pkgsrc-2015Q1:1.4.0.66
	pkgsrc-2015Q1-base:1.4
	pkgsrc-2014Q4:1.4.0.64
	pkgsrc-2014Q4-base:1.4
	pkgsrc-2014Q3:1.4.0.62
	pkgsrc-2014Q3-base:1.4
	pkgsrc-2014Q2:1.4.0.60
	pkgsrc-2014Q2-base:1.4
	pkgsrc-2014Q1:1.4.0.58
	pkgsrc-2014Q1-base:1.4
	pkgsrc-2013Q4:1.4.0.56
	pkgsrc-2013Q4-base:1.4
	pkgsrc-2013Q3:1.4.0.54
	pkgsrc-2013Q3-base:1.4
	pkgsrc-2013Q2:1.4.0.52
	pkgsrc-2013Q2-base:1.4
	pkgsrc-2013Q1:1.4.0.50
	pkgsrc-2013Q1-base:1.4
	pkgsrc-2012Q4:1.4.0.48
	pkgsrc-2012Q4-base:1.4
	pkgsrc-2012Q3:1.4.0.46
	pkgsrc-2012Q3-base:1.4
	pkgsrc-2012Q2:1.4.0.44
	pkgsrc-2012Q2-base:1.4
	pkgsrc-2012Q1:1.4.0.42
	pkgsrc-2012Q1-base:1.4
	pkgsrc-2011Q4:1.4.0.40
	pkgsrc-2011Q4-base:1.4
	pkgsrc-2011Q3:1.4.0.38
	pkgsrc-2011Q3-base:1.4
	pkgsrc-2011Q2:1.4.0.36
	pkgsrc-2011Q2-base:1.4
	pkgsrc-2011Q1:1.4.0.34
	pkgsrc-2011Q1-base:1.4
	pkgsrc-2010Q4:1.4.0.32
	pkgsrc-2010Q4-base:1.4
	pkgsrc-2010Q3:1.4.0.30
	pkgsrc-2010Q3-base:1.4
	pkgsrc-2010Q2:1.4.0.28
	pkgsrc-2010Q2-base:1.4
	pkgsrc-2010Q1:1.4.0.26
	pkgsrc-2010Q1-base:1.4
	pkgsrc-2009Q4:1.4.0.24
	pkgsrc-2009Q4-base:1.4
	pkgsrc-2009Q3:1.4.0.22
	pkgsrc-2009Q3-base:1.4
	pkgsrc-2009Q2:1.4.0.20
	pkgsrc-2009Q2-base:1.4
	pkgsrc-2009Q1:1.4.0.18
	pkgsrc-2009Q1-base:1.4
	pkgsrc-2008Q4:1.4.0.16
	pkgsrc-2008Q4-base:1.4
	pkgsrc-2008Q3:1.4.0.14
	pkgsrc-2008Q3-base:1.4
	cube-native-xorg:1.4.0.12
	cube-native-xorg-base:1.4
	pkgsrc-2008Q2:1.4.0.10
	pkgsrc-2008Q2-base:1.4
	cwrapper:1.4.0.8
	pkgsrc-2008Q1:1.4.0.6
	pkgsrc-2008Q1-base:1.4
	pkgsrc-2007Q4:1.4.0.4
	pkgsrc-2007Q4-base:1.4
	pkgsrc-2007Q3:1.4.0.2
	pkgsrc-2007Q3-base:1.4
	pkgsrc-2007Q2:1.3.0.8
	pkgsrc-2007Q2-base:1.3
	pkgsrc-2007Q1:1.3.0.6
	pkgsrc-2007Q1-base:1.3
	jlam-pkgviews:1.3.0.4
	jlam-pkgviews-base:1.3
	pkgsrc-2006Q4:1.3.0.2
	pkgsrc-2006Q4-base:1.3
	pkgsrc-2006Q3:1.2.0.2
	pkgsrc-2006Q3-base:1.2
	pkgsrc-2006Q2:1.1.0.2
	pkgsrc-2006Q2-base:1.1;
locks; strict;
comment	@# @;


1.5
date	2023.04.26.10.24.50;	author wiz;	state Exp;
branches;
next	1.4;
commitid	xINpIcyTaw6pwBmE;

1.4
date	2007.07.12.19.41.46;	author jlam;	state Exp;
branches;
next	1.3;

1.3
date	2006.12.29.07.06.31;	author obache;	state Exp;
branches;
next	1.2;

1.2
date	2006.07.19.22.26.26;	author jlam;	state Exp;
branches;
next	1.1;

1.1
date	2006.05.21.23.50.15;	author jlam;	state Exp;
branches;
next	;


desc
@@


1.5
log
@mk: retire INFO_FILES_VERBOSE

registering info files hasn't caused any errors, and this
clutters PKG_DEVELOPER=yes install outputs
@
text
@# $NetBSD: info-files,v 1.4 2007/07/12 19:41:46 jlam Exp $
#
# Generate an +INFO_FILES script that handles info file registration for
# the package.
#
case "${STAGE},$1" in
UNPACK,|UNPACK,+INFO_FILES)
	${CAT} > ./+INFO_FILES << 'EOF'
#!@@SH@@
#
# +INFO_FILES - info file registration management script
#
# Usage: ./+INFO_FILES ADD|REMOVE [metadatadir]
#
# This script supports two actions, ADD and REMOVE, that will add or
# remove entries for info files from the package associated with
# <metadatadir> from the info index files (the "dir" file in the
# same directory as the info files).
#
# Lines starting with "# INFO: " are data read by this script that
# 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 /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}.
#

GREP="@@GREP@@"
INSTALL_INFO="@@INSTALL_INFO@@"
MKDIR="@@MKDIR@@"
PWD_CMD="@@PWD_CMD@@"
RM="@@RM@@"
RMDIR="@@RMDIR@@"
SED="@@SED@@"
SORT="@@SORT@@"
TEST="@@TEST@@"

SELF=$0
ACTION=$1

CURDIR=`${PWD_CMD}`
PKG_METADATA_DIR="${2-${CURDIR}}"
: ${PKGNAME=${PKG_METADATA_DIR##*/}}
: ${PKG_PREFIX=@@PREFIX@@}

exitcode=0
case $ACTION in
ADD)
	${SED} -n "/^\# INFO: /{s/^\# INFO: //;p;}" ${SELF} | ${SORT} -u |
	while read file infodir; do
		case $file in
		"")	continue ;;
		[!/]*)	file="${PKG_PREFIX}/$file" ;;
		esac

		if ${TEST} ! -f "$file"; then
			:
		else
			case $infodir in
			"")	infodir="${file%/*}" ;;
			[!/]*)	infodir="${PKG_PREFIX}/$infodir" ;;
			esac
			infoindex="$infodir/dir"
			nentries="`${GREP} -c '^\*' $infoindex 2>/dev/null`"
			case "$nentries" in
			[0-9]*)	${TEST} $nentries -gt 0 || ${RM} $infoindex ;;
			esac
			${MKDIR} -p "$infodir"
			${INSTALL_INFO} --info-dir="$infodir" --delete $file >/dev/null 2>&1
			${INSTALL_INFO} --info-dir="$infodir" $file >/dev/null 2>&1
		fi
	done
	;;

REMOVE)
	${SED} -n "/^\# INFO: /{s/^\# INFO: //;p;}" ${SELF} | ${SORT} -u |
	while read file infodir; do
		case $file in
		"")	continue ;;
		[!/]*)	file="${PKG_PREFIX}/$file" ;;
		esac

		if ${TEST} ! -f "$file"; then
			:
		else
			case $infodir in
			"")	infodir="${file%/*}" ;;
			[!/]*)	infodir="${PKG_PREFIX}/$infodir" ;;
			esac
			infoindex="$infodir/dir"
			${INSTALL_INFO} --info-dir="$infodir" --delete $file >/dev/null 2>&1
			nentries="`${GREP} -c '^\*' $infoindex 2>/dev/null`"
			case "$nentries" in
			[0-9]*)	${TEST} $nentries -gt 1 || ${RM} $infoindex ;;
			esac
			${RMDIR} -p "$infodir" 2>/dev/null || ${TRUE}
		fi
	done
	;;
esac
exit $exitcode

EOF
	${SED} -n "/^\# INFO: /p" ${SELF} >> ./+INFO_FILES
	${CHMOD} +x ./+INFO_FILES
	;;
esac

@


1.4
log
@* Add a user-settable variable to tune the default verbosity of the
  +INSTALL and +DEINSTALL scripts:

  PKGINSTALL_VERBOSE
	A list of scriptlets that will be verbose and output a message
	noting the actions taken.

	* "all" is a special value that implies all of the other items
	* "fonts" for +FONTS
	* "info-files" for +INFO_FILES

	Default value: "all" for PKG_DEVELOPERs, empty otherwise.

* Be "one-liner brief" when doing the default actions.  For example,
  the info files output now looks like:

	gmake-3.81: registering info file /usr/pkg/info/make.info

  We retain the current verbosity for the CHECK-* actions.
@
text
@d1 1
a1 1
# $NetBSD: info-files,v 1.3 2006/12/29 07:06:31 obache Exp $
a31 1
ECHO="@@ECHO@@"
a49 9
case "${INFO_FILES_VERBOSE:-@@INFO_FILES_VERBOSE@@}" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
	echo="${ECHO}"
	;;
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
	echo=":"
	;;
esac

a71 1
			$echo "${PKGNAME}: registering info file $file"
a94 1
			$echo "${PKGNAME}: unregistering info file $file"
@


1.3
log
@Relative $infodir is allowed, so if it's relative, add ${PREFIX}.
@
text
@d1 1
a1 1
# $NetBSD: info-files,v 1.2 2006/07/19 22:26:26 jlam Exp $
d51 9
d64 1
a64 1
	{ while read file infodir; do
a72 9
			case "$printed_header" in
			yes)	;;
			*)	printed_header=yes
				${ECHO} "==========================================================================="
				${ECHO} "Registering info files for ${PKGNAME}:"
				${ECHO} ""
				;;
			esac

d82 1
a82 1
			${ECHO} "	$file"
a87 5
	case "$printed_header" in
	yes)	${ECHO} ""
		${ECHO} "==========================================================================="
		;;
	esac; }
d92 1
a92 1
	{ while read file infodir; do
a100 9
			case "$printed_header" in
			yes)	;;
			*)	printed_header=yes
				${ECHO} "==========================================================================="
				${ECHO} "Unregistering info files for ${PKGNAME}:"
				${ECHO} ""
				;;
			esac

d106 1
a106 1
			${ECHO} "	$file"
a114 5
	case "$printed_header" in
	yes)	${ECHO} ""
		${ECHO} "==========================================================================="
		;;
	esac; }
@


1.2
log
@Be more conservative and avoid possible shell implementation differences
by not using `...` inside ${...#...}.
@
text
@d1 1
a1 1
# $NetBSD: info-files,v 1.1 2006/05/21 23:50:15 jlam Exp $
d73 4
a76 1
			${TEST} -n "$infodir" || infodir="${file%/*}"
d115 4
a118 1
			${TEST} -n "$infodir" || infodir="${file%/*}"
@


1.1
log
@Move mk/install to mk/pkginstall to better reflect the contents (the
pkginstall framework).
@
text
@d1 1
a1 1
# $NetBSD: info-files,v 1.5 2006/04/12 21:13:56 jlam Exp $
d46 2
a47 1
PKG_METADATA_DIR="${2-`${PWD_CMD}`}"
@

