pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/pkgtools/pkgtasks
Module Name: pkgsrc
Committed By: jlam
Date: Sat Aug 19 00:30:07 UTC 2017
Modified Files:
pkgsrc/pkgtools/pkgtasks: Makefile
pkgsrc/pkgtools/pkgtasks/files: Makefile.in NEWS.md README.md
aclocal.m4 configure configure.ac postinstall.subr postremove.subr
preinstall.subr preremove.subr
pkgsrc/pkgtools/pkgtasks/files/build-aux: install-sh missing
pkgsrc/pkgtools/pkgtasks/files/t: t_postinstall.sh t_postremove.sh
t_preinstall.sh t_preremove.sh
Log Message:
Update pkgtools/pkgtasks to 1.14.
Use TASK_VERBOSE environment variable to select which tasks should
emit output when invoked.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/pkgtasks/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/pkgtools/pkgtasks/files/Makefile.in \
pkgsrc/pkgtools/pkgtasks/files/README.md \
pkgsrc/pkgtools/pkgtasks/files/configure \
pkgsrc/pkgtools/pkgtasks/files/configure.ac
cvs rdiff -u -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/NEWS.md \
pkgsrc/pkgtools/pkgtasks/files/aclocal.m4 \
pkgsrc/pkgtools/pkgtasks/files/preinstall.subr
cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/postinstall.subr \
pkgsrc/pkgtools/pkgtasks/files/postremove.subr \
pkgsrc/pkgtools/pkgtasks/files/preremove.subr
cvs rdiff -u -r1.3 -r1.4 pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh
cvs rdiff -u -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/build-aux/missing
cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh \
pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh \
pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh
cvs rdiff -u -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_preinstall.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/pkgtools/pkgtasks/Makefile
diff -u pkgsrc/pkgtools/pkgtasks/Makefile:1.5 pkgsrc/pkgtools/pkgtasks/Makefile:1.6
--- pkgsrc/pkgtools/pkgtasks/Makefile:1.5 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/Makefile Sat Aug 19 00:30:07 2017
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.5 2017/08/10 05:38:30 jlam Exp $
+# $NetBSD: Makefile,v 1.6 2017/08/19 00:30:07 jlam Exp $
-DISTNAME= pkgtasks-1-1.13
+DISTNAME= pkgtasks-1-1.14
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
Index: pkgsrc/pkgtools/pkgtasks/files/Makefile.in
diff -u pkgsrc/pkgtools/pkgtasks/files/Makefile.in:1.3 pkgsrc/pkgtools/pkgtasks/files/Makefile.in:1.4
--- pkgsrc/pkgtools/pkgtasks/files/Makefile.in:1.3 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/Makefile.in Sat Aug 19 00:30:07 2017
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -574,7 +574,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
@@ -600,7 +600,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
@@ -618,7 +618,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -628,7 +628,7 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
Index: pkgsrc/pkgtools/pkgtasks/files/README.md
diff -u pkgsrc/pkgtools/pkgtasks/files/README.md:1.3 pkgsrc/pkgtools/pkgtasks/files/README.md:1.4
--- pkgsrc/pkgtools/pkgtasks/files/README.md:1.3 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/README.md Sat Aug 19 00:30:07 2017
@@ -26,7 +26,7 @@ same entry more than once.
Getting sources
---------------
-The latest version of *pkgtasks* is 1.13 and was released on August 8th, 2017.
+The latest version of *pkgtasks* is 1.14 and was released on August 14th, 2017.
See the [release notes](NEWS.md) for information about the changes in this
and all previous releases.
Index: pkgsrc/pkgtools/pkgtasks/files/configure
diff -u pkgsrc/pkgtools/pkgtasks/files/configure:1.3 pkgsrc/pkgtools/pkgtasks/files/configure:1.4
--- pkgsrc/pkgtools/pkgtasks/files/configure:1.3 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/configure Sat Aug 19 00:30:07 2017
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for pkgtasks-1 1.13.
+# Generated by GNU Autoconf 2.69 for pkgtasks-1 1.14.
#
# Report bugs to <jlam%NetBSD.org@localhost>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='pkgtasks-1'
PACKAGE_TARNAME='pkgtasks-1'
-PACKAGE_VERSION='1.13'
-PACKAGE_STRING='pkgtasks-1 1.13'
+PACKAGE_VERSION='1.14'
+PACKAGE_STRING='pkgtasks-1 1.14'
PACKAGE_BUGREPORT='jlam%NetBSD.org@localhost'
PACKAGE_URL=''
@@ -1209,7 +1209,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures pkgtasks-1 1.13 to adapt to many kinds of systems.
+\`configure' configures pkgtasks-1 1.14 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1275,7 +1275,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pkgtasks-1 1.13:";;
+ short | recursive ) echo "Configuration of pkgtasks-1 1.14:";;
esac
cat <<\_ACEOF
@@ -1355,7 +1355,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pkgtasks-1 configure 1.13
+pkgtasks-1 configure 1.14
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1372,7 +1372,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pkgtasks-1 $as_me 1.13, which was
+It was created by pkgtasks-1 $as_me 1.14, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2242,7 +2242,7 @@ fi
# Define the identity of the package.
PACKAGE='pkgtasks-1'
- VERSION='1.13'
+ VERSION='1.14'
cat >>confdefs.h <<_ACEOF
@@ -3078,7 +3078,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by pkgtasks-1 $as_me 1.13, which was
+This file was extended by pkgtasks-1 $as_me 1.14, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3131,7 +3131,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-pkgtasks-1 config.status 1.13
+pkgtasks-1 config.status 1.14
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Index: pkgsrc/pkgtools/pkgtasks/files/configure.ac
diff -u pkgsrc/pkgtools/pkgtasks/files/configure.ac:1.3 pkgsrc/pkgtools/pkgtasks/files/configure.ac:1.4
--- pkgsrc/pkgtools/pkgtasks/files/configure.ac:1.3 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/configure.ac Sat Aug 19 00:30:07 2017
@@ -26,7 +26,7 @@ dnl ARISING IN ANY WAY OUT OF THE USE OF
dnl POSSIBILITY OF SUCH DAMAGE.
dnl
-AC_INIT([pkgtasks-1], [1.13], [jlam%NetBSD.org@localhost])
+AC_INIT([pkgtasks-1], [1.14], [jlam%NetBSD.org@localhost])
AC_CONFIG_AUX_DIR([build-aux])
Index: pkgsrc/pkgtools/pkgtasks/files/NEWS.md
diff -u pkgsrc/pkgtools/pkgtasks/files/NEWS.md:1.1 pkgsrc/pkgtools/pkgtasks/files/NEWS.md:1.2
--- pkgsrc/pkgtools/pkgtasks/files/NEWS.md:1.1 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/NEWS.md Sat Aug 19 00:30:07 2017
@@ -2,6 +2,14 @@ Package Tasks
=============
+Changes in version 1.14
+-----------------------
+**Released on 2017-08-14.**
+
+* Use `TASK_VERBOSE` environment variable to select which tasks
+ should emit output when invoked.
+
+
Changes in version 1.13
-----------------------
**Released on 2017-08-08.**
Index: pkgsrc/pkgtools/pkgtasks/files/aclocal.m4
diff -u pkgsrc/pkgtools/pkgtasks/files/aclocal.m4:1.1 pkgsrc/pkgtools/pkgtasks/files/aclocal.m4:1.2
--- pkgsrc/pkgtools/pkgtasks/files/aclocal.m4:1.1 Thu Jun 1 01:58:34 2017
+++ pkgsrc/pkgtools/pkgtasks/files/aclocal.m4 Sat Aug 19 00:30:07 2017
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. I
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -143,7 +143,7 @@ fi])])
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -340,7 +340,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -361,7 +361,7 @@ if test x"${install_sh+set}" != xset; th
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -382,7 +382,7 @@ AC_SUBST([am__leading_dot])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -421,7 +421,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -452,7 +452,7 @@ AC_DEFUN([_AM_IF_OPTION],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -533,7 +533,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -593,7 +593,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -621,7 +621,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -640,7 +640,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Index: pkgsrc/pkgtools/pkgtasks/files/preinstall.subr
diff -u pkgsrc/pkgtools/pkgtasks/files/preinstall.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/preinstall.subr:1.2
--- pkgsrc/pkgtools/pkgtasks/files/preinstall.subr:1.1 Thu Jun 1 01:58:34 2017
+++ pkgsrc/pkgtools/pkgtasks/files/preinstall.subr Sat Aug 19 00:30:07 2017
@@ -48,6 +48,16 @@
# RETURN VALUES
# Returns 0 on success, and >0 if an error occurs.
#
+# ENVIRONMENT
+# The following variables are used if they are set:
+#
+# TASK_VERBOSE
+# List of package tasks that should emit verbose output.
+# If ${TASK_VERBOSE} is "all", then all tasks are verbose.
+# If ${TASK_VERBOSE} is "none", then no tasks are verbose.
+# Otherwise, if one of the tasks is "default", then the
+# default list of tasks are verbose.
+#
__task_preinstall__="yes"
@@ -59,6 +69,8 @@ task_load users
task_preinstall()
{
+ : ${TASK_VERBOSE:=default}
+
[ $# -gt 0 ] || return 127
local datafile="$1"; shift
@@ -66,10 +78,28 @@ task_preinstall()
local stage="preinstall"
+ # $verbose are the package tasks that give verbose output.
+ # Expand "all", "default" and "none" to a fixed list of tasks.
+ #
+ local verbose="${TASK_VERBOSE}"
+ case " $verbose " in
+ " all "|*" default "*)
+ verbose="directories function groups users" ;;
+ " none ")
+ verbose= ;;
+ esac
+
+ local silent
+
# Require necessary groups and users before actions that may
# set permissions.
#
- task_groups add $stage < $datafile
+ case " $verbose " in
+ *" groups "*)
+ silent= ;;
+ *) silent="-s" ;;
+ esac
+ task_groups $silent add $stage < $datafile
if task_groups check-add $stage < $datafile; then
: "groups exist"
else
@@ -77,7 +107,12 @@ task_preinstall()
return 1
fi
- task_users add $stage < $datafile
+ case " $verbose " in
+ *" users "*)
+ silent= ;;
+ *) silent="-s" ;;
+ esac
+ task_users $silent add $stage < $datafile
if task_users check-add $stage < $datafile; then
: "users exist"
else
@@ -90,10 +125,20 @@ task_preinstall()
# create path components in order. Any errors in creating
# directories are non-fatal.
#
- task_sort < $datafile | task_directories add $stage
+ case " $verbose " in
+ *" directories "*)
+ silent= ;;
+ *) silent="-s" ;;
+ esac
+ task_sort < $datafile | task_directories $silent add $stage
# Run the generic package tasks.
- if task_function add $stage < $datafile; then
+ case " $verbose " in
+ *" function "*)
+ silent= ;;
+ *) silent="-s" ;;
+ esac
+ if task_function $silent add $stage < $datafile; then
: "success"
else
# Fatal error: failures in generic package tasks.
Index: pkgsrc/pkgtools/pkgtasks/files/postinstall.subr
diff -u pkgsrc/pkgtools/pkgtasks/files/postinstall.subr:1.2 pkgsrc/pkgtools/pkgtasks/files/postinstall.subr:1.3
--- pkgsrc/pkgtools/pkgtasks/files/postinstall.subr:1.2 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/postinstall.subr Sat Aug 19 00:30:07 2017
@@ -54,6 +54,16 @@
# RETURN VALUES
# Returns 0 on success, and >0 if an error occurs.
#
+# ENVIRONMENT
+# The following variables are used if they are set:
+#
+# TASK_VERBOSE
+# List of package tasks that should emit verbose output.
+# If ${TASK_VERBOSE} is "all", then all tasks are verbose.
+# If ${TASK_VERBOSE} is "none", then no tasks are verbose.
+# Otherwise, if one of the tasks is "default", then the
+# default list of tasks are verbose.
+#
__task_postinstall__="yes"
@@ -71,59 +81,76 @@ task_load taskfunc
task_postinstall()
{
+ : ${TASK_VERBOSE:=default}
+
[ $# -gt 0 ] || return 127
local datafile="$1"; shift
[ -f "$datafile" ] || return 1
- local post_actions=
+ local post_tasks=
# Copy configuration/support files into place.
- post_actions="task_files"
+ post_tasks="files"
# Set special permissions on files and directories that need them.
- post_actions="$post_actions task_permissions"
+ post_tasks="$post_tasks permissions"
# Rebuild the system run-time library search path database.
- post_actions="$post_actions task_shlibs"
+ post_tasks="$post_tasks shlibs"
# Update font databases.
- post_actions="$post_actions task_fonts"
+ post_tasks="$post_tasks fonts"
# Update GTK+ icon theme caches.
- post_actions="$post_actions task_icon_themes"
+ post_tasks="$post_tasks icon_themes"
# Register shells.
- post_actions="$post_actions task_shells"
+ post_tasks="$post_tasks shells"
# Register GNU info files.
- post_actions="$post_actions task_info_files"
+ post_tasks="$post_tasks info_files"
# Update OCaml module run-time library search path database.
- post_actions="$post_actions task_ocaml_findlib"
+ post_tasks="$post_tasks ocaml_findlib"
# Run generic package tasks.
- post_actions="$post_actions task_function"
+ post_tasks="$post_tasks function"
# Seed checks with actions from preinstall, in order.
- local post_checks="task_directories"
+ local post_checks="directories"
local result=0
local stage="postinstall"
- local post_fn silent
- for post_fn in $post_actions; do
- case $post_fn in
- task_files|\
- task_permissions|\
- task_shells)
- # These tasks should be verbose since they touch
- # system files and directories.
+ # $verbose are the package tasks that give verbose output.
+ # Expand "all", "default" and "none" to a fixed list of tasks.
+ #
+ local verbose="${TASK_VERBOSE}"
+ case " $verbose " in
+ " all ")
+ verbose="files fonts function icon_themes info_files"
+ verbose="$verbose ocaml_findlib permissions shells shlibs" ;;
+ *" default "*)
+ # These tasks are verbose by default since they touch
+ # system files and directories.
+ #
+ verbose="$verbose files permissions shells" ;;
+ " none ")
+ verbose= ;;
+ esac
+
+ local task post_fn silent
+ for task in $post_tasks; do
+ post_fn="task_$task"
+ case " $verbose " in
+ *" $task "*)
silent= ;;
*) silent="-s" ;;
esac
$post_fn $silent add $stage < $datafile || result=1
- post_checks="$post_checks $post_fn"
+ post_checks="$post_checks $task"
done
# Run all checks after all post-installation actions have completed
# and write messages to standard output for any checks that don't
# pass.
#
- for post_fn in $post_checks; do
- case $post_fn in
- task_directories)
+ for check in $post_checks; do
+ post_fn="task_$check"
+ case $check in
+ directories)
# Sort data lines for this task.
task_sort < $datafile | $post_fn check-add $stage ;;
*) $post_fn check-add $stage < $datafile ;;
Index: pkgsrc/pkgtools/pkgtasks/files/postremove.subr
diff -u pkgsrc/pkgtools/pkgtasks/files/postremove.subr:1.2 pkgsrc/pkgtools/pkgtasks/files/postremove.subr:1.3
--- pkgsrc/pkgtools/pkgtasks/files/postremove.subr:1.2 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/postremove.subr Sat Aug 19 00:30:07 2017
@@ -53,6 +53,16 @@
# RETURN VALUES
# Returns 0 on success, and >0 if an error occurs.
#
+# ENVIRONMENT
+# The following variables are used if they are set:
+#
+# TASK_VERBOSE
+# List of package tasks that should emit verbose output.
+# If ${TASK_VERBOSE} is "all", then all tasks are verbose.
+# If ${TASK_VERBOSE} is "none", then no tasks are verbose.
+# Otherwise, if one of the tasks is "default", then the
+# default list of tasks are verbose.
+#
__task_postremove__="yes"
@@ -71,74 +81,90 @@ task_load users
task_postremove()
{
+ : ${TASK_VERBOSE:=default}
+
[ $# -gt 0 ] || return 127
local datafile="$1"; shift
[ -f "$datafile" ] || return 1
- local post_actions=
+ local post_tasks=
# Remove shells from the system shells database.
- post_actions="task_shells"
+ post_tasks="shells"
# Update font databases.
- post_actions="$post_actions task_fonts"
+ post_tasks="$post_tasks fonts"
# Update GTK+ icon theme caches
- post_actions="$post_actions task_icon_themes"
+ post_tasks="$post_tasks icon_themes"
# Rebuild the system run-time library search path database.
- post_actions="$post_actions task_shlibs"
+ post_tasks="$post_tasks shlibs"
# Update OCaml module run-time library search path database.
- post_actions="$post_actions task_ocaml_findlib"
+ post_tasks="$post_tasks ocaml_findlib"
# Remove empty directories.
- post_actions="$post_actions task_directories"
+ post_tasks="$post_tasks directories"
# Remove unused users.
- post_actions="$post_actions task_users"
+ post_tasks="$post_tasks users"
# Remove unused groups.
- post_actions="$post_actions task_groups"
+ post_tasks="$post_tasks groups"
# Run generic package tasks.
- post_actions="$post_actions task_function"
+ post_tasks="$post_tasks function"
# Seed checks with actions from preremove, in order.
- local post_checks="task_info_files task_files"
+ local post_checks="info_files files"
local result=0
local stage="postremove"
- local post_fn silent action_result
- for post_fn in $post_actions; do
- case $post_fn in
- task_directories|\
- task_groups|\
- task_shells|\
- task_users)
- # These tasks should be verbose since they touch
- # system files and directories.
+ # $verbose are the package tasks that give verbose output.
+ # Expand "all", "default" and "none" to a fixed list of tasks.
+ #
+ local verbose="${TASK_VERBOSE}"
+ case " $verbose " in
+ " all ")
+ verbose="directories fonts function groups icon_themes"
+ verbose="$verbose ocaml_findlib shells shlibs users" ;;
+ *" default "*)
+ # These tasks are verbose by default since they touch
+ # system files and directories.
+ #
+ verbose="$verbose directories groups shells users" ;;
+ " none ")
+ verbose= ;;
+ esac
+
+ local task post_fn silent action_result
+ for task in $post_tasks; do
+ post_fn="task_$task"
+ case " $verbose " in
+ *" $task "*)
silent= ;;
*) silent="-s" ;;
esac
- case $post_fn in
- task_directories)
+ case $task in
+ directories)
# Reverse-sort data lines for this task.
task_sort -r < $datafile | $post_fn $silent remove $stage ;;
*) $post_fn $silent remove $stage < $datafile ;;
esac
action_result="$?"
- case $post_fn in
- task_icon_themes)
+ case $task in
+ icon_themes)
# Any errors in updating icon caches during postremove
# are non-fatal, so adjust the action result.
#
action_result=0 ;;
esac
[ $action_result -eq 0 ] || result=1
- post_checks="$post_checks $post_fn"
+ post_checks="$post_checks $task"
done
# Run all checks after all post-removal actions have completed
# and write messages to standard output for any checks that don't
# pass.
#
- for post_fn in $post_checks; do
- case $post_fn in
- task_directories)
+ for check in $post_checks; do
+ post_fn="task_$check"
+ case $check in
+ directories)
# Reverse-sort data lines for this task.
task_sort -r < $datafile | $post_fn check-remove $stage ;;
*) $post_fn check-remove $stage < $datafile ;;
Index: pkgsrc/pkgtools/pkgtasks/files/preremove.subr
diff -u pkgsrc/pkgtools/pkgtasks/files/preremove.subr:1.2 pkgsrc/pkgtools/pkgtasks/files/preremove.subr:1.3
--- pkgsrc/pkgtools/pkgtasks/files/preremove.subr:1.2 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/preremove.subr Sat Aug 19 00:30:07 2017
@@ -48,6 +48,16 @@
# RETURN VALUES
# Returns 0 on success, and >0 if an error occurs.
#
+# ENVIRONMENT
+# The following variables are used if they are set:
+#
+# TASK_VERBOSE
+# List of package tasks that should emit verbose output.
+# If ${TASK_VERBOSE} is "all", then all tasks are verbose.
+# If ${TASK_VERBOSE} is "none", then no tasks are verbose.
+# Otherwise, if one of the tasks is "default", then the
+# default list of tasks are verbose.
+#
__task_preremove__="yes"
@@ -59,6 +69,8 @@ task_load taskfunc
task_preremove()
{
+ : ${TASK_VERBOSE:=default}
+
[ $# -gt 0 ] || return 127
local datafile="$1"; shift
@@ -66,29 +78,67 @@ task_preremove()
local stage="preremove"
+ # $verbose are the package tasks that give verbose output.
+ # Expand "all", "default" and "none" to a fixed list of tasks.
+ #
+ local verbose="${TASK_VERBOSE}"
+ case " $verbose " in
+ " all ")
+ verbose="files function icon_themes info_files" ;;
+ *" default "*)
+ # These tasks are verbose by default since they touch
+ # system files and directories.
+ #
+ verbose="files function" ;;
+ " none ")
+ verbose= ;;
+ esac
+
+ local silent
+
# Unregistering a GNU info files requires reading the file to find
# all nodes listed in the file, so it must be done before the file
# is removed. Any errors in unregistering GNU info files are
# non-fatal.
#
- task_info_files -s remove $stage < $datafile
+ case " $verbose " in
+ *" info_files "*)
+ silent= ;;
+ *) silent="-s" ;;
+ esac
+ task_info_files $silent remove $stage < $datafile
# GTK+ icon theme caches exist in the package installation
# directory, so they must be removed before their packages can be
# successfully removed. Any errors in removing icon caches are
# non-fatal.
#
- task_icon_themes -s remove $stage < $datafile
+ case " $verbose " in
+ *" icon_themes "*)
+ silent= ;;
+ *) silent="-s" ;;
+ esac
+ task_icon_themes $silent remove $stage < $datafile
# Removing a configuration file requires comparing it to the
# example file from which it was copied, so it must be done before
# the example file is removed. Any errors in removing
# configuration files are non-fatal.
#
- task_files remove $stage < $datafile
+ case " $verbose " in
+ *" files "*)
+ silent= ;;
+ *) silent="-s" ;;
+ esac
+ task_files $silent remove $stage < $datafile
# Run the generic package tasks.
- if task_sort -r < $datafile | task_function remove $stage; then
+ case " $verbose " in
+ *" function "*)
+ silent= ;;
+ *) silent="-s" ;;
+ esac
+ if task_sort -r < $datafile | task_function $silent remove $stage; then
: "success"
else
# Errors from the generic package tasks are fatal.
Index: pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh
diff -u pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh:1.3 pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh:1.4
--- pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh:1.3 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh Sat Aug 19 00:30:07 2017
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: install-sh,v 1.3 2017/08/10 05:38:30 jlam Exp $
+# $NetBSD: install-sh,v 1.4 2017/08/19 00:30:07 jlam Exp $
# This script now also installs multiple files, but might choke on installing
# multiple files with spaces in the file names.
#
Index: pkgsrc/pkgtools/pkgtasks/files/build-aux/missing
diff -u pkgsrc/pkgtools/pkgtasks/files/build-aux/missing:1.1 pkgsrc/pkgtools/pkgtasks/files/build-aux/missing:1.2
--- pkgsrc/pkgtools/pkgtasks/files/build-aux/missing:1.1 Thu Jun 1 01:58:34 2017
+++ pkgsrc/pkgtools/pkgtasks/files/build-aux/missing Sat Aug 19 00:30:07 2017
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2016-01-11.22; # UTC
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard%iro.umontreal.ca@localhost>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -210,6 +210,6 @@ exit $st
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
Index: pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh
diff -u pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh:1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh:1.3
--- pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh:1.2 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh Sat Aug 19 00:30:07 2017
@@ -47,54 +47,93 @@ test_setup()
}
# Mock actions that return the truthiness of environment variables.
+mock_pkgtask()
+{
+ # required parameters
+ local name="$1"; shift
+ local varname="$1"; shift
+
+ # pkgtask parameters
+ local arg
+ local silent=
+ local OPTIND=1
+ while getopts ":s" arg "$@"; do
+ case $arg in
+ s) silent="yes" ;;
+ *) return 127 ;;
+ esac
+ done
+ shift $(( ${OPTIND} - 1 ))
+ local action="$1"; shift
+ local stage="$1"; shift
+
+ local value symbol result
+ eval value="\${$varname}"
+ if [ "$value" = "yes" ]; then
+ symbol=">"
+ result=0
+ else
+ symbol="!"
+ result=1
+ fi
+
+ # Skip output if doing a "check" action.
+ case $action in
+ check-*)
+ : "do nothing" ;;
+ *) [ -n "$silent" ] || echo "$symbol $name" ;;
+ esac
+ return $result
+}
+
task_directories()
{
- [ "${TASK_DIRECTORIES_SUCCESS}" = "yes" ]
+ mock_pkgtask "directories" "TASK_DIRECTORIES_SUCCESS" "$@"
}
task_files()
{
- [ "${TASK_FILES_SUCCESS}" = "yes" ]
+ mock_pkgtask "files" "TASK_FILES_SUCCESS" "$@"
}
task_fonts()
{
- [ "${TASK_FONTS_SUCCESS}" = "yes" ]
+ mock_pkgtask "fonts" "TASK_FONTS_SUCCESS" "$@"
}
task_function()
{
- [ "${TASK_FUNCTION_SUCCESS}" = "yes" ]
+ mock_pkgtask "function" "TASK_FUNCTION_SUCCESS" "$@"
}
task_icon_themes()
{
- [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ]
+ mock_pkgtask "icon_themes" "TASK_ICON_THEMES_SUCCESS" "$@"
}
task_info_files()
{
- [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ]
+ mock_pkgtask "info_files" "TASK_INFO_FILES_SUCCESS" "$@"
}
task_ocaml_findlib()
{
- [ "${TASK_OCAML_FINDLIB_SUCCESS}" = "yes" ]
+ mock_pkgtask "ocaml_findlib" "TASK_OCAML_FINDLIB_SUCCESS" "$@"
}
task_permissions()
{
- [ "${TASK_PERMISSIONS_SUCCESS}" = "yes" ]
+ mock_pkgtask "permissions" "TASK_PERMISSIONS_SUCCESS" "$@"
}
task_shells()
{
- [ "${TASK_SHELLS_SUCCESS}" = "yes" ]
+ mock_pkgtask "shells" "TASK_SHELLS_SUCCESS" "$@"
}
task_shlibs()
{
- [ "${TASK_SHLIBS_SUCCESS}" = "yes" ]
+ mock_pkgtask "shlibs" "TASK_SHLIBS_SUCCESS" "$@"
}
# Only succeed if all of the actions were successful.
@@ -212,4 +251,42 @@ test11()
return 0
}
+test12()
+{
+ : ${CAT:=cat}
+
+ describe="\${TASK_VERBOSE} = none"
+ TASK_VERBOSE=none
+ task_postinstall "$datafile" > output
+ ${CAT} output
+ if [ -s "$output" ]; then
+ # no output expected
+ return 1
+ fi
+ return 0
+}
+
+test13()
+{
+ : ${CAT:=cat}
+ : ${GREP:=grep}
+
+ describe="\${TASK_VERBOSE} = all"
+ TASK_VERBOSE=all
+ task_postinstall "$datafile" > output
+ ${CAT} output
+ for task in \
+ files fonts function icon_themes info_files \
+ ocaml_findlib permissions shells shlibs
+ do
+ if ${GREP} -q "$task" output; then
+ : "success"
+ else
+ describe="$describe: '$task' missing!"
+ return 1
+ fi
+ done
+ return 0
+}
+
task_run_tests "$@"
Index: pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh
diff -u pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh:1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh:1.3
--- pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh:1.2 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh Sat Aug 19 00:30:07 2017
@@ -48,59 +48,98 @@ test_setup()
}
# Mock actions that return the truthiness of environment variables.
+mock_pkgtask()
+{
+ # required parameters
+ local name="$1"; shift
+ local varname="$1"; shift
+
+ # pkgtask parameters
+ local arg
+ local silent=
+ local OPTIND=1
+ while getopts ":s" arg "$@"; do
+ case $arg in
+ s) silent="yes" ;;
+ *) return 127 ;;
+ esac
+ done
+ shift $(( ${OPTIND} - 1 ))
+ local action="$1"; shift
+ local stage="$1"; shift
+
+ local value symbol result
+ eval value="\${$varname}"
+ if [ "$value" = "yes" ]; then
+ symbol=">"
+ result=0
+ else
+ symbol="!"
+ result=1
+ fi
+
+ # Skip output if doing a "check" action.
+ case $action in
+ check-*)
+ : "do nothing" ;;
+ *) [ -n "$silent" ] || echo "$symbol $name" ;;
+ esac
+ return $result
+}
+
task_directories()
{
- [ "${TASK_DIRECTORIES_SUCCESS}" = "yes" ]
+ mock_pkgtask "directories" "TASK_DIRECTORIES_SUCCESS" "$@"
}
task_files()
{
- [ "${TASK_FILES_SUCCESS}" = "yes" ]
+ mock_pkgtask "files" "TASK_FILES_SUCCESS" "$@"
}
task_fonts()
{
- [ "${TASK_FONTS_SUCCESS}" = "yes" ]
+ mock_pkgtask "fonts" "TASK_FONTS_SUCCESS" "$@"
}
task_function()
{
- [ "${TASK_FUNCTION_SUCCESS}" = "yes" ]
+ mock_pkgtask "function" "TASK_FUNCTION_SUCCESS" "$@"
}
task_groups()
{
- [ "${TASK_GROUPS_SUCCESS}" = "yes" ]
+ mock_pkgtask "groups" "TASK_GROUPS_SUCCESS" "$@"
}
task_icon_themes()
{
- [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ]
+ mock_pkgtask "icon_themes" "TASK_ICON_THEMES_SUCCESS" "$@"
}
task_info_files()
{
- [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ]
+ mock_pkgtask "info_files" "TASK_INFO_FILES_SUCCESS" "$@"
}
task_ocaml_findlib()
{
- [ "${TASK_OCAML_FINDLIB_SUCCESS}" = "yes" ]
+ mock_pkgtask "ocaml_findlib" "TASK_OCAML_FINDLIB_SUCCESS" "$@"
}
task_shells()
{
- [ "${TASK_SHELLS_SUCCESS}" = "yes" ]
+ mock_pkgtask "shells" "TASK_SHELLS_SUCCESS" "$@"
}
task_shlibs()
{
- [ "${TASK_SHLIBS_SUCCESS}" = "yes" ]
+ mock_pkgtask "shlibs" "TASK_SHLIBS_SUCCESS" "$@"
}
task_users()
{
- [ "${TASK_USERS_SUCCESS}" = "yes" ]
+ mock_pkgtask "users" "TASK_USERS_SUCCESS" "$@"
}
# Only succeed if all of the actions were successful.
@@ -232,4 +271,42 @@ test12()
return 0
}
+test13()
+{
+ : ${CAT:=cat}
+
+ describe="\${TASK_VERBOSE} = none"
+ TASK_VERBOSE=none
+ task_postremove "$datafile" > output
+ ${CAT} output
+ if [ -s "$output" ]; then
+ # no output expected
+ return 1
+ fi
+ return 0
+}
+
+test14()
+{
+ : ${CAT:=cat}
+ : ${GREP:=grep}
+
+ describe="\${TASK_VERBOSE} = all"
+ TASK_VERBOSE=all
+ task_postremove "$datafile" > output
+ ${CAT} output
+ for task in \
+ directories fonts function groups icon_themes \
+ ocaml_findlib shells shlibs users
+ do
+ if ${GREP} -q "$task" output; then
+ : "success"
+ else
+ describe="$describe: '$task' missing!"
+ return 1
+ fi
+ done
+ return 0
+}
+
task_run_tests "$@"
Index: pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh
diff -u pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh:1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh:1.3
--- pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh:1.2 Thu Aug 10 05:38:30 2017
+++ pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh Sat Aug 19 00:30:07 2017
@@ -40,25 +40,64 @@ test_setup()
TASK_INFO_FILES_SUCCESS="yes"
}
-# Mock actions whose return values are ignored.
+# Mock actions that return the truthiness of environment variables.
+mock_pkgtask()
+{
+ # required parameters
+ local name="$1"; shift
+ local varname="$1"; shift
+
+ # pkgtask parameters
+ local arg
+ local silent=
+ local OPTIND=1
+ while getopts ":s" arg "$@"; do
+ case $arg in
+ s) silent="yes" ;;
+ *) return 127 ;;
+ esac
+ done
+ shift $(( ${OPTIND} - 1 ))
+ local action="$1"; shift
+ local stage="$1"; shift
+
+ local value symbol result
+ eval value="\${$varname}"
+ if [ "$value" = "yes" ]; then
+ symbol=">"
+ result=0
+ else
+ symbol="!"
+ result=1
+ fi
+
+ # Skip output if doing a "check" action.
+ case $action in
+ check-*)
+ : "do nothing" ;;
+ *) [ -n "$silent" ] || echo "$symbol $name" ;;
+ esac
+ return $result
+}
+
task_files()
{
- [ "${TASK_FILES_SUCCESS}" = "yes" ]
+ mock_pkgtask "files" "TASK_FILES_SUCCESS" "$@"
}
task_function()
{
- [ "${TASK_FUNCTION_SUCCESS}" = "yes" ]
+ mock_pkgtask "function" "TASK_FUNCTION_SUCCESS" "$@"
}
task_icon_themes()
{
- [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ]
+ mock_pkgtask "icon_themes" "TASK_ICON_THEMES_SUCCESS" "$@"
}
task_info_files()
{
- [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ]
+ mock_pkgtask "info_files" "TASK_INFO_FILES_SUCCESS" "$@"
}
# Always succeed except if "function" task fails.
@@ -120,4 +159,39 @@ test5()
return 0
}
+test6()
+{
+ : ${CAT:=cat}
+
+ describe="\${TASK_VERBOSE} = none"
+ TASK_VERBOSE=none
+ task_preremove "$datafile" > output
+ ${CAT} output
+ if [ -s "$output" ]; then
+ # no output expected
+ return 1
+ fi
+ return 0
+}
+
+test7()
+{
+ : ${CAT:=cat}
+ : ${GREP:=grep}
+
+ describe="\${TASK_VERBOSE} = all"
+ TASK_VERBOSE=all
+ task_preremove "$datafile" > output
+ ${CAT} output
+ for task in files function icon_themes info_files; do
+ if ${GREP} -q "$task" output; then
+ : "success"
+ else
+ describe="$describe: '$task' missing!"
+ return 1
+ fi
+ done
+ return 0
+}
+
task_run_tests "$@"
Index: pkgsrc/pkgtools/pkgtasks/files/t/t_preinstall.sh
diff -u pkgsrc/pkgtools/pkgtasks/files/t/t_preinstall.sh:1.1 pkgsrc/pkgtools/pkgtasks/files/t/t_preinstall.sh:1.2
--- pkgsrc/pkgtools/pkgtasks/files/t/t_preinstall.sh:1.1 Thu Jun 1 01:58:34 2017
+++ pkgsrc/pkgtools/pkgtasks/files/t/t_preinstall.sh Sat Aug 19 00:30:07 2017
@@ -40,25 +40,63 @@ test_setup()
TASK_USERS_SUCCESS="yes"
}
-# Mock actions that return the truthiness of environment variables.
+# Mock actions whose return values are ignored.
+mock_pkgtask()
+{
+ # required parameters
+ local name="$1"; shift
+ local varname="$1"; shift
+
+ # pkgtask parameters
+ local arg
+ local silent=
+ local OPTIND=1
+ while getopts ":s" arg "$@"; do
+ case $arg in
+ s) silent="yes" ;;
+ *) return 127 ;;
+ esac
+ done
+ shift $(( ${OPTIND} - 1 ))
+ local action="$1"; shift
+ local stage="$1"; shift
+
+ local value symbol result
+ eval value="\${$varname}"
+ if [ "$value" = "yes" ]; then
+ symbol=">"
+ result=0
+ else
+ symbol="!"
+ result=1
+ fi
+
+ case $action in
+ check-*)
+ : "do nothing" ;;
+ *) [ -n "$silent" ] || echo "$symbol $name" ;;
+ esac
+ return $result
+}
+
task_directories()
{
- [ "${TASK_DIRECTORIES_SUCCESS}" = "yes" ]
+ mock_pkgtask "directories" "TASK_DIRECTORIES_SUCCESS" "$@"
}
task_function()
{
- [ "${TASK_FUNCTION_SUCCESS}" = "yes" ]
+ mock_pkgtask "function" "TASK_FUNCTION_SUCCESS" "$@"
}
task_groups()
{
- [ "${TASK_GROUPS_SUCCESS}" = "yes" ]
+ mock_pkgtask "groups" "TASK_GROUPS_SUCCESS" "$@"
}
task_users()
{
- [ "${TASK_USERS_SUCCESS}" = "yes" ]
+ mock_pkgtask "users" "TASK_USERS_SUCCESS" "$@"
}
test1()
@@ -114,4 +152,38 @@ test5()
return 0
}
+test6()
+{
+ : ${CAT:=cat}
+
+ describe="\${TASK_VERBOSE} = none"
+ TASK_VERBOSE=none
+ task_preinstall "$datafile" > output
+ ${CAT} output
+ if [ -s "$output" ]; then
+ # no output expected
+ return 1
+ fi
+ return 0
+}
+
+test7()
+{
+ : ${CAT:=cat}
+ : ${GREP:=grep}
+
+ describe="\${TASK_VERBOSE} = all"
+ TASK_VERBOSE=all
+ task_preinstall "$datafile" > output
+ ${CAT} output
+ for task in directories function groups users; do
+ if ${GREP} -q "$task" output; then
+ : "success"
+ else
+ describe="$describe: '$task' missing!"
+ return 1
+ fi
+ done
+ return 0
+}
task_run_tests "$@"
Home |
Main Index |
Thread Index |
Old Index