Thu Aug 10 05:38:30 2017 UTC ()
Update pkgtools/pkgtasks to version 1.13.

* Add a "icon_themes" task to cache GTK+ icon theme directories.
* Change the way that install-info(1) is invoked.
* Clarify the output from the "groups" and "users" tasks.
* Bug fixes.


(jlam)
diff -r1.4 -r1.5 pkgsrc/pkgtools/pkgtasks/Makefile
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/PLIST
diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/Makefile.am
diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/Makefile.in
diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/README.md
diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/configure
diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/configure.ac
diff -r0 -r1.1 pkgsrc/pkgtools/pkgtasks/files/NEWS.md
diff -r0 -r1.1 pkgsrc/pkgtools/pkgtasks/files/icon_themes.subr
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/fonts.subr
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/groups.subr
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/info_files.subr
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/load.subr
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/ocaml_findlib.subr
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/postinstall.subr
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/postremove.subr
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/preremove.subr
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/shells.subr
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/users.subr
diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/Kyuafile
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_ocaml_findlib.sh
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh
diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_shells.sh
diff -r0 -r1.1 pkgsrc/pkgtools/pkgtasks/files/t/t_icon_themes.sh

cvs diff -r1.4 -r1.5 pkgsrc/pkgtools/pkgtasks/Makefile (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/Makefile 2017/06/03 23:54:53 1.4
+++ pkgsrc/pkgtools/pkgtasks/Makefile 2017/08/10 05:38:30 1.5
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1# $NetBSD: Makefile,v 1.4 2017/06/03 23:54:53 jlam Exp $ 1# $NetBSD: Makefile,v 1.5 2017/08/10 05:38:30 jlam Exp $
2 2
3DISTNAME= pkgtasks-1-1.10 3DISTNAME= pkgtasks-1-1.13
4CATEGORIES= pkgtools 4CATEGORIES= pkgtools
5MASTER_SITES= # empty 5MASTER_SITES= # empty
6DISTFILES= # empty 6DISTFILES= # empty
7 7
8MAINTAINER= jlam@NetBSD.org 8MAINTAINER= jlam@NetBSD.org
9HOMEPAGE= https://github.com/ultijlam/pkgtasks 9HOMEPAGE= https://github.com/ultijlam/pkgtasks
10COMMENT= Package tasks 10COMMENT= Package tasks
11LICENSE= 2-clause-bsd 11LICENSE= 2-clause-bsd
12 12
13TEST_TARGET= check 13TEST_TARGET= check
14USE_LANGUAGES= # empty 14USE_LANGUAGES= # empty
15USE_TOOLS= sh 15USE_TOOLS= sh
16 16

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/PLIST (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/PLIST 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/PLIST 2017/08/10 05:38:30 1.2
@@ -1,26 +1,28 @@ @@ -1,26 +1,28 @@
1@comment $NetBSD: PLIST,v 1.1 2017/06/01 01:58:34 jlam Exp $ 1@comment $NetBSD: PLIST,v 1.2 2017/08/10 05:38:30 jlam Exp $
2share/doc/${PKGBASE}/AUTHORS 2share/doc/${PKGBASE}/AUTHORS
3share/doc/${PKGBASE}/COPYING 
4share/doc/${PKGBASE}/README.md 3share/doc/${PKGBASE}/README.md
 4share/doc/${PKGBASE}/NEWS.md
 5share/doc/${PKGBASE}/COPYING
5share/${PKGBASE}/cleanup.subr 6share/${PKGBASE}/cleanup.subr
6share/${PKGBASE}/compare.subr 7share/${PKGBASE}/compare.subr
7share/${PKGBASE}/createfile.subr 8share/${PKGBASE}/createfile.subr
8share/${PKGBASE}/directories.subr 9share/${PKGBASE}/directories.subr
9share/${PKGBASE}/dirwalk.subr 10share/${PKGBASE}/dirwalk.subr
10share/${PKGBASE}/echo.subr 11share/${PKGBASE}/echo.subr
11share/${PKGBASE}/files.subr 12share/${PKGBASE}/files.subr
12share/${PKGBASE}/fonts.subr 13share/${PKGBASE}/fonts.subr
13share/${PKGBASE}/groups.subr 14share/${PKGBASE}/groups.subr
 15share/${PKGBASE}/icon_themes.subr
14share/${PKGBASE}/info_files.subr 16share/${PKGBASE}/info_files.subr
15share/${PKGBASE}/load.subr 17share/${PKGBASE}/load.subr
16share/${PKGBASE}/lock.subr 18share/${PKGBASE}/lock.subr
17share/${PKGBASE}/makedir.subr 19share/${PKGBASE}/makedir.subr
18share/${PKGBASE}/maketemp.subr 20share/${PKGBASE}/maketemp.subr
19share/${PKGBASE}/match.subr 21share/${PKGBASE}/match.subr
20share/${PKGBASE}/ocaml_findlib.subr 22share/${PKGBASE}/ocaml_findlib.subr
21share/${PKGBASE}/permissions.subr 23share/${PKGBASE}/permissions.subr
22share/${PKGBASE}/platform.subr 24share/${PKGBASE}/platform.subr
23share/${PKGBASE}/postinstall.subr 25share/${PKGBASE}/postinstall.subr
24share/${PKGBASE}/postremove.subr 26share/${PKGBASE}/postremove.subr
25share/${PKGBASE}/preinstall.subr 27share/${PKGBASE}/preinstall.subr
26share/${PKGBASE}/preremove.subr 28share/${PKGBASE}/preremove.subr
@@ -47,26 +49,27 @@ share/${PKGBASE}/users.subr @@ -47,26 +49,27 @@ share/${PKGBASE}/users.subr
47share/${PKGBASE}/valid_options.subr 49share/${PKGBASE}/valid_options.subr
48share/${PKGBASE}/version.subr 50share/${PKGBASE}/version.subr
49share/${PKGBASE}/which.subr 51share/${PKGBASE}/which.subr
50tests/${PKGBASE}/Kyuafile 52tests/${PKGBASE}/Kyuafile
51tests/${PKGBASE}/run_tests 53tests/${PKGBASE}/run_tests
52tests/${PKGBASE}/t_compare 54tests/${PKGBASE}/t_compare
53tests/${PKGBASE}/t_createfile 55tests/${PKGBASE}/t_createfile
54tests/${PKGBASE}/t_directories 56tests/${PKGBASE}/t_directories
55tests/${PKGBASE}/t_dirwalk 57tests/${PKGBASE}/t_dirwalk
56tests/${PKGBASE}/t_echo 58tests/${PKGBASE}/t_echo
57tests/${PKGBASE}/t_files 59tests/${PKGBASE}/t_files
58tests/${PKGBASE}/t_fonts 60tests/${PKGBASE}/t_fonts
59tests/${PKGBASE}/t_groups 61tests/${PKGBASE}/t_groups
 62tests/${PKGBASE}/t_icon_themes
60tests/${PKGBASE}/t_info_files 63tests/${PKGBASE}/t_info_files
61tests/${PKGBASE}/t_lock 64tests/${PKGBASE}/t_lock
62tests/${PKGBASE}/t_makedir 65tests/${PKGBASE}/t_makedir
63tests/${PKGBASE}/t_maketemp 66tests/${PKGBASE}/t_maketemp
64tests/${PKGBASE}/t_match 67tests/${PKGBASE}/t_match
65tests/${PKGBASE}/t_ocaml_findlib 68tests/${PKGBASE}/t_ocaml_findlib
66tests/${PKGBASE}/t_permissions 69tests/${PKGBASE}/t_permissions
67tests/${PKGBASE}/t_platform 70tests/${PKGBASE}/t_platform
68tests/${PKGBASE}/t_postinstall 71tests/${PKGBASE}/t_postinstall
69tests/${PKGBASE}/t_postremove 72tests/${PKGBASE}/t_postremove
70tests/${PKGBASE}/t_preinstall 73tests/${PKGBASE}/t_preinstall
71tests/${PKGBASE}/t_preremove 74tests/${PKGBASE}/t_preremove
72tests/${PKGBASE}/t_quote 75tests/${PKGBASE}/t_quote

cvs diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/Makefile.am (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/Makefile.am 2017/06/03 23:54:53 1.2
+++ pkgsrc/pkgtools/pkgtasks/files/Makefile.am 2017/08/10 05:38:30 1.3
@@ -15,55 +15,59 @@ @@ -15,55 +15,59 @@
15# 15#
16# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26# POSSIBILITY OF SUCH DAMAGE. 26# POSSIBILITY OF SUCH DAMAGE.
27 27
28doc_DATA = AUTHORS COPYING README.md 28doc_DATA = AUTHORS COPYING NEWS.md README.md
29noinst_DATA = README.md 29noinst_DATA = README.md
30EXTRA_DIST = $(doc_DATA) 30EXTRA_DIST = $(doc_DATA)
 31MAINTAINERCLEANFILES = Makefile.in aclocal.m4
 32MAINTAINERCLEANFILES += build-aux/install-sh build-aux/missing
 33MAINTAINERCLEANFILES += configure $(DIST_ARCHIVES)
31 34
32PHONY_TARGETS =  35PHONY_TARGETS =
33 36
34CHMOD = chmod 37CHMOD = chmod
35MV = mv 38MV = mv
36 39
37# Assume that $source and $target are in the same directory. 40# Assume that $source and $target are in the same directory.
38BUILD_FILE = \ 41BUILD_FILE = \
39 $(SED) -e "s,__POSIX_SHELL__,$(POSIX_SHELL),g" \ 42 $(SED) -e "s,__POSIX_SHELL__,$(POSIX_SHELL),g" \
40 -e "s,__TASK_MODULE_DIR__,$(pkgdatadir),g" \ 43 -e "s,__TASK_MODULE_DIR__,$(pkgdatadir),g" \
41 -e "s,__TASK_TESTS_DIR__,$(pkgtestsdir),g" \ 44 -e "s,__TASK_TESTS_DIR__,$(pkgtestsdir),g" \
42 -e "s,__TASK_VERSION__,$(PACKAGE_VERSION),g" \ 45 -e "s,__TASK_VERSION__,$(PACKAGE_VERSION),g" \
43 < "$$source" > "$$target.tmp" && \ 46 < "$$source" > "$$target.tmp" && \
44 $(MV) -f "$$target.tmp" "$$target" 47 $(MV) -f "$$target.tmp" "$$target"
45 48
46BUILD_SCRIPT = $(BUILD_FILE) && $(CHMOD) +x "$$target" 49BUILD_SCRIPT = $(BUILD_FILE) && $(CHMOD) +x "$$target"
47 50
48dist_pkgdata_DATA = cleanup.subr 51dist_pkgdata_DATA = cleanup.subr
49dist_pkgdata_DATA += compare.subr 52dist_pkgdata_DATA += compare.subr
50dist_pkgdata_DATA += createfile.subr 53dist_pkgdata_DATA += createfile.subr
51dist_pkgdata_DATA += directories.subr 54dist_pkgdata_DATA += directories.subr
52dist_pkgdata_DATA += dirwalk.subr 55dist_pkgdata_DATA += dirwalk.subr
53dist_pkgdata_DATA += echo.subr 56dist_pkgdata_DATA += echo.subr
54dist_pkgdata_DATA += files.subr 57dist_pkgdata_DATA += files.subr
55dist_pkgdata_DATA += fonts.subr 58dist_pkgdata_DATA += fonts.subr
56dist_pkgdata_DATA += groups.subr 59dist_pkgdata_DATA += groups.subr
 60dist_pkgdata_DATA += icon_themes.subr
57dist_pkgdata_DATA += info_files.subr 61dist_pkgdata_DATA += info_files.subr
58dist_pkgdata_DATA += load.subr 62dist_pkgdata_DATA += load.subr
59dist_pkgdata_DATA += lock.subr 63dist_pkgdata_DATA += lock.subr
60dist_pkgdata_DATA += makedir.subr 64dist_pkgdata_DATA += makedir.subr
61dist_pkgdata_DATA += maketemp.subr 65dist_pkgdata_DATA += maketemp.subr
62dist_pkgdata_DATA += match.subr 66dist_pkgdata_DATA += match.subr
63dist_pkgdata_DATA += ocaml_findlib.subr 67dist_pkgdata_DATA += ocaml_findlib.subr
64dist_pkgdata_DATA += permissions.subr 68dist_pkgdata_DATA += permissions.subr
65dist_pkgdata_DATA += platform.subr 69dist_pkgdata_DATA += platform.subr
66dist_pkgdata_DATA += postinstall.subr 70dist_pkgdata_DATA += postinstall.subr
67dist_pkgdata_DATA += postremove.subr 71dist_pkgdata_DATA += postremove.subr
68dist_pkgdata_DATA += preinstall.subr 72dist_pkgdata_DATA += preinstall.subr
69dist_pkgdata_DATA += preremove.subr 73dist_pkgdata_DATA += preremove.subr
@@ -174,26 +178,34 @@ EXTRA_DIST += t/t_fonts.sh @@ -174,26 +178,34 @@ EXTRA_DIST += t/t_fonts.sh
174t/t_fonts: t/t_fonts.sh t/build_test 178t/t_fonts: t/t_fonts.sh t/build_test
175 -$(MKDIR_P) $(builddir)/t 179 -$(MKDIR_P) $(builddir)/t
176 $(AM_V_GEN)target="$(builddir)/t/t_fonts" source="$(srcdir)/t/t_fonts.sh"; \ 180 $(AM_V_GEN)target="$(builddir)/t/t_fonts" source="$(srcdir)/t/t_fonts.sh"; \
177 $(BUILD_TEST) 181 $(BUILD_TEST)
178 182
179pkgtests_SCRIPTS += t/t_groups 183pkgtests_SCRIPTS += t/t_groups
180CLEANFILES += t/t_groups 184CLEANFILES += t/t_groups
181EXTRA_DIST += t/t_groups.sh 185EXTRA_DIST += t/t_groups.sh
182t/t_groups: t/t_groups.sh t/build_test 186t/t_groups: t/t_groups.sh t/build_test
183 -$(MKDIR_P) $(builddir)/t 187 -$(MKDIR_P) $(builddir)/t
184 $(AM_V_GEN)target="$(builddir)/t/t_groups" source="$(srcdir)/t/t_groups.sh"; \ 188 $(AM_V_GEN)target="$(builddir)/t/t_groups" source="$(srcdir)/t/t_groups.sh"; \
185 $(BUILD_TEST) 189 $(BUILD_TEST)
186 190
 191pkgtests_SCRIPTS += t/t_icon_themes
 192CLEANFILES += t/t_icon_themes
 193EXTRA_DIST += t/t_icon_themes.sh
 194t/t_icon_themes: t/t_icon_themes.sh t/build_test
 195 -$(MKDIR_P) $(builddir)/t
 196 $(AM_V_GEN)target="$(builddir)/t/t_icon_themes" source="$(srcdir)/t/t_icon_themes.sh"; \
 197 $(BUILD_TEST)
 198
187pkgtests_SCRIPTS += t/t_info_files 199pkgtests_SCRIPTS += t/t_info_files
188CLEANFILES += t/t_info_files 200CLEANFILES += t/t_info_files
189EXTRA_DIST += t/t_info_files.sh 201EXTRA_DIST += t/t_info_files.sh
190t/t_info_files: t/t_info_files.sh t/build_test 202t/t_info_files: t/t_info_files.sh t/build_test
191 -$(MKDIR_P) $(builddir)/t 203 -$(MKDIR_P) $(builddir)/t
192 $(AM_V_GEN)target="$(builddir)/t/t_info_files" source="$(srcdir)/t/t_info_files.sh"; \ 204 $(AM_V_GEN)target="$(builddir)/t/t_info_files" source="$(srcdir)/t/t_info_files.sh"; \
193 $(BUILD_TEST) 205 $(BUILD_TEST)
194 206
195pkgtests_SCRIPTS += t/t_lock 207pkgtests_SCRIPTS += t/t_lock
196CLEANFILES += t/t_lock 208CLEANFILES += t/t_lock
197EXTRA_DIST += t/t_lock.sh 209EXTRA_DIST += t/t_lock.sh
198t/t_lock: t/t_lock.sh t/build_test 210t/t_lock: t/t_lock.sh t/build_test
199 -$(MKDIR_P) $(builddir)/t 211 -$(MKDIR_P) $(builddir)/t
@@ -480,17 +492,24 @@ installcheck-local: installcheck-kyua @@ -480,17 +492,24 @@ installcheck-local: installcheck-kyua
480installcheck-kyua: 492installcheck-kyua:
481 @failed=no; \ 493 @failed=no; \
482 cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) test || failed=yes; \ 494 cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) test || failed=yes; \
483 if [ "$$failed" = yes ]; then \ 495 if [ "$$failed" = yes ]; then \
484 cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) report \ 496 cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) report \
485 --verbose --results-filter=broken,failed; \ 497 --verbose --results-filter=broken,failed; \
486 exit 1; \ 498 exit 1; \
487 fi 499 fi
488else # HAVE_KYUA 500else # HAVE_KYUA
489check-local: check-run-tests 501check-local: check-run-tests
490installcheck-local: installcheck-run-tests 502installcheck-local: installcheck-run-tests
491endif # HAVE_KYUA 503endif # HAVE_KYUA
492 504
493maintainer-clean-local: 505# Duplicate Automake's check-news target, but verify NEWS.md instead of NEWS.
494 -rm -f Makefile.in aclocal.m4 configure 506dist-hook: check-news-local
495 -rm -f build-aux/install-sh build-aux/missing 507PHONY_TARGETS += check-news-local
496 -rm -f $(PACKAGE)-*.tar.* 508check-news-local:
 509 @newsfile="$(srcdir)/NEWS.md"; \
 510 case `sed 15q "$$newsfile"` in \
 511 *"$(VERSION)"*) : ;; \
 512 *) \
 513 echo "$$newsfile not updated; not releasing" 1>&2; \
 514 exit 1;; \
 515 esac

cvs diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/Makefile.in (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/Makefile.in 2017/06/03 23:54:53 1.2
+++ pkgsrc/pkgtools/pkgtasks/files/Makefile.in 2017/08/10 05:38:30 1.3
@@ -270,98 +270,103 @@ pdfdir = @pdfdir@ @@ -270,98 +270,103 @@ pdfdir = @pdfdir@
270pkgtestsdir = @pkgtestsdir@ 270pkgtestsdir = @pkgtestsdir@
271prefix = @prefix@ 271prefix = @prefix@
272program_transform_name = @program_transform_name@ 272program_transform_name = @program_transform_name@
273psdir = @psdir@ 273psdir = @psdir@
274sbindir = @sbindir@ 274sbindir = @sbindir@
275sharedstatedir = @sharedstatedir@ 275sharedstatedir = @sharedstatedir@
276srcdir = @srcdir@ 276srcdir = @srcdir@
277sysconfdir = @sysconfdir@ 277sysconfdir = @sysconfdir@
278target_alias = @target_alias@ 278target_alias = @target_alias@
279testsdir = @testsdir@ 279testsdir = @testsdir@
280top_build_prefix = @top_build_prefix@ 280top_build_prefix = @top_build_prefix@
281top_builddir = @top_builddir@ 281top_builddir = @top_builddir@
282top_srcdir = @top_srcdir@ 282top_srcdir = @top_srcdir@
283doc_DATA = AUTHORS COPYING README.md 283doc_DATA = AUTHORS COPYING NEWS.md README.md
284noinst_DATA = README.md 284noinst_DATA = README.md
285EXTRA_DIST = $(doc_DATA) version.subr.in t/build_test.sh \ 285EXTRA_DIST = $(doc_DATA) version.subr.in t/build_test.sh \
286 t/run_tests.sh t/t_compare.sh t/t_createfile.sh \ 286 t/run_tests.sh t/t_compare.sh t/t_createfile.sh \
287 t/t_directories.sh t/t_dirwalk.sh t/t_echo.sh t/t_files.sh \ 287 t/t_directories.sh t/t_dirwalk.sh t/t_echo.sh t/t_files.sh \
288 t/t_fonts.sh t/t_groups.sh t/t_info_files.sh t/t_lock.sh \ 288 t/t_fonts.sh t/t_groups.sh t/t_icon_themes.sh \
289 t/t_makedir.sh t/t_maketemp.sh t/t_match.sh \ 289 t/t_info_files.sh t/t_lock.sh t/t_makedir.sh t/t_maketemp.sh \
290 t/t_ocaml_findlib.sh t/t_permissions.sh t/t_platform.sh \ 290 t/t_match.sh t/t_ocaml_findlib.sh t/t_permissions.sh \
291 t/t_postinstall.sh t/t_postremove.sh t/t_preinstall.sh \ 291 t/t_platform.sh t/t_postinstall.sh t/t_postremove.sh \
292 t/t_preremove.sh t/t_quote.sh t/t_random.sh t/t_refcount.sh \ 292 t/t_preinstall.sh t/t_preremove.sh t/t_quote.sh t/t_random.sh \
293 t/t_shells.sh t/t_shlibs.sh t/t_sort.sh t/t_taskfunc.sh \ 293 t/t_refcount.sh t/t_shells.sh t/t_shlibs.sh t/t_sort.sh \
294 t/t_tee.sh t/t_truthy.sh t/t_usergroup.sh \ 294 t/t_taskfunc.sh t/t_tee.sh t/t_truthy.sh t/t_usergroup.sh \
295 t/t_usergroup_FreeBSD.sh t/t_usergroup_Linux.sh \ 295 t/t_usergroup_FreeBSD.sh t/t_usergroup_Linux.sh \
296 t/t_usergroup_MirBSD.sh t/t_usergroup_NetBSD.sh \ 296 t/t_usergroup_MirBSD.sh t/t_usergroup_NetBSD.sh \
297 t/t_usergroup_exists.sh t/t_usergroup_mock.sh t/t_users.sh \ 297 t/t_usergroup_exists.sh t/t_usergroup_mock.sh t/t_users.sh \
298 t/t_valid_options.sh t/t_version.sh t/t_which.sh 298 t/t_valid_options.sh t/t_version.sh t/t_which.sh
299PHONY_TARGETS = check-run-tets installcheck-run-tests $(am__append_1) 299MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/install-sh \
 300 build-aux/missing configure $(DIST_ARCHIVES)
 301PHONY_TARGETS = check-run-tets installcheck-run-tests $(am__append_1) \
 302 check-news-local
300CHMOD = chmod 303CHMOD = chmod
301MV = mv 304MV = mv
302 305
303# Assume that $source and $target are in the same directory. 306# Assume that $source and $target are in the same directory.
304BUILD_FILE = \ 307BUILD_FILE = \
305 $(SED) -e "s,__POSIX_SHELL__,$(POSIX_SHELL),g" \ 308 $(SED) -e "s,__POSIX_SHELL__,$(POSIX_SHELL),g" \
306 -e "s,__TASK_MODULE_DIR__,$(pkgdatadir),g" \ 309 -e "s,__TASK_MODULE_DIR__,$(pkgdatadir),g" \
307 -e "s,__TASK_TESTS_DIR__,$(pkgtestsdir),g" \ 310 -e "s,__TASK_TESTS_DIR__,$(pkgtestsdir),g" \
308 -e "s,__TASK_VERSION__,$(PACKAGE_VERSION),g" \ 311 -e "s,__TASK_VERSION__,$(PACKAGE_VERSION),g" \
309 < "$$source" > "$$target.tmp" && \ 312 < "$$source" > "$$target.tmp" && \
310 $(MV) -f "$$target.tmp" "$$target" 313 $(MV) -f "$$target.tmp" "$$target"
311 314
312BUILD_SCRIPT = $(BUILD_FILE) && $(CHMOD) +x "$$target" 315BUILD_SCRIPT = $(BUILD_FILE) && $(CHMOD) +x "$$target"
313dist_pkgdata_DATA = cleanup.subr compare.subr createfile.subr \ 316dist_pkgdata_DATA = cleanup.subr compare.subr createfile.subr \
314 directories.subr dirwalk.subr echo.subr files.subr fonts.subr \ 317 directories.subr dirwalk.subr echo.subr files.subr fonts.subr \
315 groups.subr info_files.subr load.subr lock.subr makedir.subr \ 318 groups.subr icon_themes.subr info_files.subr load.subr \
316 maketemp.subr match.subr ocaml_findlib.subr permissions.subr \ 319 lock.subr makedir.subr maketemp.subr match.subr \
317 platform.subr postinstall.subr postremove.subr preinstall.subr \ 320 ocaml_findlib.subr permissions.subr platform.subr \
 321 postinstall.subr postremove.subr preinstall.subr \
318 preremove.subr quote.subr random.subr refcount.subr \ 322 preremove.subr quote.subr random.subr refcount.subr \
319 refcount_file.subr say.subr shells.subr shlibs.subr sort.subr \ 323 refcount_file.subr say.subr shells.subr shlibs.subr sort.subr \
320 taskfunc.subr tee.subr truthy.subr unittest.subr \ 324 taskfunc.subr tee.subr truthy.subr unittest.subr \
321 usergroup.subr usergroup_FreeBSD.subr usergroup_Linux.subr \ 325 usergroup.subr usergroup_FreeBSD.subr usergroup_Linux.subr \
322 usergroup_MirBSD.subr usergroup_NetBSD.subr \ 326 usergroup_MirBSD.subr usergroup_NetBSD.subr \
323 usergroup_exists.subr usergroup_mock.subr users.subr \ 327 usergroup_exists.subr usergroup_mock.subr users.subr \
324 valid_options.subr which.subr 328 valid_options.subr which.subr
325pkgdata_DATA = version.subr 329pkgdata_DATA = version.subr
326CLEANFILES = version.subr t/build_test t/run_tests t/t_compare \ 330CLEANFILES = version.subr t/build_test t/run_tests t/t_compare \
327 t/t_createfile t/t_directories t/t_dirwalk t/t_echo t/t_files \ 331 t/t_createfile t/t_directories t/t_dirwalk t/t_echo t/t_files \
328 t/t_fonts t/t_groups t/t_info_files t/t_lock t/t_makedir \ 332 t/t_fonts t/t_groups t/t_icon_themes t/t_info_files t/t_lock \
329 t/t_maketemp t/t_match t/t_ocaml_findlib t/t_permissions \ 333 t/t_makedir t/t_maketemp t/t_match t/t_ocaml_findlib \
330 t/t_platform t/t_postinstall t/t_postremove t/t_preinstall \ 334 t/t_permissions t/t_platform t/t_postinstall t/t_postremove \
331 t/t_preremove t/t_quote t/t_random t/t_refcount t/t_shells \ 335 t/t_preinstall t/t_preremove t/t_quote t/t_random t/t_refcount \
332 t/t_shlibs t/t_sort t/t_taskfunc t/t_tee t/t_truthy \ 336 t/t_shells t/t_shlibs t/t_sort t/t_taskfunc t/t_tee t/t_truthy \
333 t/t_usergroup t/t_usergroup_FreeBSD t/t_usergroup_Linux \ 337 t/t_usergroup t/t_usergroup_FreeBSD t/t_usergroup_Linux \
334 t/t_usergroup_MirBSD t/t_usergroup_NetBSD t/t_usergroup_exists \ 338 t/t_usergroup_MirBSD t/t_usergroup_NetBSD t/t_usergroup_exists \
335 t/t_usergroup_mock t/t_users t/t_valid_options t/t_version \ 339 t/t_usergroup_mock t/t_users t/t_valid_options t/t_version \
336 t/t_which 340 t/t_which
337 341
338# Build a test script. 342# Build a test script.
339BUILD_TEST = \ 343BUILD_TEST = \
340 TASK_MODULE_DIR="$(top_srcdir)" TASK_TESTS_DIR="$(top_srcdir)/t" \ 344 TASK_MODULE_DIR="$(top_srcdir)" TASK_TESTS_DIR="$(top_srcdir)/t" \
341 $(builddir)/t/build_test -o "$$target" "$$source" 345 $(builddir)/t/build_test -o "$$target" "$$source"
342 346
343dist_pkgtests_DATA = t/Kyuafile 347dist_pkgtests_DATA = t/Kyuafile
344noinst_SCRIPTS = t/build_test 348noinst_SCRIPTS = t/build_test
345pkgtests_SCRIPTS = t/run_tests t/t_compare t/t_createfile \ 349pkgtests_SCRIPTS = t/run_tests t/t_compare t/t_createfile \
346 t/t_directories t/t_dirwalk t/t_echo t/t_files t/t_fonts \ 350 t/t_directories t/t_dirwalk t/t_echo t/t_files t/t_fonts \
347 t/t_groups t/t_info_files t/t_lock t/t_makedir t/t_maketemp \ 351 t/t_groups t/t_icon_themes t/t_info_files t/t_lock t/t_makedir \
348 t/t_match t/t_ocaml_findlib t/t_permissions t/t_platform \ 352 t/t_maketemp t/t_match t/t_ocaml_findlib t/t_permissions \
349 t/t_postinstall t/t_postremove t/t_preinstall t/t_preremove \ 353 t/t_platform t/t_postinstall t/t_postremove t/t_preinstall \
350 t/t_quote t/t_random t/t_refcount t/t_shells t/t_shlibs \ 354 t/t_preremove t/t_quote t/t_random t/t_refcount t/t_shells \
351 t/t_sort t/t_taskfunc t/t_tee t/t_truthy t/t_usergroup \ 355 t/t_shlibs t/t_sort t/t_taskfunc t/t_tee t/t_truthy \
352 t/t_usergroup_FreeBSD t/t_usergroup_Linux t/t_usergroup_MirBSD \ 356 t/t_usergroup t/t_usergroup_FreeBSD t/t_usergroup_Linux \
353 t/t_usergroup_NetBSD t/t_usergroup_exists t/t_usergroup_mock \ 357 t/t_usergroup_MirBSD t/t_usergroup_NetBSD t/t_usergroup_exists \
354 t/t_users t/t_valid_options t/t_version t/t_which 358 t/t_usergroup_mock t/t_users t/t_valid_options t/t_version \
 359 t/t_which
355 360
356# CHECK_ENVIRONMENT 361# CHECK_ENVIRONMENT
357# This is used to set variables before calling kyua on the tests in 362# This is used to set variables before calling kyua on the tests in
358# the build directory. 363# the build directory.
359# 364#
360# TESTS_ENVIRONMENT 365# TESTS_ENVIRONMENT
361# This is used to set variables before calling kyua, regardless of 366# This is used to set variables before calling kyua, regardless of
362# whether the tests are installed or in the build directory. 367# whether the tests are installed or in the build directory.
363@HAVE_KYUA_TRUE@CHECK_ENVIRONMENT = \ 368@HAVE_KYUA_TRUE@CHECK_ENVIRONMENT = \
364@HAVE_KYUA_TRUE@ TASK_MODULE_DIR=$(abs_top_srcdir) \ 369@HAVE_KYUA_TRUE@ TASK_MODULE_DIR=$(abs_top_srcdir) \
365@HAVE_KYUA_TRUE@ TASK_TESTS_DIR=$(abs_top_srcdir)/t 370@HAVE_KYUA_TRUE@ TASK_TESTS_DIR=$(abs_top_srcdir)/t
366 371
367all: all-am 372all: all-am
@@ -548,26 +553,29 @@ distdir: $(DISTFILES) @@ -548,26 +553,29 @@ distdir: $(DISTFILES)
548 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 553 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
549 fi; \ 554 fi; \
550 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 555 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
551 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 556 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
552 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 557 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
553 fi; \ 558 fi; \
554 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 559 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
555 else \ 560 else \
556 test -f "$(distdir)/$$file" \ 561 test -f "$(distdir)/$$file" \
557 || cp -p $$d/$$file "$(distdir)/$$file" \ 562 || cp -p $$d/$$file "$(distdir)/$$file" \
558 || exit 1; \ 563 || exit 1; \
559 fi; \ 564 fi; \
560 done 565 done
 566 $(MAKE) $(AM_MAKEFLAGS) \
 567 top_distdir="$(top_distdir)" distdir="$(distdir)" \
 568 dist-hook
561 -test -n "$(am__skip_mode_fix)" \ 569 -test -n "$(am__skip_mode_fix)" \
562 || find "$(distdir)" -type d ! -perm -755 \ 570 || find "$(distdir)" -type d ! -perm -755 \
563 -exec chmod u+rwx,go+rx {} \; -o \ 571 -exec chmod u+rwx,go+rx {} \; -o \
564 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 572 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
565 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 573 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
566 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 574 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
567 || chmod -R a+r "$(distdir)" 575 || chmod -R a+r "$(distdir)"
568dist-gzip: distdir 576dist-gzip: distdir
569 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 577 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
570 $(am__post_remove_distdir) 578 $(am__post_remove_distdir)
571 579
572dist-bzip2: distdir 580dist-bzip2: distdir
573 tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 581 tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
@@ -718,26 +726,27 @@ install-strip: @@ -718,26 +726,27 @@ install-strip:
718 fi 726 fi
719mostlyclean-generic: 727mostlyclean-generic:
720 728
721clean-generic: 729clean-generic:
722 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 730 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
723 731
724distclean-generic: 732distclean-generic:
725 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 733 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
726 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 734 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
727 735
728maintainer-clean-generic: 736maintainer-clean-generic:
729 @echo "This command is intended for maintainers to use" 737 @echo "This command is intended for maintainers to use"
730 @echo "it deletes files that may require special tools to rebuild." 738 @echo "it deletes files that may require special tools to rebuild."
 739 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
731clean: clean-am 740clean: clean-am
732 741
733clean-am: clean-generic mostlyclean-am 742clean-am: clean-generic mostlyclean-am
734 743
735distclean: distclean-am 744distclean: distclean-am
736 -rm -f $(am__CONFIG_DISTCLEAN_FILES) 745 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
737 -rm -f Makefile 746 -rm -f Makefile
738distclean-am: clean-am distclean-generic 747distclean-am: clean-am distclean-generic
739 748
740dvi: dvi-am 749dvi: dvi-am
741 750
742dvi-am: 751dvi-am:
743 752
@@ -772,65 +781,64 @@ install-pdf: install-pdf-am @@ -772,65 +781,64 @@ install-pdf: install-pdf-am
772 781
773install-pdf-am: 782install-pdf-am:
774 783
775install-ps: install-ps-am 784install-ps: install-ps-am
776 785
777install-ps-am: 786install-ps-am:
778 787
779installcheck-am: installcheck-local 788installcheck-am: installcheck-local
780 789
781maintainer-clean: maintainer-clean-am 790maintainer-clean: maintainer-clean-am
782 -rm -f $(am__CONFIG_DISTCLEAN_FILES) 791 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
783 -rm -rf $(top_srcdir)/autom4te.cache 792 -rm -rf $(top_srcdir)/autom4te.cache
784 -rm -f Makefile 793 -rm -f Makefile
785maintainer-clean-am: distclean-am maintainer-clean-generic \ 794maintainer-clean-am: distclean-am maintainer-clean-generic
786 maintainer-clean-local 
787 795
788mostlyclean: mostlyclean-am 796mostlyclean: mostlyclean-am
789 797
790mostlyclean-am: mostlyclean-generic 798mostlyclean-am: mostlyclean-generic
791 799
792pdf: pdf-am 800pdf: pdf-am
793 801
794pdf-am: 802pdf-am:
795 803
796ps: ps-am 804ps: ps-am
797 805
798ps-am: 806ps-am:
799 807
800uninstall-am: uninstall-dist_pkgdataDATA uninstall-dist_pkgtestsDATA \ 808uninstall-am: uninstall-dist_pkgdataDATA uninstall-dist_pkgtestsDATA \
801 uninstall-docDATA uninstall-pkgdataDATA \ 809 uninstall-docDATA uninstall-pkgdataDATA \
802 uninstall-pkgtestsSCRIPTS 810 uninstall-pkgtestsSCRIPTS
803 811
804.MAKE: check-am install-am install-strip 812.MAKE: check-am install-am install-strip
805 813
806.PHONY: all all-am am--refresh check check-am check-local clean \ 814.PHONY: all all-am am--refresh check check-am check-local clean \
807 clean-generic cscopelist-am ctags-am dist dist-all dist-bzip2 \ 815 clean-generic cscopelist-am ctags-am dist dist-all dist-bzip2 \
808 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ 816 dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \
809 distcheck distclean distclean-generic distcleancheck distdir \ 817 dist-zip distcheck distclean distclean-generic distcleancheck \
810 distuninstallcheck dvi dvi-am html html-am info info-am \ 818 distdir distuninstallcheck dvi dvi-am html html-am info \
811 install install-am install-data install-data-am \ 819 info-am install install-am install-data install-data-am \
812 install-dist_pkgdataDATA install-dist_pkgtestsDATA \ 820 install-dist_pkgdataDATA install-dist_pkgtestsDATA \
813 install-docDATA install-dvi install-dvi-am install-exec \ 821 install-docDATA install-dvi install-dvi-am install-exec \
814 install-exec-am install-html install-html-am install-info \ 822 install-exec-am install-html install-html-am install-info \
815 install-info-am install-man install-pdf install-pdf-am \ 823 install-info-am install-man install-pdf install-pdf-am \
816 install-pkgdataDATA install-pkgtestsSCRIPTS install-ps \ 824 install-pkgdataDATA install-pkgtestsSCRIPTS install-ps \
817 install-ps-am install-strip installcheck installcheck-am \ 825 install-ps-am install-strip installcheck installcheck-am \
818 installcheck-local installdirs maintainer-clean \ 826 installcheck-local installdirs maintainer-clean \
819 maintainer-clean-generic maintainer-clean-local mostlyclean \ 827 maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
820 mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ 828 pdf-am ps ps-am tags-am uninstall uninstall-am \
821 uninstall-am uninstall-dist_pkgdataDATA \ 829 uninstall-dist_pkgdataDATA uninstall-dist_pkgtestsDATA \
822 uninstall-dist_pkgtestsDATA uninstall-docDATA \ 830 uninstall-docDATA uninstall-pkgdataDATA \
823 uninstall-pkgdataDATA uninstall-pkgtestsSCRIPTS 831 uninstall-pkgtestsSCRIPTS
824 832
825.PRECIOUS: Makefile 833.PRECIOUS: Makefile
826 834
827version.subr: version.subr.in 835version.subr: version.subr.in
828 -$(MKDIR_P) $(builddir) 836 -$(MKDIR_P) $(builddir)
829 $(AM_V_GEN)target="$(builddir)/version.subr" source="$(srcdir)/version.subr.in"; \ 837 $(AM_V_GEN)target="$(builddir)/version.subr" source="$(srcdir)/version.subr.in"; \
830 $(BUILD_FILE) 838 $(BUILD_FILE)
831t/build_test: t/build_test.sh 839t/build_test: t/build_test.sh
832 -$(MKDIR_P) $(builddir)/t 840 -$(MKDIR_P) $(builddir)/t
833 $(AM_V_GEN)target="$(builddir)/t/build_test" source="$(srcdir)/t/build_test.sh"; \ 841 $(AM_V_GEN)target="$(builddir)/t/build_test" source="$(srcdir)/t/build_test.sh"; \
834 $(BUILD_SCRIPT) 842 $(BUILD_SCRIPT)
835t/run_tests: t/run_tests.sh 843t/run_tests: t/run_tests.sh
836 -$(MKDIR_P) $(builddir)/t 844 -$(MKDIR_P) $(builddir)/t
@@ -858,26 +866,30 @@ t/t_echo: t/t_echo.sh t/build_test @@ -858,26 +866,30 @@ t/t_echo: t/t_echo.sh t/build_test
858 $(BUILD_TEST) 866 $(BUILD_TEST)
859t/t_files: t/t_files.sh t/build_test 867t/t_files: t/t_files.sh t/build_test
860 -$(MKDIR_P) $(builddir)/t 868 -$(MKDIR_P) $(builddir)/t
861 $(AM_V_GEN)target="$(builddir)/t/t_files" source="$(srcdir)/t/t_files.sh"; \ 869 $(AM_V_GEN)target="$(builddir)/t/t_files" source="$(srcdir)/t/t_files.sh"; \
862 $(BUILD_TEST) 870 $(BUILD_TEST)
863t/t_fonts: t/t_fonts.sh t/build_test 871t/t_fonts: t/t_fonts.sh t/build_test
864 -$(MKDIR_P) $(builddir)/t 872 -$(MKDIR_P) $(builddir)/t
865 $(AM_V_GEN)target="$(builddir)/t/t_fonts" source="$(srcdir)/t/t_fonts.sh"; \ 873 $(AM_V_GEN)target="$(builddir)/t/t_fonts" source="$(srcdir)/t/t_fonts.sh"; \
866 $(BUILD_TEST) 874 $(BUILD_TEST)
867t/t_groups: t/t_groups.sh t/build_test 875t/t_groups: t/t_groups.sh t/build_test
868 -$(MKDIR_P) $(builddir)/t 876 -$(MKDIR_P) $(builddir)/t
869 $(AM_V_GEN)target="$(builddir)/t/t_groups" source="$(srcdir)/t/t_groups.sh"; \ 877 $(AM_V_GEN)target="$(builddir)/t/t_groups" source="$(srcdir)/t/t_groups.sh"; \
870 $(BUILD_TEST) 878 $(BUILD_TEST)
 879t/t_icon_themes: t/t_icon_themes.sh t/build_test
 880 -$(MKDIR_P) $(builddir)/t
 881 $(AM_V_GEN)target="$(builddir)/t/t_icon_themes" source="$(srcdir)/t/t_icon_themes.sh"; \
 882 $(BUILD_TEST)
871t/t_info_files: t/t_info_files.sh t/build_test 883t/t_info_files: t/t_info_files.sh t/build_test
872 -$(MKDIR_P) $(builddir)/t 884 -$(MKDIR_P) $(builddir)/t
873 $(AM_V_GEN)target="$(builddir)/t/t_info_files" source="$(srcdir)/t/t_info_files.sh"; \ 885 $(AM_V_GEN)target="$(builddir)/t/t_info_files" source="$(srcdir)/t/t_info_files.sh"; \
874 $(BUILD_TEST) 886 $(BUILD_TEST)
875t/t_lock: t/t_lock.sh t/build_test 887t/t_lock: t/t_lock.sh t/build_test
876 -$(MKDIR_P) $(builddir)/t 888 -$(MKDIR_P) $(builddir)/t
877 $(AM_V_GEN)target="$(builddir)/t/t_lock" source="$(srcdir)/t/t_lock.sh"; \ 889 $(AM_V_GEN)target="$(builddir)/t/t_lock" source="$(srcdir)/t/t_lock.sh"; \
878 $(BUILD_TEST) 890 $(BUILD_TEST)
879t/t_makedir: t/t_makedir.sh t/build_test 891t/t_makedir: t/t_makedir.sh t/build_test
880 -$(MKDIR_P) $(builddir)/t 892 -$(MKDIR_P) $(builddir)/t
881 $(AM_V_GEN)target="$(builddir)/t/t_makedir" source="$(srcdir)/t/t_makedir.sh"; \ 893 $(AM_V_GEN)target="$(builddir)/t/t_makedir" source="$(srcdir)/t/t_makedir.sh"; \
882 $(BUILD_TEST) 894 $(BUILD_TEST)
883t/t_maketemp: t/t_maketemp.sh t/build_test 895t/t_maketemp: t/t_maketemp.sh t/build_test
@@ -1014,21 +1026,27 @@ installcheck-run-tests: @@ -1014,21 +1026,27 @@ installcheck-run-tests:
1014@HAVE_KYUA_TRUE@ fi 1026@HAVE_KYUA_TRUE@ fi
1015@HAVE_KYUA_TRUE@installcheck-local: installcheck-kyua 1027@HAVE_KYUA_TRUE@installcheck-local: installcheck-kyua
1016@HAVE_KYUA_TRUE@installcheck-kyua: 1028@HAVE_KYUA_TRUE@installcheck-kyua:
1017@HAVE_KYUA_TRUE@ @failed=no; \ 1029@HAVE_KYUA_TRUE@ @failed=no; \
1018@HAVE_KYUA_TRUE@ cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) test || failed=yes; \ 1030@HAVE_KYUA_TRUE@ cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) test || failed=yes; \
1019@HAVE_KYUA_TRUE@ if [ "$$failed" = yes ]; then \ 1031@HAVE_KYUA_TRUE@ if [ "$$failed" = yes ]; then \
1020@HAVE_KYUA_TRUE@ cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) report \ 1032@HAVE_KYUA_TRUE@ cd $(pkgtestsdir) && $(TESTS_ENVIRONMENT) $(KYUA) report \
1021@HAVE_KYUA_TRUE@ --verbose --results-filter=broken,failed; \ 1033@HAVE_KYUA_TRUE@ --verbose --results-filter=broken,failed; \
1022@HAVE_KYUA_TRUE@ exit 1; \ 1034@HAVE_KYUA_TRUE@ exit 1; \
1023@HAVE_KYUA_TRUE@ fi 1035@HAVE_KYUA_TRUE@ fi
1024@HAVE_KYUA_FALSE@check-local: check-run-tests 1036@HAVE_KYUA_FALSE@check-local: check-run-tests
1025@HAVE_KYUA_FALSE@installcheck-local: installcheck-run-tests 1037@HAVE_KYUA_FALSE@installcheck-local: installcheck-run-tests
1026 1038
1027maintainer-clean-local: 1039# Duplicate Automake's check-news target, but verify NEWS.md instead of NEWS.
1028 -rm -f Makefile.in aclocal.m4 configure 1040dist-hook: check-news-local
1029 -rm -f build-aux/install-sh build-aux/missing 1041check-news-local:
1030 -rm -f $(PACKAGE)-*.tar.* 1042 @newsfile="$(srcdir)/NEWS.md"; \
 1043 case `sed 15q "$$newsfile"` in \
 1044 *"$(VERSION)"*) : ;; \
 1045 *) \
 1046 echo "$$newsfile not updated; not releasing" 1>&2; \
 1047 exit 1;; \
 1048 esac
1031 1049
1032# Tell versions [3.59,3.63) of GNU make to not export all variables. 1050# Tell versions [3.59,3.63) of GNU make to not export all variables.
1033# Otherwise a system limit (for SysV at least) may be exceeded. 1051# Otherwise a system limit (for SysV at least) may be exceeded.
1034.NOEXPORT: 1052.NOEXPORT:

cvs diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/README.md (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/README.md 2017/06/03 23:54:53 1.2
+++ pkgsrc/pkgtools/pkgtasks/files/README.md 2017/08/10 05:38:30 1.3
@@ -16,52 +16,53 @@ e.g., @@ -16,52 +16,53 @@ e.g.,
16 16
17 * reminding the user of files that may be customized after package 17 * reminding the user of files that may be customized after package
18 installation. 18 installation.
19 19
20Package tasks have the property of *idempotence* -- they may be invoked 20Package tasks have the property of *idempotence* -- they may be invoked
21multiple times, but the result must be the same as when invoked once, e.g., 21multiple times, but the result must be the same as when invoked once, e.g.,
22the `shells` task adds an entry to /etc/shells, but will avoid adding the 22the `shells` task adds an entry to /etc/shells, but will avoid adding the
23same entry more than once. 23same entry more than once.
24 24
25 25
26Getting sources 26Getting sources
27--------------- 27---------------
28 28
29The latest version of *pkgtasks* is 1.10 and was released on June 3rd, 2017. 29The latest version of *pkgtasks* is 1.13 and was released on August 8th, 2017.
30 30
31See the [release notes](NEWS.md) for information about the changes in this 31See the [release notes](NEWS.md) for information about the changes in this
32and all previous releases. 32and all previous releases.
33 33
34 34
35Documentation 35Documentation
36------------- 36-------------
37 37
38A script may load task modules to define shell functions to perform 38A script may load task modules to define shell functions to perform
39various tasks. A task module is loaded in a POSIX-compliant shell script 39various tasks. A task module is loaded in a POSIX-compliant shell script
40by adding the following boilerplate to the script: 40by adding the following boilerplate to the script:
41 41
42 # Import the task loader. 42 # Import the task loader.
43 : ${TASK_MODULE_DIR:=/usr/pkg/share/pkgtasks-1} 43 : ${TASK_MODULE_DIR:=/usr/pkg/share/pkgtasks-1}
44 . "${TASK_MODULE_DIR}/load.subr" 44 . "${TASK_MODULE_DIR}/load.subr"
45 45
46 # Load task modules. 46 # Load task modules.
47 task_load preinstall 47 task_load preinstall
48 48
49The individual package tasks supported by *pkgtasks* are: 49The individual package tasks supported by *pkgtasks* are:
50 50
51 * `directories`: create and remove directories outside of package tree 51 * `directories`: create and remove directories outside of package tree
52 * `files`: copy and remove configuration files 52 * `files`: copy and remove configuration files
53 * `fonts`: regenerate X11 font indices 53 * `fonts`: regenerate X11 font indices
54 * `groups`: create groups and warn about groups that may be removed 54 * `groups`: create groups and warn about groups that may be removed
 55 * `icon_themes`: create caches in GTK+ icon theme directories
55 * `info_files`: register and unregister GNU info files 56 * `info_files`: register and unregister GNU info files
56 * `ocaml_findlib`: update OCaml findlib search paths 57 * `ocaml_findlib`: update OCaml findlib search paths
57 * `permissions`: check and set modes and permissions on special files 58 * `permissions`: check and set modes and permissions on special files
58 * `shells`: register and unregister login shells 59 * `shells`: register and unregister login shells
59 * `shlibs`: update the shared library cache 60 * `shlibs`: update the shared library cache
60 * `users`: create users and warn about users that may be removed 61 * `users`: create users and warn about users that may be removed
61 62
62These package tasks support `${PKG_DESTDIR}` to manipulate the correct 63These package tasks support `${PKG_DESTDIR}` to manipulate the correct
63filesystem paths for a destdir-installed package. 64filesystem paths for a destdir-installed package.
64 65
65For convenience, these have been composed into larger meta-tasks: 66For convenience, these have been composed into larger meta-tasks:
66 67
67 * `preinstall`: tasks performed before files are installed 68 * `preinstall`: tasks performed before files are installed

cvs diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/configure (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/configure 2017/06/03 23:54:53 1.2
+++ pkgsrc/pkgtools/pkgtasks/files/configure 2017/08/10 05:38:30 1.3
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#! /bin/sh 1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles. 2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.69 for pkgtasks-1 1.10. 3# Generated by GNU Autoconf 2.69 for pkgtasks-1 1.13.
4# 4#
5# Report bugs to <jlam@NetBSD.org>. 5# Report bugs to <jlam@NetBSD.org>.
6# 6#
7# 7#
8# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. 8# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
9# 9#
10# 10#
11# This configure script is free software; the Free Software Foundation 11# This configure script is free software; the Free Software Foundation
12# gives unlimited permission to copy, distribute and modify it. 12# gives unlimited permission to copy, distribute and modify it.
13## -------------------- ## 13## -------------------- ##
14## M4sh Initialization. ## 14## M4sh Initialization. ##
15## -------------------- ## 15## -------------------- ##
16 16
@@ -570,28 +570,28 @@ ac_hostname=`(hostname || uname -n) 2>/d @@ -570,28 +570,28 @@ ac_hostname=`(hostname || uname -n) 2>/d
570# 570#
571ac_default_prefix=/usr/local 571ac_default_prefix=/usr/local
572ac_clean_files= 572ac_clean_files=
573ac_config_libobj_dir=. 573ac_config_libobj_dir=.
574LIBOBJS= 574LIBOBJS=
575cross_compiling=no 575cross_compiling=no
576subdirs= 576subdirs=
577MFLAGS= 577MFLAGS=
578MAKEFLAGS= 578MAKEFLAGS=
579 579
580# Identity of this package. 580# Identity of this package.
581PACKAGE_NAME='pkgtasks-1' 581PACKAGE_NAME='pkgtasks-1'
582PACKAGE_TARNAME='pkgtasks-1' 582PACKAGE_TARNAME='pkgtasks-1'
583PACKAGE_VERSION='1.10' 583PACKAGE_VERSION='1.13'
584PACKAGE_STRING='pkgtasks-1 1.10' 584PACKAGE_STRING='pkgtasks-1 1.13'
585PACKAGE_BUGREPORT='jlam@NetBSD.org' 585PACKAGE_BUGREPORT='jlam@NetBSD.org'
586PACKAGE_URL='' 586PACKAGE_URL=''
587 587
588ac_unique_file="load.subr" 588ac_unique_file="load.subr"
589ac_subst_vars='LTLIBOBJS 589ac_subst_vars='LTLIBOBJS
590LIBOBJS 590LIBOBJS
591pkgtestsdir 591pkgtestsdir
592testsdir 592testsdir
593SED 593SED
594HAVE_KYUA_FALSE 594HAVE_KYUA_FALSE
595HAVE_KYUA_TRUE 595HAVE_KYUA_TRUE
596KYUA 596KYUA
597POSIX_SHELL 597POSIX_SHELL
@@ -1199,27 +1199,27 @@ for ac_var in $ac_precious_vars; do @@ -1199,27 +1199,27 @@ for ac_var in $ac_precious_vars; do
1199 eval ac_env_${ac_var}_set=\${${ac_var}+set} 1199 eval ac_env_${ac_var}_set=\${${ac_var}+set}
1200 eval ac_env_${ac_var}_value=\$${ac_var} 1200 eval ac_env_${ac_var}_value=\$${ac_var}
1201 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} 1201 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1202 eval ac_cv_env_${ac_var}_value=\$${ac_var} 1202 eval ac_cv_env_${ac_var}_value=\$${ac_var}
1203done 1203done
1204 1204
1205# 1205#
1206# Report the --help message. 1206# Report the --help message.
1207# 1207#
1208if test "$ac_init_help" = "long"; then 1208if test "$ac_init_help" = "long"; then
1209 # Omit some internal or obsolete options to make the list less imposing. 1209 # Omit some internal or obsolete options to make the list less imposing.
1210 # This message is too long to be a string in the A/UX 3.1 sh. 1210 # This message is too long to be a string in the A/UX 3.1 sh.
1211 cat <<_ACEOF 1211 cat <<_ACEOF
1212\`configure' configures pkgtasks-1 1.10 to adapt to many kinds of systems. 1212\`configure' configures pkgtasks-1 1.13 to adapt to many kinds of systems.
1213 1213
1214Usage: $0 [OPTION]... [VAR=VALUE]... 1214Usage: $0 [OPTION]... [VAR=VALUE]...
1215 1215
1216To assign environment variables (e.g., CC, CFLAGS...), specify them as 1216To assign environment variables (e.g., CC, CFLAGS...), specify them as
1217VAR=VALUE. See below for descriptions of some of the useful variables. 1217VAR=VALUE. See below for descriptions of some of the useful variables.
1218 1218
1219Defaults for the options are specified in brackets. 1219Defaults for the options are specified in brackets.
1220 1220
1221Configuration: 1221Configuration:
1222 -h, --help display this help and exit 1222 -h, --help display this help and exit
1223 --help=short display options specific to this package 1223 --help=short display options specific to this package
1224 --help=recursive display the short help of all the included packages 1224 --help=recursive display the short help of all the included packages
1225 -V, --version display version information and exit 1225 -V, --version display version information and exit
@@ -1265,27 +1265,27 @@ Fine tuning of the installation director @@ -1265,27 +1265,27 @@ Fine tuning of the installation director
1265_ACEOF 1265_ACEOF
1266 1266
1267 cat <<\_ACEOF 1267 cat <<\_ACEOF
1268 1268
1269Program names: 1269Program names:
1270 --program-prefix=PREFIX prepend PREFIX to installed program names 1270 --program-prefix=PREFIX prepend PREFIX to installed program names
1271 --program-suffix=SUFFIX append SUFFIX to installed program names 1271 --program-suffix=SUFFIX append SUFFIX to installed program names
1272 --program-transform-name=PROGRAM run sed PROGRAM on installed program names 1272 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
1273_ACEOF 1273_ACEOF
1274fi 1274fi
1275 1275
1276if test -n "$ac_init_help"; then 1276if test -n "$ac_init_help"; then
1277 case $ac_init_help in 1277 case $ac_init_help in
1278 short | recursive ) echo "Configuration of pkgtasks-1 1.10:";; 1278 short | recursive ) echo "Configuration of pkgtasks-1 1.13:";;
1279 esac 1279 esac
1280 cat <<\_ACEOF 1280 cat <<\_ACEOF
1281 1281
1282Optional Features: 1282Optional Features:
1283 --disable-option-checking ignore unrecognized --enable/--with options 1283 --disable-option-checking ignore unrecognized --enable/--with options
1284 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 1284 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1285 --enable-FEATURE[=ARG] include FEATURE [ARG=yes] 1285 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1286 --enable-silent-rules less verbose build output (undo: "make V=1") 1286 --enable-silent-rules less verbose build output (undo: "make V=1")
1287 --disable-silent-rules verbose build output (undo: "make V=0") 1287 --disable-silent-rules verbose build output (undo: "make V=0")
1288 1288
1289Some influential environment variables: 1289Some influential environment variables:
1290 POSIX_SHELL Location of the POSIX shell interpreter to use 1290 POSIX_SHELL Location of the POSIX shell interpreter to use
1291 1291
@@ -1345,44 +1345,44 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_ @@ -1345,44 +1345,44 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_
1345 elif test -f "$ac_srcdir/configure"; then 1345 elif test -f "$ac_srcdir/configure"; then
1346 echo && 1346 echo &&
1347 $SHELL "$ac_srcdir/configure" --help=recursive 1347 $SHELL "$ac_srcdir/configure" --help=recursive
1348 else 1348 else
1349 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 1349 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1350 fi || ac_status=$? 1350 fi || ac_status=$?
1351 cd "$ac_pwd" || { ac_status=$?; break; } 1351 cd "$ac_pwd" || { ac_status=$?; break; }
1352 done 1352 done
1353fi 1353fi
1354 1354
1355test -n "$ac_init_help" && exit $ac_status 1355test -n "$ac_init_help" && exit $ac_status
1356if $ac_init_version; then 1356if $ac_init_version; then
1357 cat <<\_ACEOF 1357 cat <<\_ACEOF
1358pkgtasks-1 configure 1.10 1358pkgtasks-1 configure 1.13
1359generated by GNU Autoconf 2.69 1359generated by GNU Autoconf 2.69
1360 1360
1361Copyright (C) 2012 Free Software Foundation, Inc. 1361Copyright (C) 2012 Free Software Foundation, Inc.
1362This configure script is free software; the Free Software Foundation 1362This configure script is free software; the Free Software Foundation
1363gives unlimited permission to copy, distribute and modify it. 1363gives unlimited permission to copy, distribute and modify it.
1364_ACEOF 1364_ACEOF
1365 exit 1365 exit
1366fi 1366fi
1367 1367
1368## ------------------------ ## 1368## ------------------------ ##
1369## Autoconf initialization. ## 1369## Autoconf initialization. ##
1370## ------------------------ ## 1370## ------------------------ ##
1371cat >config.log <<_ACEOF 1371cat >config.log <<_ACEOF
1372This file contains any messages produced by compilers while 1372This file contains any messages produced by compilers while
1373running configure, to aid debugging if configure makes a mistake. 1373running configure, to aid debugging if configure makes a mistake.
1374 1374
1375It was created by pkgtasks-1 $as_me 1.10, which was 1375It was created by pkgtasks-1 $as_me 1.13, which was
1376generated by GNU Autoconf 2.69. Invocation command line was 1376generated by GNU Autoconf 2.69. Invocation command line was
1377 1377
1378 $ $0 $@ 1378 $ $0 $@
1379 1379
1380_ACEOF 1380_ACEOF
1381exec 5>>config.log 1381exec 5>>config.log
1382{ 1382{
1383cat <<_ASUNAME 1383cat <<_ASUNAME
1384## --------- ## 1384## --------- ##
1385## Platform. ## 1385## Platform. ##
1386## --------- ## 1386## --------- ##
1387 1387
1388hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` 1388hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
@@ -2232,27 +2232,27 @@ fi @@ -2232,27 +2232,27 @@ fi
2232 2232
2233# test whether we have cygpath 2233# test whether we have cygpath
2234if test -z "$CYGPATH_W"; then 2234if test -z "$CYGPATH_W"; then
2235 if (cygpath --version) >/dev/null 2>/dev/null; then 2235 if (cygpath --version) >/dev/null 2>/dev/null; then
2236 CYGPATH_W='cygpath -w' 2236 CYGPATH_W='cygpath -w'
2237 else 2237 else
2238 CYGPATH_W=echo 2238 CYGPATH_W=echo
2239 fi 2239 fi
2240fi 2240fi
2241 2241
2242 2242
2243# Define the identity of the package. 2243# Define the identity of the package.
2244 PACKAGE='pkgtasks-1' 2244 PACKAGE='pkgtasks-1'
2245 VERSION='1.10' 2245 VERSION='1.13'
2246 2246
2247 2247
2248cat >>confdefs.h <<_ACEOF 2248cat >>confdefs.h <<_ACEOF
2249#define PACKAGE "$PACKAGE" 2249#define PACKAGE "$PACKAGE"
2250_ACEOF 2250_ACEOF
2251 2251
2252 2252
2253cat >>confdefs.h <<_ACEOF 2253cat >>confdefs.h <<_ACEOF
2254#define VERSION "$VERSION" 2254#define VERSION "$VERSION"
2255_ACEOF 2255_ACEOF
2256 2256
2257# Some tools Automake needs. 2257# Some tools Automake needs.
2258 2258
@@ -3068,27 +3068,27 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr @@ -3068,27 +3068,27 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr
3068 3068
3069exec 6>&1 3069exec 6>&1
3070## ----------------------------------- ## 3070## ----------------------------------- ##
3071## Main body of $CONFIG_STATUS script. ## 3071## Main body of $CONFIG_STATUS script. ##
3072## ----------------------------------- ## 3072## ----------------------------------- ##
3073_ASEOF 3073_ASEOF
3074test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 3074test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
3075 3075
3076cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 3076cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
3077# Save the log message, to keep $0 and so on meaningful, and to 3077# Save the log message, to keep $0 and so on meaningful, and to
3078# report actual input values of CONFIG_FILES etc. instead of their 3078# report actual input values of CONFIG_FILES etc. instead of their
3079# values after options handling. 3079# values after options handling.
3080ac_log=" 3080ac_log="
3081This file was extended by pkgtasks-1 $as_me 1.10, which was 3081This file was extended by pkgtasks-1 $as_me 1.13, which was
3082generated by GNU Autoconf 2.69. Invocation command line was 3082generated by GNU Autoconf 2.69. Invocation command line was
3083 3083
3084 CONFIG_FILES = $CONFIG_FILES 3084 CONFIG_FILES = $CONFIG_FILES
3085 CONFIG_HEADERS = $CONFIG_HEADERS 3085 CONFIG_HEADERS = $CONFIG_HEADERS
3086 CONFIG_LINKS = $CONFIG_LINKS 3086 CONFIG_LINKS = $CONFIG_LINKS
3087 CONFIG_COMMANDS = $CONFIG_COMMANDS 3087 CONFIG_COMMANDS = $CONFIG_COMMANDS
3088 $ $0 $@ 3088 $ $0 $@
3089 3089
3090on `(hostname || uname -n) 2>/dev/null | sed 1q` 3090on `(hostname || uname -n) 2>/dev/null | sed 1q`
3091" 3091"
3092 3092
3093_ACEOF 3093_ACEOF
3094 3094
@@ -3121,27 +3121,27 @@ Usage: $0 [OPTION]... [TAG]... @@ -3121,27 +3121,27 @@ Usage: $0 [OPTION]... [TAG]...
3121 --recheck update $as_me by reconfiguring in the same conditions 3121 --recheck update $as_me by reconfiguring in the same conditions
3122 --file=FILE[:TEMPLATE] 3122 --file=FILE[:TEMPLATE]
3123 instantiate the configuration file FILE 3123 instantiate the configuration file FILE
3124 3124
3125Configuration files: 3125Configuration files:
3126$config_files 3126$config_files
3127 3127
3128Report bugs to <jlam@NetBSD.org>." 3128Report bugs to <jlam@NetBSD.org>."
3129 3129
3130_ACEOF 3130_ACEOF
3131cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 3131cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
3132ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" 3132ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
3133ac_cs_version="\\ 3133ac_cs_version="\\
3134pkgtasks-1 config.status 1.10 3134pkgtasks-1 config.status 1.13
3135configured by $0, generated by GNU Autoconf 2.69, 3135configured by $0, generated by GNU Autoconf 2.69,
3136 with options \\"\$ac_cs_config\\" 3136 with options \\"\$ac_cs_config\\"
3137 3137
3138Copyright (C) 2012 Free Software Foundation, Inc. 3138Copyright (C) 2012 Free Software Foundation, Inc.
3139This config.status script is free software; the Free Software Foundation 3139This config.status script is free software; the Free Software Foundation
3140gives unlimited permission to copy, distribute and modify it." 3140gives unlimited permission to copy, distribute and modify it."
3141 3141
3142ac_pwd='$ac_pwd' 3142ac_pwd='$ac_pwd'
3143srcdir='$srcdir' 3143srcdir='$srcdir'
3144INSTALL='$INSTALL' 3144INSTALL='$INSTALL'
3145MKDIR_P='$MKDIR_P' 3145MKDIR_P='$MKDIR_P'
3146AWK='$AWK' 3146AWK='$AWK'
3147test -n "\$AWK" || AWK=awk 3147test -n "\$AWK" || AWK=awk

cvs diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/configure.ac (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/configure.ac 2017/06/03 23:54:53 1.2
+++ pkgsrc/pkgtools/pkgtasks/files/configure.ac 2017/08/10 05:38:30 1.3
@@ -16,27 +16,27 @@ dnl @@ -16,27 +16,27 @@ dnl
16dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17dnl ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17dnl ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20dnl BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20dnl BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26dnl POSSIBILITY OF SUCH DAMAGE. 26dnl POSSIBILITY OF SUCH DAMAGE.
27dnl 27dnl
28 28
29AC_INIT([pkgtasks-1], [1.10], [jlam@NetBSD.org]) 29AC_INIT([pkgtasks-1], [1.13], [jlam@NetBSD.org])
30 30
31 31
32AC_CONFIG_AUX_DIR([build-aux]) 32AC_CONFIG_AUX_DIR([build-aux])
33AC_CONFIG_SRCDIR([load.subr]) 33AC_CONFIG_SRCDIR([load.subr])
34AC_CONFIG_FILES([Makefile]) 34AC_CONFIG_FILES([Makefile])
35 35
36 36
37AM_INIT_AUTOMAKE([foreign subdir-objects -Wall]) 37AM_INIT_AUTOMAKE([foreign subdir-objects -Wall])
38 38
39 39
40AC_ARG_VAR([POSIX_SHELL], [Location of the POSIX shell interpreter to use]) 40AC_ARG_VAR([POSIX_SHELL], [Location of the POSIX shell interpreter to use])
41if test "${POSIX_SHELL}" = ""; then 41if test "${POSIX_SHELL}" = ""; then
42 AC_PATH_PROGS(POSIX_SHELL, [ksh bash sh]) 42 AC_PATH_PROGS(POSIX_SHELL, [ksh bash sh])

File Added: pkgsrc/pkgtools/pkgtasks/files/NEWS.md
Package Tasks
=============


Changes in version 1.13
-----------------------
**Released on 2017-08-08.**

* Make the output messages for the `groups` and `users` tasks easier
  to understand by making them slightly more verobse and changing
  the formatting.


Changes in version 1.12
-----------------------
**Released on 2017-08-06.**

* Use `${GTK_UPDATE_ICON_CACHE}` as the default command to update
  the GTK+ icon theme caches in the `icon_themes` task,
  defaulting to `true` if it is not set in the environment.  Also
  force an update of the icon caches from the `postremove`
  meta-task in case the icon theme is a composite of several
  packages.  This makes the behavior more compatible with **pkgsrc**.

* Bug fixes.


Changes in version 1.11
-----------------------
**Released on 2017-07-31.**

* Invoke `install-info` in a different way that matches how it is
  typically invoked in GNU projects.

* Add `icon_themes` task to update GTK+ icon theme caches.

* Bug fixes.


Changes in version 1.10
-----------------------
**Released on 2017-06-03.**

* Modify `Makefile.am` to always use the same pathname to refer to a
  built object.  This fixes the dependency graph in the case where
  `make` is invoked to run with multiple jobs.

* Change the output of the `directories` and `files` tasks to be
  less verbose in the most common case where a directory is
  created or a file is copied and permissions are immediately set
  on the directory or file.


Changes in version 1.9
----------------------
**Released on 2017-05-31.**

* Adapt `directories` and `files` tasks to unconditionally set
  permissions when new objects are created, and to not throw
  errors if the object is missing because it wasn't created in
  an earlier step.  This makes the behavior more compatible with
  **pkgsrc**.

* Depending on the values of certain environment variables, certain
  *add* or *remove* actions may not actually perform operations that
  change the system and still return successfully.  Always run the
  "check" actions for the corresponding main action so that any
  warning messages intended for the user are written to standard
  output.

* Make the `shlibs` task output more descriptive.


Changes in version 1.8
----------------------
**Released on 2017-05-29.**

* Change the output of the actions taken by each task, by being
  slightly more brief, and also accepting an environment variable
  `${TASK_MSG}` as the prefix string for each line of output.

* Bug fixes.


Changes in version 1.7
----------------------
**Released on 2017-05-29.**

* Back out two changes to make **pkgtasks** more compatible with
  what **pkgsrc** needs:

  - Don't use `OCAML_FINDLIB_REGISTER` environment variable since
    it is a package-settable variable in **pkgsrc**, not a user-
    settable one.

  - Don't use `PKG_CONFIG_PERMS` environment variable in the
    `permissions` task, which matches its usage in **pkgrsc**


Changes in version 1.6
----------------------
**Released on 2017-05-27.**

* Adjust `fonts` task to run `mkfontdir` on TTF and Type1 font
  directories automatically.

* Rename control variable `PKG_RCD_SCRIPTS` to `PKG_INIT_SCRIPTS`.
  This generalizes the variable name to allow for other init
  systems.

* Check `${PKG_CONFIG_PERMS}` in the `permissions` task.

* Make the `shlibs` task accept `LDCONFIG_ADD_CMD` and
  `LDCONFIG_REMOVE_CMD` as separate command lines to update the
  shared library cache depending on whether the task is called to
  *add* or *remove*.  The default action is still to invoke a bare
  `${LDCONFIG}` command.

* Adjust the `shlibs` task to accept standard input and to only
  update the cache if there are lines of the correct format.

* Fix `preinstall` meta-task to fail properly if groups and/or
  users don't exist.

* Add `platform` task to write the name of the platform or
  operating system to standard output.

* Automatically load the platform-specific module with the correct
  `platform_groupadd` and `platform_useradd` functions.

* Bug fixes and cleanup.


Changes in version 1.5
----------------------
**Released on 2017-05-17.**

* Support `~[string]` (tilde string) in a version string to sort
  before a release version, e.g., 1.2~rc1 sorts before 1.2.

* When invoking a meta-task, only be verbose when invoking tasks
  that typically affect system files and directories.  This
  makes the output a bit more friendly for the typicaly user,
  who is no longer bombarded with every trivial GNU info file
  registration.

* Bug fixes.


Changes in version 1.4
----------------------
**Released on 2017-05-14.**

* Allow duplicate logging of task output to a file through the
  `echo` task.

* Added `tee` task to duplicate standard input to standard output
  and into additional files.


Changes in version 1.3
----------------------
**Released on 2017-05-13.**

* Generalized refcount API so the refcount-file implementation
  may be deprecated in the future.

* Added option to suppress duplicate lines to the `sort` task.

* Added `valid_options` task to simplify checking for valid flags.

* Added `function` task as a generic hook for user-written tasks
  into the `preinstall`, `postinstall`, `preremove`, and
  `postremove` meta-tasks.

* Bug fixes.


Changes in version 1.2
----------------------
**Released on 2017-05-07.**

* Be more consistent with using `maketemp` to generate internal
  temporary files and directories.

* Added the `sort` task to sort lines from standard input.

* Sort input when performing `add` action of `directories` task,
  and reverse sort when performing `remove` action.  This causes
  path components to be created and removed in the correct order.


Changes in version 1.1
----------------------

**Released on 2017-05-05**

* Added the `which` task to locate a program in the search path.

* Changed the `fonts` task to search for indexing commands in the
  search path before falling back to defaults.  This makes the
  task more resilient to differences in how the X11 directories
  are laid out across different systems.

* Be more consistent with preserving standard error from commands
  used to perform tasks so that errors are visible for logging and
  debugging purposes.


Changes in version 1.0
----------------------

**Released on 2017-05-03**

* Initial release of pkgtasks-1-1.0.

File Added: pkgsrc/pkgtools/pkgtasks/files/icon_themes.subr
# Copyright (c) 2017 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Johnny C. Lam.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# NAME
#	icon_themes.subr -- icon theme cache management for packages
#
# SYNOPSIS
#	task_icon_themes [-s] add | remove <stage>
#
# DESCRIPTION
#	The task_icon_themes function supports two actions, "add" and
#	"remove", that will add or remove the GTK+ icon caches from the
#	theme directories.
#
#	The available options are as follows:
#
#	-s	Silent; don't write to standard output.
#
#	The task_icon_themes function reads standard input line by line
#	and looks for lines of the form:
#
#	    # ICON_THEME: <themedir>
#
#	If the path to the theme directory is relative, then it is assumed
#	to be relative to ${PKG_PREFIX}/share/icons.
#
# RETURN VALUES
#	Returns 0 if the action is successful for all icon themes, and >0
#	if an error occurs.
#
# ENVIRONMENT
#	The following variables are used if they are set:
#
#	GTK_UPDATE_ICON_CACHE
#		The name or path to the GTK+ command to update the icon
#		caches.  This is the fall-through default command if
#		neither of the other two gtk-update-icon-cache(1)
#		commands exist on the system.
#
#	GTK2_UPDATE_ICON_CACHE
#		The name or path to the GTK+-2.x command to update the
#		icon caches.
#
#	GTK3_UPDATE_ICON_CACHE
#		The name or path to the GTK+-3.x command to update the
#		icon caches.
#
#	PKGNAME
#		The name of the package.
#
#	PKG_DESTDIR
#		A "destdir" prefix that is prepended to all filesystem
#		paths.  The default value is the empty string.
#
#	PKG_PREFIX
#		The installation prefix of the package.  The default is
#		"/usr/pkg".
#
#	RM	The name or path to the rm(1) utility.
#
#	TASK_MSG
#		String prepended to all normal message written to
#		standard output.
#

__task_icon_themes__="yes"

task_load echo
task_load which

task_icon_themes()
{
	: ${RM:=rm}

	: ${PKG_PREFIX:=/usr/pkg}
	: ${PKGNAME:=${0##*/}}
	: ${TASK_MSG:=""}

	local arg
	local echo="task_echo"
	local OPTIND=1
	while getopts ":s" arg "$@"; do
		case $arg in
		s)	echo=":" ;;
		*)	return 127 ;;
		esac
	done
	shift $(( ${OPTIND} - 1 ))
	[ $# -gt 0 ] || return 127

	local action="$1"; shift
	local stage="$1"

	case $action in
	add|remove)
		: "valid action" ;;
	*)	return 0 ;;
	esac

	# Guard against ${PKG_PREFIX} == "/".
	local prefix
	case ${PKG_PREFIX}/ in
	//)	prefix= ;;
	*)	prefix=${PKG_PREFIX} ;;
	esac

	local result=0
	local hash tag themedir
	local theme cache update_cmd
	while read hash tag themedir; do
		# Filter for "# ICON_THEME:"
		case $hash/$tag in
		"#/ICON_THEME:")
			: "use this line" ;;
		*)	continue ;;
		esac

		# Canonicalize paths.
		case $themedir in
		"")	# skip lines without required args
			continue ;;
		[!/]*)	themedir="$prefix/share/icons/$themedir" ;;
		esac
		themedir="${PKG_DESTDIR}$themedir"
		theme="$themedir/index.theme"
		cache="$themedir/icon-theme.cache"

		case "$action,$stage" in
		remove,postremove)
			: "avoid double removal of icon caches" ;;
		remove,*)
			if [ ! -f "$cache" ]; then
				$echo "${TASK_MSG}> icon cache already removed: $themedir"
			elif ${RM} -f "$cache"; then
				$echo "${TASK_MSG}> icon cache removed: $themedir"
			else
				$echo "${TASK_MSG}! icon cache not removed: $themedir"
				result=1
			fi ;;
		esac

		# Update the icon caches during "add" action, but also during
		# "remove" action at "postremove" stage if the theme directories
		# still exist.
		#
		case "$action,$stage" in
		add,*|remove,postremove)
			# Set the command used to update the icon caches.
			_task_icon_themes_cache_update_cmd
			if [ "$__task_icon_themes_update_cmd__" != "missing" ]; then
				update_cmd="$__task_icon_themes_update_cmd__"
			fi
			: ${update_cmd:=${GTK_UPDATE_ICON_CACHE:-true}}

			if [ ! -f "$theme" ]; then
				case $action in
				add)	$echo "${TASK_MSG}! icon theme missing: $themedir"
					result=1 ;;
				remove)	: "silently skip updating" ;;
				esac
			elif [ -z "$update_cmd" ]; then
				$echo "${TASK_MSG}! icon theme not cached - missing command: $themedir"
				result=1
			elif $update_cmd -f -q "$themedir"; then
				$echo "${TASK_MSG}> icon theme cached: $themedir"
			else
				$echo "${TASK_MSG}! icon theme not cached: $themedir"
				result=1
			fi ;;
		esac
	done
	return $result
}

_task_icon_themes_cache_update_cmd()
{
	: ${GTK2_UPDATE_ICON_CACHE:=gtk2-update-icon-cache}
	: ${GTK3_UPDATE_ICON_CACHE:=gtk-update-icon-cache}

	# Cache gtk-update-icon-cache(1) location.
	if [ -z "$__task_icon_themes_update_cmd__" ]; then
		local cmd
		for cmd in \
			"${GTK3_UPDATE_ICON_CACHE}" \
			"${GTK2_UPDATE_ICON_CACHE}"
		do
			[ -n "$cmd" ] || continue
			__task_icon_themes_update_cmd__=$( task_which "$cmd" )
			[ -z "$__task_icon_themes_update_cmd__" ] || break
		done
		[ -n "$__task_icon_themes_update_cmd__" ] ||
			__task_icon_themes_update_cmd__="missing"
	fi
}

# Static variable for the path to the command that updates the icon cache.
__task_icon_themes_update_cmd__=

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/fonts.subr (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/fonts.subr 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/fonts.subr 2017/08/10 05:38:30 1.2
@@ -80,26 +80,29 @@ @@ -80,26 +80,29 @@
80# PKG_UPDATE_FONTS_DB 80# PKG_UPDATE_FONTS_DB
81# If ${PKG_UPDATE_FONTS_DB} is a "truthy" value, then the 81# If ${PKG_UPDATE_FONTS_DB} is a "truthy" value, then the
82# "add" and "remove" actions are allowed to update the font 82# "add" and "remove" actions are allowed to update the font
83# indices files. 83# indices files.
84# 84#
85# RM The name or path to the rm(1) utility. 85# RM The name or path to the rm(1) utility.
86# 86#
87# RMDIR The name or path to the rmdir(1) utility. 87# RMDIR The name or path to the rmdir(1) utility.
88# 88#
89# TASK_MSG 89# TASK_MSG
90# String prepended to all normal message written to 90# String prepended to all normal message written to
91# standard output. 91# standard output.
92# 92#
 93# TYPE1INST
 94# The name or path to the type1inst(1) utility.
 95#
93# TTMKFDIR 96# TTMKFDIR
94# The name or path to the ttmkfdir(1) utility. 97# The name or path to the ttmkfdir(1) utility.
95# 98#
96# X11_ENCODINGSDIR 99# X11_ENCODINGSDIR
97# The directory containing font-encoding information files. 100# The directory containing font-encoding information files.
98# 101#
99 102
100__task_fonts__="yes" 103__task_fonts__="yes"
101__task_fonts_init__="_task_fonts_init" 104__task_fonts_init__="_task_fonts_init"
102 105
103task_load cleanup 106task_load cleanup
104task_load echo 107task_load echo
105task_load dirwalk 108task_load dirwalk

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/groups.subr (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/groups.subr 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/groups.subr 2017/08/10 05:38:30 1.2
@@ -147,61 +147,61 @@ task_groups() @@ -147,61 +147,61 @@ task_groups()
147 147
148 if [ -n "$gid" ]; then 148 if [ -n "$gid" ]; then
149 msg="$group (gid = $gid)" 149 msg="$group (gid = $gid)"
150 else 150 else
151 msg="$group" 151 msg="$group"
152 fi 152 fi
153 153
154 line_result=0 154 line_result=0
155 case $action in 155 case $action in
156 add) if task_refcount add groups "$group"; then 156 add) if task_refcount add groups "$group"; then
157 task_group_exists "$group" "$gid" 157 task_group_exists "$group" "$gid"
158 case $? in 158 case $? in
159 0) # $group exists and has gid $gid 159 0) # $group exists and has gid $gid
160 $echo "${TASK_MSG}! group already exists: $msg" ;; 160 $echo "${TASK_MSG}! group already exists: $group" ;;
161 1) # neither $group nor $gid exist 161 1) # neither $group nor $gid exist
162 if [ -z "$create" ]; then 162 if [ -z "$create" ]; then
163 $echo "${TASK_MSG}! group creation skipped: $msg" 163 $echo "${TASK_MSG}! group creation skipped: $msg"
164 elif task_addgroup "$group" "$gid"; then 164 elif task_addgroup "$group" "$gid"; then
165 $echo "${TASK_MSG}> group created: $msg" 165 $echo "${TASK_MSG}> group created: $msg"
166 # Keep track of groups added in case of error later. 166 # Keep track of groups added in case of error later.
167 task_quote "$group" 167 task_quote "$group"
168 __task_groups_error__="$__task_groups_error__ $_quoted" 168 __task_groups_error__="$__task_groups_error__ $_quoted"
169 else 169 else
170 $echo "${TASK_MSG}! group not created: $msg" 170 $echo "${TASK_MSG}! group not created: $msg"
171 line_result=1 171 line_result=1
172 fi ;; 172 fi ;;
173 2) $echo "${TASK_MSG}! group conflict: $msg" 173 2) $echo "${TASK_MSG}! group conflict: $msg"
174 result=1 174 result=1
175 break ;; 175 break ;;
176 *) $echo "${TASK_MSG}! group not created: $msg" 176 *) $echo "${TASK_MSG}! group not created: $msg"
177 line_result=1 ;; 177 line_result=1 ;;
178 esac 178 esac
179 else 179 else
180 # add refcount failed; skip to next line 180 # add refcount failed; skip to next line
181 $echo "${TASK_MSG}! refcount add failure: groups $msg" 181 $echo "${TASK_MSG}! refcount add failure: groups $group"
182 result=1 182 result=1
183 continue 183 continue
184 fi ;; 184 fi ;;
185 remove) if task_refcount remove groups "$group"; then 185 remove) if task_refcount remove groups "$group"; then
186 if task_refcount exists groups "$group"; then 186 if task_refcount exists groups "$group"; then
187 : "refcount is not zero" 187 : "refcount is not zero"
188 else 188 else
189 # delete the reference count 189 # delete the reference count
190 task_refcount delete groups "$group" 190 task_refcount delete groups "$group"
191 fi 191 fi
192 else 192 else
193 # remove refcount failed 193 # remove refcount failed
194 $echo "${TASK_MSG}! refcount remove failure: groups $msg" 194 $echo "${TASK_MSG}! refcount remove failure: groups $group"
195 line_result=1 195 line_result=1
196 fi ;; 196 fi ;;
197 check-add) 197 check-add)
198 if task_group_exists "$group" "$gid"; then 198 if task_group_exists "$group" "$gid"; then
199 : "group already exists" 199 : "group already exists"
200 else 200 else
201 task_echo "!!! INFO: ${PKGNAME}: Create group: $msg" 201 task_echo "!!! INFO: ${PKGNAME}: Create group: $msg"
202 line_result=1 202 line_result=1
203 fi ;; 203 fi ;;
204 check-remove) 204 check-remove)
205 if task_group_exists "$group" "$gid"; then 205 if task_group_exists "$group" "$gid"; then
206 task_echo "!!! INFO: ${PKGNAME}: Remove group if unused: $group" 206 task_echo "!!! INFO: ${PKGNAME}: Remove group if unused: $group"
207 line_result=1 207 line_result=1

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/info_files.subr (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/info_files.subr 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/info_files.subr 2017/08/10 05:38:30 1.2
@@ -154,43 +154,45 @@ task_info_files() @@ -154,43 +154,45 @@ task_info_files()
154 154
155 if [ ! -f "$file" ]; then 155 if [ ! -f "$file" ]; then
156 $echo "${TASK_MSG}! info file missing: $file" 156 $echo "${TASK_MSG}! info file missing: $file"
157 result=1 157 result=1
158 continue 158 continue
159 fi 159 fi
160 160
161 index="$infodir/dir" 161 index="$infodir/dir"
162 task_quote "$index" 162 task_quote "$index"
163 __task_info_files_indices__="$__task_info_files_indices__ $quoted" 163 __task_info_files_indices__="$__task_info_files_indices__ $quoted"
164 164
165 line_result=0 165 line_result=0
166 case $action in 166 case $action in
167 add) # Remove any existing file entry from the "dir" file, even for 167 add) # Remove any existing file entry from the "dir" file
168 # the "add" action to guard against a duplicate entry when we 168 # to guard against a duplicate entry when we add later.
169 # add later. 169 # Suppress the output since we don't care if the removal
 170 # was successful or not.
170 # 171 #
171 if [ -f "$index" ]; then 172 ${INSTALL_INFO} --info-dir="$infodir" --delete "$file" >/dev/null 2>&1
172 ${INSTALL_INFO} --delete "$file" "$index" >/dev/null 2>&1 
173 fi 
174 # Add the file entry to the "dir" file. 173 # Add the file entry to the "dir" file.
175 [ -d "$infodir" ] || task_makedir "$infodir" 174 [ -d "$infodir" ] || task_makedir "$infodir" 2>/dev/null
176 ${INSTALL_INFO} "$file" "$index" || line_result=1 175 [ -d "$infodir" ] || line_result=1
 176 if [ $line_result -eq 0 ]; then
 177 ${INSTALL_INFO} --info-dir="$infodir" "$file" || line_result=1
 178 fi
177 if [ $line_result -eq 0 ]; then 179 if [ $line_result -eq 0 ]; then
178 $echo "${TASK_MSG}> info file registered: $file" 180 $echo "${TASK_MSG}> info file registered: $file"
179 else 181 else
180 $echo "${TASK_MSG}! info file not registered: $file" 182 $echo "${TASK_MSG}! info file not registered: $file"
181 fi ;; 183 fi ;;
182 remove) if [ -f "$index" ]; then 184 remove) if [ -f "$index" ]; then
183 ${INSTALL_INFO} --delete "$file" "$index" || line_result=1 185 ${INSTALL_INFO} --info-dir="$infodir" --delete "$file" || line_result=1
184 if [ $line_result -eq 0 ]; then 186 if [ $line_result -eq 0 ]; then
185 $echo "${TASK_MSG}> info file unregistered: $file" 187 $echo "${TASK_MSG}> info file unregistered: $file"
186 else 188 else
187 $echo "${TASK_MSG}! info file not unregistered: $file" 189 $echo "${TASK_MSG}! info file not unregistered: $file"
188 fi 190 fi
189 else 191 else
190 $echo "${TASK_MSG}> info file already unregistered: $file" 192 $echo "${TASK_MSG}> info file already unregistered: $file"
191 fi ;; 193 fi ;;
192 esac 194 esac
193 [ $line_result -eq 0 ] || result=1 195 [ $line_result -eq 0 ] || result=1
194 done 196 done
195 197
196 _task_info_files_cleanup $silent 198 _task_info_files_cleanup $silent

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/load.subr (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/load.subr 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/load.subr 2017/08/10 05:38:30 1.2
@@ -1,14 +1,13 @@ @@ -1,14 +1,13 @@
1# Copyright (c) 2017 The NetBSD Foundation, Inc. 
2# All rights reserved. 1# All rights reserved.
3# 2#
4# This code is derived from software contributed to The NetBSD Foundation 3# This code is derived from software contributed to The NetBSD Foundation
5# by Johnny C. Lam. 4# by Johnny C. Lam.
6# 5#
7# Redistribution and use in source and binary forms, with or without 6# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions 7# modification, are permitted provided that the following conditions
9# are met: 8# are met:
10# 1. Redistributions of source code must retain the above copyright 9# 1. Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer. 10# notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright 11# 2. Redistributions in binary form must reproduce the above copyright
13# notice, this list of conditions and the following disclaimer in the 12# notice, this list of conditions and the following disclaimer in the
14# documentation and/or other materials provided with the distribution. 13# documentation and/or other materials provided with the distribution.

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/ocaml_findlib.subr (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/ocaml_findlib.subr 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/ocaml_findlib.subr 2017/08/10 05:38:30 1.2
@@ -92,26 +92,27 @@ @@ -92,26 +92,27 @@
92# RM The name or path to the rm(1) utility. 92# RM The name or path to the rm(1) utility.
93# 93#
94# TASK_MSG 94# TASK_MSG
95# String prepended to all normal message written to 95# String prepended to all normal message written to
96# standard output. 96# standard output.
97# 97#
98 98
99__task_ocaml_findlib__="yes" 99__task_ocaml_findlib__="yes"
100__task_ocaml_findlib_init__="_task_ocaml_findlib_init" 100__task_ocaml_findlib_init__="_task_ocaml_findlib_init"
101 101
102task_load cleanup 102task_load cleanup
103task_load echo 103task_load echo
104task_load lock 104task_load lock
 105task_load makedir
105task_load maketemp 106task_load maketemp
106task_load match 107task_load match
107task_load quote 108task_load quote
108 109
109task_ocaml_findlib() 110task_ocaml_findlib()
110{ 111{
111 : ${MV:=mv} 112 : ${MV:=mv}
112 113
113 : ${OCAML_SITELIB:=lib/ocaml/site-lib} 114 : ${OCAML_SITELIB:=lib/ocaml/site-lib}
114 : ${PKG_PREFIX:=/usr/pkg} 115 : ${PKG_PREFIX:=/usr/pkg}
115 : ${PKGNAME:=${0##*/}} 116 : ${PKGNAME:=${0##*/}}
116 : ${TASK_MSG:=""} 117 : ${TASK_MSG:=""}
117 118
@@ -163,35 +164,41 @@ task_ocaml_findlib() @@ -163,35 +164,41 @@ task_ocaml_findlib()
163 esac 164 esac
164 165
165 # Canonicalize paths. 166 # Canonicalize paths.
166 case $libdir in 167 case $libdir in
167 "") # skip lines without any required args 168 "") # skip lines without any required args
168 continue ;; 169 continue ;;
169 [!/]*) libdir="$sitelib/$libdir" ;; 170 [!/]*) libdir="$sitelib/$libdir" ;;
170 esac 171 esac
171 case $ldconf in 172 case $ldconf in
172 "") ldconf="$prefix/lib/ocaml/ld.conf" ;; 173 "") ldconf="$prefix/lib/ocaml/ld.conf" ;;
173 [!/]*) ldconf="$prefix/$ldconf" ;; 174 [!/]*) ldconf="$prefix/$ldconf" ;;
174 esac 175 esac
175 ldconf="${PKG_DESTDIR}$ldconf" 176 ldconf="${PKG_DESTDIR}$ldconf"
 177 local ldconfdir=${ldconf%/*}
176 178
177 line_result=0 179 line_result=0
178 case $action in 180 case $action in
179 add|remove) 181 add|remove)
180 lock="$ldconf.lock" 182 # Ensure that the ld.conf directory exists.
181 task_quote "$lock" 183 [ -d "$ldconfdir" ] || task_makedir "$ldconfdir" 2>/dev/null
182 lock_quoted=$quoted 184 [ -d "$ldconfdir" ] || line_result=1
183 __task_ocaml_findlib_locks__="$quoted $__task_ocaml_findlib_locks__" 185 if [ $line_result -eq 0 ]; then
184 task_lock "$lock" || line_result=1 186 lock="$ldconf.lock"
 187 task_quote "$lock"
 188 lock_quoted=$quoted
 189 __task_ocaml_findlib_locks__="$quoted $__task_ocaml_findlib_locks__"
 190 task_lock "$lock" || line_result=1
 191 fi ;;
185 esac 192 esac
186 if [ $line_result -eq 0 ]; then 193 if [ $line_result -eq 0 ]; then
187 case $action in 194 case $action in
188 add) if [ -f "$ldconf" ] && task_match -qw "$libdir" < $ldconf; then 195 add) if [ -f "$ldconf" ] && task_match -qw "$libdir" < $ldconf; then
189 $echo "${TASK_MSG}! path already added: $libdir" 196 $echo "${TASK_MSG}! path already added: $libdir"
190 else 197 else
191 temp=$( task_maketemp "$ldconf.pkgtasks.XXXXXXXXXX" ) 198 temp=$( task_maketemp "$ldconf.pkgtasks.XXXXXXXXXX" )
192 if [ -n "$temp" ]; then 199 if [ -n "$temp" ]; then
193 task_quote "$temp" 200 task_quote "$temp"
194 temp_quoted="$quoted" 201 temp_quoted="$quoted"
195 __task_ocaml_findlib_temps__="$__task_ocaml_findlib_temps__ $temp_quoted" 202 __task_ocaml_findlib_temps__="$__task_ocaml_findlib_temps__ $temp_quoted"
196 if [ ! -f "$ldconf" ]; then 203 if [ ! -f "$ldconf" ]; then
197 echo "$libdir" 204 echo "$libdir"

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/postinstall.subr (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/postinstall.subr 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/postinstall.subr 2017/08/10 05:38:30 1.2
@@ -30,69 +30,73 @@ @@ -30,69 +30,73 @@
30# 30#
31# SYNOPSIS 31# SYNOPSIS
32# task_postinstall <datafile> 32# task_postinstall <datafile>
33# 33#
34# DESCRIPTION 34# DESCRIPTION
35# The task_postinstall function performs actions that SHOULD occur 35# The task_postinstall function performs actions that SHOULD occur
36# AFTER the package files are installed into their final location 36# AFTER the package files are installed into their final location
37# for the installation: 37# for the installation:
38# 38#
39# o Copy configuration files into correct locations. 39# o Copy configuration files into correct locations.
40# o Set special permissions on package files and directories. 40# o Set special permissions on package files and directories.
41# o Rebuild the system run-time library search path database. 41# o Rebuild the system run-time library search path database.
42# o Update fonts databases. 42# o Update fonts databases.
 43# o Create caches within GTK+ icon theme directories.
43# o Register shells in the system shells database. 44# o Register shells in the system shells database.
44# o Register GNU info files. 45# o Register GNU info files.
45# o Update OCaml module run-time library search path database. 46# o Update OCaml module run-time library search path database.
46# 47#
47# The datafile contains lines of the form: 48# The datafile contains lines of the form:
48# 49#
49# # <keyword>: <arg> ... 50# # <keyword>: <arg> ...
50# 51#
51# These lines are used as input to the various script functions. 52# These lines are used as input to the various script functions.
52# 53#
53# RETURN VALUES 54# RETURN VALUES
54# Returns 0 on success, and >0 if an error occurs. 55# Returns 0 on success, and >0 if an error occurs.
55# 56#
56 57
57__task_postinstall__="yes" 58__task_postinstall__="yes"
58 59
59task_load directories 60task_load directories
60task_load files 61task_load files
61task_load fonts 62task_load fonts
 63task_load icon_themes
62task_load info_files 64task_load info_files
63task_load ocaml_findlib 65task_load ocaml_findlib
64task_load permissions 66task_load permissions
65task_load shells 67task_load shells
66task_load shlibs 68task_load shlibs
67task_load sort 69task_load sort
68task_load taskfunc 70task_load taskfunc
69 71
70task_postinstall() 72task_postinstall()
71{ 73{
72 [ $# -gt 0 ] || return 127 74 [ $# -gt 0 ] || return 127
73 local datafile="$1"; shift 75 local datafile="$1"; shift
74 76
75 [ -f "$datafile" ] || return 1 77 [ -f "$datafile" ] || return 1
76 78
77 local post_actions= 79 local post_actions=
78 # Copy configuration/support files into place. 80 # Copy configuration/support files into place.
79 post_actions="task_files" 81 post_actions="task_files"
80 # Set special permissions on files and directories that need them. 82 # Set special permissions on files and directories that need them.
81 post_actions="$post_actions task_permissions" 83 post_actions="$post_actions task_permissions"
82 # Rebuild the system run-time library search path database. 84 # Rebuild the system run-time library search path database.
83 post_actions="$post_actions task_shlibs" 85 post_actions="$post_actions task_shlibs"
84 # Update font databases. 86 # Update font databases.
85 post_actions="$post_actions task_fonts" 87 post_actions="$post_actions task_fonts"
 88 # Update GTK+ icon theme caches.
 89 post_actions="$post_actions task_icon_themes"
86 # Register shells. 90 # Register shells.
87 post_actions="$post_actions task_shells" 91 post_actions="$post_actions task_shells"
88 # Register GNU info files. 92 # Register GNU info files.
89 post_actions="$post_actions task_info_files" 93 post_actions="$post_actions task_info_files"
90 # Update OCaml module run-time library search path database. 94 # Update OCaml module run-time library search path database.
91 post_actions="$post_actions task_ocaml_findlib" 95 post_actions="$post_actions task_ocaml_findlib"
92 # Run generic package tasks. 96 # Run generic package tasks.
93 post_actions="$post_actions task_function" 97 post_actions="$post_actions task_function"
94 98
95 # Seed checks with actions from preinstall, in order. 99 # Seed checks with actions from preinstall, in order.
96 local post_checks="task_directories" 100 local post_checks="task_directories"
97 101
98 local result=0 102 local result=0

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/postremove.subr (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/postremove.subr 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/postremove.subr 2017/08/10 05:38:30 1.2
@@ -27,106 +27,118 @@ @@ -27,106 +27,118 @@
27# 27#
28# NAME 28# NAME
29# postremove.subr -- post-removal actions for packages 29# postremove.subr -- post-removal actions for packages
30# 30#
31# SYNOPSIS 31# SYNOPSIS
32# task_postremove <datafile> 32# task_postremove <datafile>
33# 33#
34# DESCRIPTION 34# DESCRIPTION
35# The task_postremove function performs actions that SHOULD occur 35# The task_postremove function performs actions that SHOULD occur
36# AFTER deleting the package files: 36# AFTER deleting the package files:
37# 37#
38# o Unregister shells from the system shells database. 38# o Unregister shells from the system shells database.
39# o Update fonts databases. 39# o Update fonts databases.
 40# o Update caches within GTK+ icon theme directories.
40# o Rebuild the system run-time library search path database. 41# o Rebuild the system run-time library search path database.
41# o Update OCaml module run-time library search path database. 42# o Update OCaml module run-time library search path database.
42# o Remove empty directories. 43# o Remove empty directories.
43# o Remove unused users. 44# o Remove unused users.
44# o Remove unused groups. 45# o Remove unused groups.
45# 46#
46# The datafile contains lines of the form: 47# The datafile contains lines of the form:
47# 48#
48# # <keyword>: <arg> ... 49# # <keyword>: <arg> ...
49# 50#
50# These lines are used as input to the various script functions. 51# These lines are used as input to the various script functions.
51# 52#
52# RETURN VALUES 53# RETURN VALUES
53# Returns 0 on success, and >0 if an error occurs. 54# Returns 0 on success, and >0 if an error occurs.
54# 55#
55 56
56__task_postremove__="yes" 57__task_postremove__="yes"
57 58
58task_load directories 59task_load directories
59task_load files 60task_load files
60task_load fonts 61task_load fonts
61task_load groups 62task_load groups
 63task_load icon_themes
62task_load info_files 64task_load info_files
63task_load ocaml_findlib 65task_load ocaml_findlib
64task_load shells 66task_load shells
65task_load shlibs 67task_load shlibs
66task_load sort 68task_load sort
67task_load taskfunc 69task_load taskfunc
68task_load users 70task_load users
69 71
70task_postremove() 72task_postremove()
71{ 73{
72 [ $# -gt 0 ] || return 127 74 [ $# -gt 0 ] || return 127
73 local datafile="$1"; shift 75 local datafile="$1"; shift
74 76
75 [ -f "$datafile" ] || return 1 77 [ -f "$datafile" ] || return 1
76 78
77 local post_actions= 79 local post_actions=
78 # Remove shells from the system shells database. 80 # Remove shells from the system shells database.
79 post_actions="task_shells" 81 post_actions="task_shells"
80 # Update font databases. 82 # Update font databases.
81 post_actions="$post_actions task_fonts" 83 post_actions="$post_actions task_fonts"
 84 # Update GTK+ icon theme caches
 85 post_actions="$post_actions task_icon_themes"
82 # Rebuild the system run-time library search path database. 86 # Rebuild the system run-time library search path database.
83 post_actions="$post_actions task_shlibs" 87 post_actions="$post_actions task_shlibs"
84 # Update OCaml module run-time library search path database. 88 # Update OCaml module run-time library search path database.
85 post_actions="$post_actions task_ocaml_findlib" 89 post_actions="$post_actions task_ocaml_findlib"
86 # Remove empty directories. 90 # Remove empty directories.
87 post_actions="$post_actions task_directories" 91 post_actions="$post_actions task_directories"
88 # Remove unused users. 92 # Remove unused users.
89 post_actions="$post_actions task_users" 93 post_actions="$post_actions task_users"
90 # Remove unused groups. 94 # Remove unused groups.
91 post_actions="$post_actions task_groups" 95 post_actions="$post_actions task_groups"
92 # Run generic package tasks. 96 # Run generic package tasks.
93 post_actions="$post_actions task_function" 97 post_actions="$post_actions task_function"
94 98
95 # Seed checks with actions from preremove, in order. 99 # Seed checks with actions from preremove, in order.
96 local post_checks="task_info_files task_files" 100 local post_checks="task_info_files task_files"
97 101
98 local result=0 102 local result=0
99 local stage="preinstall" 103 local stage="postremove"
100 104
101 local post_fn silent 105 local post_fn silent action_result
102 for post_fn in $post_actions; do 106 for post_fn in $post_actions; do
103 case $post_fn in 107 case $post_fn in
104 task_directories|\ 108 task_directories|\
105 task_groups|\ 109 task_groups|\
106 task_shells|\ 110 task_shells|\
107 task_users) 111 task_users)
108 # These tasks should be verbose since they touch 112 # These tasks should be verbose since they touch
109 # system files and directories. 113 # system files and directories.
110 silent= ;; 114 silent= ;;
111 *) silent="-s" ;; 115 *) silent="-s" ;;
112 esac 116 esac
113 case $post_fn in 117 case $post_fn in
114 task_directories) 118 task_directories)
115 # Reverse-sort data lines for this task. 119 # Reverse-sort data lines for this task.
116 task_sort -r < $datafile | $post_fn $silent remove $stage ;; 120 task_sort -r < $datafile | $post_fn $silent remove $stage ;;
117 *) $post_fn $silent remove $stage < $datafile ;; 121 *) $post_fn $silent remove $stage < $datafile ;;
118 esac 122 esac
119 [ $? -eq 0 ] || result=1 123 action_result="$?"
 124 case $post_fn in
 125 task_icon_themes)
 126 # Any errors in updating icon caches during postremove
 127 # are non-fatal, so adjust the action result.
 128 #
 129 action_result=0 ;;
 130 esac
 131 [ $action_result -eq 0 ] || result=1
120 post_checks="$post_checks $post_fn" 132 post_checks="$post_checks $post_fn"
121 done 133 done
122 134
123 # Run all checks after all post-removal actions have completed 135 # Run all checks after all post-removal actions have completed
124 # and write messages to standard output for any checks that don't 136 # and write messages to standard output for any checks that don't
125 # pass. 137 # pass.
126 # 138 #
127 for post_fn in $post_checks; do 139 for post_fn in $post_checks; do
128 case $post_fn in 140 case $post_fn in
129 task_directories) 141 task_directories)
130 # Reverse-sort data lines for this task. 142 # Reverse-sort data lines for this task.
131 task_sort -r < $datafile | $post_fn check-remove $stage ;; 143 task_sort -r < $datafile | $post_fn check-remove $stage ;;
132 *) $post_fn check-remove $stage < $datafile ;; 144 *) $post_fn check-remove $stage < $datafile ;;

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/preremove.subr (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/preremove.subr 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/preremove.subr 2017/08/10 05:38:30 1.2
@@ -26,61 +26,70 @@ @@ -26,61 +26,70 @@
26# POSSIBILITY OF SUCH DAMAGE. 26# POSSIBILITY OF SUCH DAMAGE.
27# 27#
28# NAME 28# NAME
29# preremove.subr -- pre-removal actions for packages 29# preremove.subr -- pre-removal actions for packages
30# 30#
31# SYNOPSIS 31# SYNOPSIS
32# task_preremove <datafile> 32# task_preremove <datafile>
33# 33#
34# DESCRIPTION 34# DESCRIPTION
35# The task_preremove function performs actions that MUST occur BEFORE 35# The task_preremove function performs actions that MUST occur BEFORE
36# deleting the package files for the removal to be successful: 36# deleting the package files for the removal to be successful:
37# 37#
38# o Unregister GNU info files. 38# o Unregister GNU info files.
 39# o Remove GTK+ icon theme caches.
39# o Remove unmodified configuration files. 40# o Remove unmodified configuration files.
40# 41#
41# The datafile contains lines of the form: 42# The datafile contains lines of the form:
42# 43#
43# # <keyword>: <arg> ... 44# # <keyword>: <arg> ...
44# 45#
45# These lines are used as input to the various script functions. 46# These lines are used as input to the various script functions.
46# 47#
47# RETURN VALUES 48# RETURN VALUES
48# Returns 0 on success, and >0 if an error occurs. 49# Returns 0 on success, and >0 if an error occurs.
49# 50#
50 51
51__task_preremove__="yes" 52__task_preremove__="yes"
52 53
53task_load files 54task_load files
 55task_load icon_themes
54task_load info_files 56task_load info_files
55task_load sort 57task_load sort
56task_load taskfunc 58task_load taskfunc
57 59
58task_preremove() 60task_preremove()
59{ 61{
60 [ $# -gt 0 ] || return 127 62 [ $# -gt 0 ] || return 127
61 local datafile="$1"; shift 63 local datafile="$1"; shift
62 64
63 [ -f "$datafile" ] || return 1 65 [ -f "$datafile" ] || return 1
64 66
65 local stage="preinstall" 67 local stage="preremove"
66 68
67 # Unregistering a GNU info files requires reading the file to find 69 # Unregistering a GNU info files requires reading the file to find
68 # all nodes listed in the file, so it must be done before the file 70 # all nodes listed in the file, so it must be done before the file
69 # is removed. Any errors in unregistering GNU info files are 71 # is removed. Any errors in unregistering GNU info files are
70 # non-fatal. 72 # non-fatal.
71 # 73 #
72 task_info_files -s remove $stage < $datafile 74 task_info_files -s remove $stage < $datafile
73 75
 76 # GTK+ icon theme caches exist in the package installation
 77 # directory, so they must be removed before their packages can be
 78 # successfully removed. Any errors in removing icon caches are
 79 # non-fatal.
 80 #
 81 task_icon_themes -s remove $stage < $datafile
 82
74 # Removing a configuration file requires comparing it to the 83 # Removing a configuration file requires comparing it to the
75 # example file from which it was copied, so it must be done before 84 # example file from which it was copied, so it must be done before
76 # the example file is removed. Any errors in removing 85 # the example file is removed. Any errors in removing
77 # configuration files are non-fatal. 86 # configuration files are non-fatal.
78 # 87 #
79 task_files remove $stage < $datafile 88 task_files remove $stage < $datafile
80 89
81 # Run the generic package tasks. 90 # Run the generic package tasks.
82 if task_sort -r < $datafile | task_function remove $stage; then 91 if task_sort -r < $datafile | task_function remove $stage; then
83 : "success" 92 : "success"
84 else 93 else
85 # Errors from the generic package tasks are fatal. 94 # Errors from the generic package tasks are fatal.
86 return 1 95 return 1

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/shells.subr (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/shells.subr 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/shells.subr 2017/08/10 05:38:30 1.2
@@ -91,26 +91,27 @@ @@ -91,26 +91,27 @@
91# RM The name or path to the rm(1) utility. 91# RM The name or path to the rm(1) utility.
92# 92#
93# TASK_MSG 93# TASK_MSG
94# String prepended to all normal message written to 94# String prepended to all normal message written to
95# standard output. 95# standard output.
96# 96#
97 97
98__task_shells__="yes" 98__task_shells__="yes"
99__task_shells_init__="_task_shells_init" 99__task_shells_init__="_task_shells_init"
100 100
101task_load cleanup 101task_load cleanup
102task_load echo 102task_load echo
103task_load lock 103task_load lock
 104task_load makedir
104task_load maketemp 105task_load maketemp
105task_load match 106task_load match
106task_load quote 107task_load quote
107task_load truthy 108task_load truthy
108 109
109task_shells() 110task_shells()
110{ 111{
111 : ${MV:=mv} 112 : ${MV:=mv}
112 113
113 : ${PKG_PREFIX:=/usr/pkg} 114 : ${PKG_PREFIX:=/usr/pkg}
114 : ${PKGNAME:=${0##*/}} 115 : ${PKGNAME:=${0##*/}}
115 116
116 : ${PKG_REGISTER_SHELLS:=yes} 117 : ${PKG_REGISTER_SHELLS:=yes}
@@ -161,35 +162,41 @@ task_shells() @@ -161,35 +162,41 @@ task_shells()
161 esac 162 esac
162 163
163 # Canonicalize paths. 164 # Canonicalize paths.
164 case $shell in 165 case $shell in
165 "") # skip lines without any required args 166 "") # skip lines without any required args
166 continue ;; 167 continue ;;
167 [!/]*) shell="$prefix/$shell" ;; 168 [!/]*) shell="$prefix/$shell" ;;
168 esac 169 esac
169 case $shelldb in 170 case $shelldb in
170 "") shelldb="/etc/shells" ;; 171 "") shelldb="/etc/shells" ;;
171 [!/]*) shelldb="$prefix/$shelldb" ;; 172 [!/]*) shelldb="$prefix/$shelldb" ;;
172 esac 173 esac
173 shelldb="${PKG_DESTDIR}$shelldb" 174 shelldb="${PKG_DESTDIR}$shelldb"
 175 local shelldbdir=${shelldb%/*}
174 176
175 line_result=0 177 line_result=0
176 case $action in 178 case $action in
177 add|remove) 179 add|remove)
178 lock="$shelldb.lock" 180 # Ensure that the shelldb directory exists.
179 task_quote "$lock" 181 [ -d "$shelldbdir" ] || task_makedir "$shelldbdir" 2>/dev/null
180 lock_quoted=$quoted 182 [ -d "$shelldbdir" ] || line_result=1
181 __task_shells_locks__="$lock_quoted $__task_shells_locks__" 183 if [ $line_result -eq 0 ]; then
182 task_lock "$lock" || line_result=1 ;; 184 lock="$shelldb.lock"
 185 task_quote "$lock"
 186 lock_quoted=$quoted
 187 __task_shells_locks__="$lock_quoted $__task_shells_locks__"
 188 task_lock "$lock" || line_result=1
 189 fi ;;
183 esac 190 esac
184 if [ $line_result -eq 0 ]; then 191 if [ $line_result -eq 0 ]; then
185 case $action in 192 case $action in
186 add) if [ -n "$register_shells" ]; then 193 add) if [ -n "$register_shells" ]; then
187 if [ -f "$shelldb" ] && task_match -qw "$shell" < $shelldb; then 194 if [ -f "$shelldb" ] && task_match -qw "$shell" < $shelldb; then
188 $echo "${TASK_MSG}! shell already added: $shell" 195 $echo "${TASK_MSG}! shell already added: $shell"
189 else 196 else
190 temp=$( task_maketemp "$shelldb.pkgtasks.XXXXXXXXXX" ) 197 temp=$( task_maketemp "$shelldb.pkgtasks.XXXXXXXXXX" )
191 if [ -n "$temp" ]; then 198 if [ -n "$temp" ]; then
192 task_quote "$temp" 199 task_quote "$temp"
193 temp_quoted="$quoted" 200 temp_quoted="$quoted"
194 __task_shells_temps__="$__task_shells_temps__ $temp_quoted" 201 __task_shells_temps__="$__task_shells_temps__ $temp_quoted"
195 if [ ! -f "$shelldb" ]; then 202 if [ ! -f "$shelldb" ]; then

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/users.subr (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/users.subr 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/users.subr 2017/08/10 05:38:30 1.2
@@ -118,94 +118,97 @@ task_users() @@ -118,94 +118,97 @@ task_users()
118 [ $# -gt 0 ] || return 127 118 [ $# -gt 0 ] || return 127
119 119
120 local action="$1"; shift 120 local action="$1"; shift
121 case $action in 121 case $action in
122 add|remove|check-add|check-remove) 122 add|remove|check-add|check-remove)
123 : "valid action" ;; 123 : "valid action" ;;
124 *) return 0 ;; 124 *) return 0 ;;
125 esac 125 esac
126 126
127 local create="yes" 127 local create="yes"
128 task_is_truthy "${PKG_CREATE_USERGROUP}" || create= 128 task_is_truthy "${PKG_CREATE_USERGROUP}" || create=
129 129
130 local result line_result 130 local result line_result
131 local save_IFS user group uid descr home shell msg 131 local save_IFS user group uid descr home shell msg submsg
132 132
133 result=0 133 result=0
134 local hash tag entry 134 local hash tag entry
135 while read hash tag entry; do 135 while read hash tag entry; do
136 # Filter for "# USER:". 136 # Filter for "# USER:".
137 case $hash/$tag in 137 case $hash/$tag in
138 "#/USER:") 138 "#/USER:")
139 : "use this line" ;; 139 : "use this line" ;;
140 *) continue ;; 140 *) continue ;;
141 esac 141 esac
142 142
143 save_IFS=$IFS; IFS=: 143 save_IFS=$IFS; IFS=:
144 set -o noglob; set -- $entry; set +o noglob 144 set -o noglob; set -- $entry; set +o noglob
145 user=$1; group=$2 # required 145 user=$1; group=$2 # required
146 uid=$3; descr=$4; home=$5; shell=$6 146 uid=$3; descr=$4; home=$5; shell=$6
147 IFS=$save_IFS 147 IFS=$save_IFS
148 [ -n "$user" -a -n "$group" ] || continue 148 [ -n "$user" -a -n "$group" ] || continue
149 149
150 if [ -n "$uid" ]; then 150 submsg=
151 msg="$user (uid = $uid)" 151 [ -z "$uid" ] || submsg="$submsg, uid = $uid"
152 else 152 [ -z "$group" ] || submsg="$submsg, group = $group"
 153 [ -z "$home" ] || submsg="$submsg, home = $home"
 154 [ -z "$shell" ] || submsg="$submsg, shell = $shell"
 155 submsg="(${submsg#, })"
 156 if [ "$submsg" = "()" ]; then
153 msg="$user" 157 msg="$user"
 158 else
 159 msg="$user $submsg"
154 fi 160 fi
155 msg="$msg: $group" 
156 [ -z "$home" ] || msg="$msg, $home" 
157 [ -z "$shell" ] || msg="$msg, $shell" 
158 161
159 line_result=0 162 line_result=0
160 case $action in 163 case $action in
161 add) if task_refcount add users "$user"; then 164 add) if task_refcount add users "$user"; then
162 task_user_exists "$user" "$uid" 165 task_user_exists "$user" "$uid"
163 case $? in 166 case $? in
164 0) # $user exists and has uid $uid 167 0) # $user exists and has uid $uid
165 $echo "${TASK_MSG}! user already exists: $msg" ;; 168 $echo "${TASK_MSG}! user already exists: $user" ;;
166 1) # neither $user nor $uid exist 169 1) # neither $user nor $uid exist
167 if [ -z "$create" ]; then 170 if [ -z "$create" ]; then
168 $echo "${TASK_MSG}! user creation skipped: $msg" 171 $echo "${TASK_MSG}! user creation skipped: $msg"
169 elif task_adduser "$user" "$group" "$uid" "$descr" "$home" "$shell"; then 172 elif task_adduser "$user" "$group" "$uid" "$descr" "$home" "$shell"; then
170 $echo "${TASK_MSG}> user created: $msg" 173 $echo "${TASK_MSG}> user created: $msg"
171 task_quote "$user" 174 task_quote "$user"
172 __task_users_error__="$__task_users_error__ $_quoted" 175 __task_users_error__="$__task_users_error__ $_quoted"
173 else 176 else
174 $echo "${TASK_MSG}! user not created: $msg" 177 $echo "${TASK_MSG}! user not created: $msg"
175 line_result=1 178 line_result=1
176 fi ;; 179 fi ;;
177 2) $echo "${TASK_MSG}! user conflict: $msg" 180 2) $echo "${TASK_MSG}! user conflict: $msg"
178 result=1 181 result=1
179 break ;; 182 break ;;
180 *) $echo "${TASK_MSG}! user not created: $msg" 183 *) $echo "${TASK_MSG}! user not created: $msg"
181 line_result=1 ;; 184 line_result=1 ;;
182 esac 185 esac
183 else 186 else
184 # add refcount failed; skip to next line 187 # add refcount failed; skip to next line
185 $echo "${TASK_MSG}! refcount add failure: users $msg" 188 $echo "${TASK_MSG}! refcount add failure: users $user"
186 result=1 189 result=1
187 continue 190 continue
188 fi ;; 191 fi ;;
189 remove) if task_refcount remove users "$user"; then 192 remove) if task_refcount remove users "$user"; then
190 if task_refcount exists users "$user"; then 193 if task_refcount exists users "$user"; then
191 : "refcount is not zero" 194 : "refcount is not zero"
192 else 195 else
193 # delete the reference count 196 # delete the reference count
194 task_refcount delete users "$user" 197 task_refcount delete users "$user"
195 fi 198 fi
196 else 199 else
197 # remove refcount failed 200 # remove refcount failed
198 $echo "${TASK_MSG}! refcount remove failure: users $msg" 201 $echo "${TASK_MSG}! refcount remove failure: users $user"
199 line_result=1 202 line_result=1
200 fi ;; 203 fi ;;
201 check-add) 204 check-add)
202 if task_user_exists "$user" "$uid"; then 205 if task_user_exists "$user" "$uid"; then
203 : "user already exists" 206 : "user already exists"
204 else 207 else
205 task_echo "!!! INFO: ${PKGNAME}: Create user: $msg" 208 task_echo "!!! INFO: ${PKGNAME}: Create user: $msg"
206 line_result=1 209 line_result=1
207 fi ;; 210 fi ;;
208 check-remove) 211 check-remove)
209 if task_user_exists "$user" "$uid"; then 212 if task_user_exists "$user" "$uid"; then
210 task_echo "!!! INFO: ${PKGNAME}: Remove user if unused: $user" 213 task_echo "!!! INFO: ${PKGNAME}: Remove user if unused: $user"
211 line_result=1 214 line_result=1

cvs diff -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh 2017/06/03 23:54:53 1.2
+++ pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh 2017/08/10 05:38:30 1.3
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# $NetBSD: install-sh,v 1.2 2017/06/03 23:54:53 jlam Exp $ 3# $NetBSD: install-sh,v 1.3 2017/08/10 05:38:30 jlam Exp $
4# This script now also installs multiple files, but might choke on installing 4# This script now also installs multiple files, but might choke on installing
5# multiple files with spaces in the file names. 5# multiple files with spaces in the file names.
6# 6#
7# install - install a program, script, or datafile 7# install - install a program, script, or datafile
8# This comes from X11R5 (mit/util/scripts/install.sh). 8# This comes from X11R5 (mit/util/scripts/install.sh).
9# 9#
10# Copyright 1991 by the Massachusetts Institute of Technology 10# Copyright 1991 by the Massachusetts Institute of Technology
11# 11#
12# Permission to use, copy, modify, distribute, and sell this software and its 12# Permission to use, copy, modify, distribute, and sell this software and its
13# documentation for any purpose is hereby granted without fee, provided that 13# documentation for any purpose is hereby granted without fee, provided that
14# the above copyright notice appear in all copies and that both that 14# the above copyright notice appear in all copies and that both that
15# copyright notice and this permission notice appear in supporting 15# copyright notice and this permission notice appear in supporting
16# documentation, and that the name of M.I.T. not be used in advertising or 16# documentation, and that the name of M.I.T. not be used in advertising or

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/Kyuafile (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/t/Kyuafile 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/t/Kyuafile 2017/08/10 05:38:30 1.2
@@ -40,26 +40,27 @@ POSSIBILITY OF SUCH DAMAGE. @@ -40,26 +40,27 @@ POSSIBILITY OF SUCH DAMAGE.
40 40
41syntax( 2 ) 41syntax( 2 )
42 42
43test_suite( "pkgtasks" ) 43test_suite( "pkgtasks" )
44 44
45tap_test_program { name = "t_compare" } 45tap_test_program { name = "t_compare" }
46tap_test_program { name = "t_createfile" } 46tap_test_program { name = "t_createfile" }
47tap_test_program { name = "t_directories" } 47tap_test_program { name = "t_directories" }
48tap_test_program { name = "t_dirwalk" } 48tap_test_program { name = "t_dirwalk" }
49tap_test_program { name = "t_echo" } 49tap_test_program { name = "t_echo" }
50tap_test_program { name = "t_files" } 50tap_test_program { name = "t_files" }
51tap_test_program { name = "t_fonts" } 51tap_test_program { name = "t_fonts" }
52tap_test_program { name = "t_groups" } 52tap_test_program { name = "t_groups" }
 53tap_test_program { name = "t_icon_themes" }
53tap_test_program { name = "t_info_files" } 54tap_test_program { name = "t_info_files" }
54tap_test_program { name = "t_lock" } 55tap_test_program { name = "t_lock" }
55tap_test_program { name = "t_makedir" } 56tap_test_program { name = "t_makedir" }
56tap_test_program { name = "t_maketemp" } 57tap_test_program { name = "t_maketemp" }
57tap_test_program { name = "t_match" } 58tap_test_program { name = "t_match" }
58tap_test_program { name = "t_ocaml_findlib" } 59tap_test_program { name = "t_ocaml_findlib" }
59tap_test_program { name = "t_permissions" } 60tap_test_program { name = "t_permissions" }
60tap_test_program { name = "t_platform" } 61tap_test_program { name = "t_platform" }
61tap_test_program { name = "t_postinstall" } 62tap_test_program { name = "t_postinstall" }
62tap_test_program { name = "t_postremove" } 63tap_test_program { name = "t_postremove" }
63tap_test_program { name = "t_preinstall" } 64tap_test_program { name = "t_preinstall" }
64tap_test_program { name = "t_preremove" } 65tap_test_program { name = "t_preremove" }
65tap_test_program { name = "t_quote" } 66tap_test_program { name = "t_quote" }

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_ocaml_findlib.sh (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/t/t_ocaml_findlib.sh 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/t/t_ocaml_findlib.sh 2017/08/10 05:38:30 1.2
@@ -16,55 +16,55 @@ @@ -16,55 +16,55 @@
16# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26# POSSIBILITY OF SUCH DAMAGE. 26# POSSIBILITY OF SUCH DAMAGE.
27 27
28task_load createfile 28task_load createfile
 29task_load makedir
29task_load ocaml_findlib 30task_load ocaml_findlib
30task_load unittest 31task_load unittest
31 32
32test_setup() 33test_setup()
33{ 34{
34 : ${CAT:=cat} 35 : ${CAT:=cat}
35 36
36 PKG_PREFIX=${TEST_CURDIR} 37 PKG_PREFIX=${TEST_CURDIR}
37 PKG_DESTDIR= 38 PKG_DESTDIR=
38 39
39 ldconf="ld.conf" 40 ldconf="lib/ocaml/ld.conf"
40 ldconf_lock="$ldconf.lock" 41 ldconf_lock="$ldconf.lock"
41 42
42 datafile="datafile" 43 datafile="datafile"
43 ${CAT} > $datafile << EOF 44 ${CAT} > $datafile << EOF
44# FINDLIB: pcre $ldconf 45# FINDLIB: pcre $ldconf
45# FINDLIB: base64 $ldconf 46# FINDLIB: base64 $ldconf
46# FINDLIB: expat $ldconf 47# FINDLIB: expat $ldconf
47# FINDLIB: pcre $ldconf 48# FINDLIB: pcre $ldconf
48EOF 49EOF
49} 50}
50 51
51test_destdir_setup() 52test_destdir_setup()
52{ 53{
53 : ${MKDIR:=mkdir} 
54 : ${MV:=mv} 54 : ${MV:=mv}
55 55
56 PKG_DESTDIR="${TEST_CURDIR}/destdir" 56 PKG_DESTDIR="${TEST_CURDIR}/destdir"
57 ${MKDIR} -p "${PKG_DESTDIR}${PKG_PREFIX}" 57 task_makedir "${PKG_DESTDIR}${PKG_PREFIX}"
58} 58}
59 59
60test1() 60test1()
61{ 61{
62 describe="check-add findlib dirs with empty ld.conf" 62 describe="check-add findlib dirs with empty ld.conf"
63 if task_ocaml_findlib check-add < $datafile; then 63 if task_ocaml_findlib check-add < $datafile; then
64 return 1 64 return 1
65 fi 65 fi
66 return 0 66 return 0
67} 67}
68 68
69test2() 69test2()
70{ 70{
@@ -164,26 +164,27 @@ test7() @@ -164,26 +164,27 @@ test7()
164 while read line; do 164 while read line; do
165 count="$count + 1" 165 count="$count + 1"
166 done < $ldconf 166 done < $ldconf
167 count=$(( $count )) 167 count=$(( $count ))
168 if [ $count -gt 0 ]; then 168 if [ $count -gt 0 ]; then
169 return 1 169 return 1
170 fi 170 fi
171 return 0 171 return 0
172} 172}
173 173
174test8() 174test8()
175{ 175{
176 describe="check-remove findlib dirs with empty ld.conf" 176 describe="check-remove findlib dirs with empty ld.conf"
 177 task_makedir "${ldconf%/*}"
177 task_createfile "$ldconf" 178 task_createfile "$ldconf"
178 if task_ocaml_findlib check-remove < $datafile; then 179 if task_ocaml_findlib check-remove < $datafile; then
179 : "success" 180 : "success"
180 else 181 else
181 return 1 182 return 1
182 fi 183 fi
183 if [ -f "$ldconf_lock" ]; then 184 if [ -f "$ldconf_lock" ]; then
184 describe="$describe: lock exists!" 185 describe="$describe: lock exists!"
185 return 1 186 return 1
186 fi 187 fi
187 return 0 188 return 0
188} 189}
189 190
@@ -316,26 +317,27 @@ test14() @@ -316,26 +317,27 @@ test14()
316 return 1 317 return 1
317 fi 318 fi
318 if [ -f "$ldconf" ]; then 319 if [ -f "$ldconf" ]; then
319 describe="$describe: $ldconf exists!" 320 describe="$describe: $ldconf exists!"
320 return 1 321 return 1
321 fi 322 fi
322 return 0 323 return 0
323} 324}
324 325
325test15() 326test15()
326{ 327{
327 describe="check-remove findlib dirs with empty ld.conf with PKG_DESTDIR" 328 describe="check-remove findlib dirs with empty ld.conf with PKG_DESTDIR"
328 test_destdir_setup 329 test_destdir_setup
 330 task_makedir "${PKG_DESTDIR}${PKG_PREFIX}/${ldconf%/*}"
329 task_createfile "${PKG_DESTDIR}${PKG_PREFIX}/$ldconf" 331 task_createfile "${PKG_DESTDIR}${PKG_PREFIX}/$ldconf"
330 if task_ocaml_findlib check-remove < $datafile; then 332 if task_ocaml_findlib check-remove < $datafile; then
331 : "success" 333 : "success"
332 else 334 else
333 return 1 335 return 1
334 fi 336 fi
335 if [ -f "${PKG_DESTDIR}${PKG_PREFIX}/$ldconf_lock" ]; then 337 if [ -f "${PKG_DESTDIR}${PKG_PREFIX}/$ldconf_lock" ]; then
336 describe="$describe: lock exists!" 338 describe="$describe: lock exists!"
337 return 1 339 return 1
338 fi 340 fi
339 if [ -f "$ldconf" ]; then 341 if [ -f "$ldconf" ]; then
340 describe="$describe: $ldconf exists!" 342 describe="$describe: $ldconf exists!"
341 return 1 343 return 1

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh 2017/08/10 05:38:30 1.2
@@ -28,26 +28,27 @@ @@ -28,26 +28,27 @@
28task_load createfile 28task_load createfile
29task_load postinstall 29task_load postinstall
30task_load unittest 30task_load unittest
31 31
32test_setup() 32test_setup()
33{ 33{
34 datafile="empty" 34 datafile="empty"
35 task_createfile "$datafile" 35 task_createfile "$datafile"
36 36
37 TASK_DIRECTORIES_SUCCESS="yes" 37 TASK_DIRECTORIES_SUCCESS="yes"
38 TASK_FILES_SUCCESS="yes" 38 TASK_FILES_SUCCESS="yes"
39 TASK_FONTS_SUCCESS="yes" 39 TASK_FONTS_SUCCESS="yes"
40 TASK_FUNCTION_SUCCESS="yes" 40 TASK_FUNCTION_SUCCESS="yes"
 41 TASK_ICON_THEMES_SUCCESS="yes"
41 TASK_INFO_FILES_SUCCESS="yes" 42 TASK_INFO_FILES_SUCCESS="yes"
42 TASK_OCAML_FINDLIB_SUCCESS="yes" 43 TASK_OCAML_FINDLIB_SUCCESS="yes"
43 TASK_PERMISSIONS_SUCCESS="yes" 44 TASK_PERMISSIONS_SUCCESS="yes"
44 TASK_SHELLS_SUCCESS="yes" 45 TASK_SHELLS_SUCCESS="yes"
45 TASK_SHLIBS_SUCCESS="yes" 46 TASK_SHLIBS_SUCCESS="yes"
46} 47}
47 48
48# Mock actions that return the truthiness of environment variables. 49# Mock actions that return the truthiness of environment variables.
49task_directories() 50task_directories()
50{ 51{
51 [ "${TASK_DIRECTORIES_SUCCESS}" = "yes" ] 52 [ "${TASK_DIRECTORIES_SUCCESS}" = "yes" ]
52} 53}
53 54
@@ -56,26 +57,31 @@ task_files() @@ -56,26 +57,31 @@ task_files()
56 [ "${TASK_FILES_SUCCESS}" = "yes" ] 57 [ "${TASK_FILES_SUCCESS}" = "yes" ]
57} 58}
58 59
59task_fonts() 60task_fonts()
60{ 61{
61 [ "${TASK_FONTS_SUCCESS}" = "yes" ] 62 [ "${TASK_FONTS_SUCCESS}" = "yes" ]
62} 63}
63 64
64task_function() 65task_function()
65{ 66{
66 [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] 67 [ "${TASK_FUNCTION_SUCCESS}" = "yes" ]
67} 68}
68 69
 70task_icon_themes()
 71{
 72 [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ]
 73}
 74
69task_info_files() 75task_info_files()
70{ 76{
71 [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ] 77 [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ]
72} 78}
73 79
74task_ocaml_findlib() 80task_ocaml_findlib()
75{ 81{
76 [ "${TASK_OCAML_FINDLIB_SUCCESS}" = "yes" ] 82 [ "${TASK_OCAML_FINDLIB_SUCCESS}" = "yes" ]
77} 83}
78 84
79task_permissions() 85task_permissions()
80{ 86{
81 [ "${TASK_PERMISSIONS_SUCCESS}" = "yes" ] 87 [ "${TASK_PERMISSIONS_SUCCESS}" = "yes" ]
@@ -127,73 +133,83 @@ test3() @@ -127,73 +133,83 @@ test3()
127 133
128test4() 134test4()
129{ 135{
130 describe="function fail" 136 describe="function fail"
131 TASK_FUNCTION_SUCCESS="no" 137 TASK_FUNCTION_SUCCESS="no"
132 if task_postinstall "$datafile"; then 138 if task_postinstall "$datafile"; then
133 return 1 139 return 1
134 fi 140 fi
135 return 0 141 return 0
136} 142}
137 143
138test5() 144test5()
139{ 145{
 146 describe="icon_themes fail"
 147 TASK_ICON_THEMES_SUCCESS="no"
 148 if task_postinstall "$datafile"; then
 149 return 1
 150 fi
 151 return 0
 152}
 153
 154test6()
 155{
140 describe="info_files fail" 156 describe="info_files fail"
141 TASK_INFO_FILES_SUCCESS="no" 157 TASK_INFO_FILES_SUCCESS="no"
142 if task_postinstall "$datafile"; then 158 if task_postinstall "$datafile"; then
143 return 1 159 return 1
144 fi 160 fi
145 return 0 161 return 0
146} 162}
147 163
148test6() 164test7()
149{ 165{
150 describe="ocaml_findlib fail" 166 describe="ocaml_findlib fail"
151 TASK_OCAML_FINDLIB_SUCCESS="no" 167 TASK_OCAML_FINDLIB_SUCCESS="no"
152 if task_postinstall "$datafile"; then 168 if task_postinstall "$datafile"; then
153 return 1 169 return 1
154 fi 170 fi
155 return 0 171 return 0
156} 172}
157 173
158test7() 174test8()
159{ 175{
160 describe="permissions fail" 176 describe="permissions fail"
161 TASK_PERMISSIONS_SUCCESS="no" 177 TASK_PERMISSIONS_SUCCESS="no"
162 if task_postinstall "$datafile"; then 178 if task_postinstall "$datafile"; then
163 return 1 179 return 1
164 fi 180 fi
165 return 0 181 return 0
166} 182}
167 183
168test8() 184test9()
169{ 185{
170 describe="shells fail" 186 describe="shells fail"
171 TASK_SHELLS_SUCCESS="no" 187 TASK_SHELLS_SUCCESS="no"
172 if task_postinstall "$datafile"; then 188 if task_postinstall "$datafile"; then
173 return 1 189 return 1
174 fi 190 fi
175 return 0 191 return 0
176} 192}
177 193
178test9() 194test10()
179{ 195{
180 describe="shlibs fail" 196 describe="shlibs fail"
181 TASK_SHLIBS_SUCCESS="no" 197 TASK_SHLIBS_SUCCESS="no"
182 if task_postinstall "$datafile"; then 198 if task_postinstall "$datafile"; then
183 return 1 199 return 1
184 fi 200 fi
185 return 0 201 return 0
186} 202}
187 203
188test10() 204test11()
189{ 205{
190 describe="all succeed" 206 describe="all succeed"
191 if task_postinstall "$datafile"; then 207 if task_postinstall "$datafile"; then
192 : "success" 208 : "success"
193 else 209 else
194 return 1 210 return 1
195 fi 211 fi
196 return 0 212 return 0
197} 213}
198 214
199task_run_tests "$@" 215task_run_tests "$@"

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh 2017/08/10 05:38:30 1.2
@@ -29,26 +29,27 @@ task_load createfile @@ -29,26 +29,27 @@ task_load createfile
29task_load postremove 29task_load postremove
30task_load unittest 30task_load unittest
31 31
32test_setup() 32test_setup()
33{ 33{
34 datafile="empty" 34 datafile="empty"
35 task_createfile "$datafile" 35 task_createfile "$datafile"
36 36
37 TASK_DIRECTORIES_SUCCESS="yes" 37 TASK_DIRECTORIES_SUCCESS="yes"
38 TASK_FILES_SUCCESS="yes" 38 TASK_FILES_SUCCESS="yes"
39 TASK_FONTS_SUCCESS="yes" 39 TASK_FONTS_SUCCESS="yes"
40 TASK_FUNCTION_SUCCESS="yes" 40 TASK_FUNCTION_SUCCESS="yes"
41 TASK_GROUPS_SUCCESS="yes" 41 TASK_GROUPS_SUCCESS="yes"
 42 TASK_ICON_THEMES_SUCCESS="yes"
42 TASK_INFO_FILES_SUCCESS="yes" 43 TASK_INFO_FILES_SUCCESS="yes"
43 TASK_OCAML_FINDLIB_SUCCESS="yes" 44 TASK_OCAML_FINDLIB_SUCCESS="yes"
44 TASK_SHELLS_SUCCESS="yes" 45 TASK_SHELLS_SUCCESS="yes"
45 TASK_SHLIBS_SUCCESS="yes" 46 TASK_SHLIBS_SUCCESS="yes"
46 TASK_USERS_SUCCESS="yes" 47 TASK_USERS_SUCCESS="yes"
47} 48}
48 49
49# Mock actions that return the truthiness of environment variables. 50# Mock actions that return the truthiness of environment variables.
50task_directories() 51task_directories()
51{ 52{
52 [ "${TASK_DIRECTORIES_SUCCESS}" = "yes" ] 53 [ "${TASK_DIRECTORIES_SUCCESS}" = "yes" ]
53} 54}
54 55
@@ -62,26 +63,31 @@ task_fonts() @@ -62,26 +63,31 @@ task_fonts()
62 [ "${TASK_FONTS_SUCCESS}" = "yes" ] 63 [ "${TASK_FONTS_SUCCESS}" = "yes" ]
63} 64}
64 65
65task_function() 66task_function()
66{ 67{
67 [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] 68 [ "${TASK_FUNCTION_SUCCESS}" = "yes" ]
68} 69}
69 70
70task_groups() 71task_groups()
71{ 72{
72 [ "${TASK_GROUPS_SUCCESS}" = "yes" ] 73 [ "${TASK_GROUPS_SUCCESS}" = "yes" ]
73} 74}
74 75
 76task_icon_themes()
 77{
 78 [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ]
 79}
 80
75task_info_files() 81task_info_files()
76{ 82{
77 [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ] 83 [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ]
78} 84}
79 85
80task_ocaml_findlib() 86task_ocaml_findlib()
81{ 87{
82 [ "${TASK_OCAML_FINDLIB_SUCCESS}" = "yes" ] 88 [ "${TASK_OCAML_FINDLIB_SUCCESS}" = "yes" ]
83} 89}
84 90
85task_shells() 91task_shells()
86{ 92{
87 [ "${TASK_SHELLS_SUCCESS}" = "yes" ] 93 [ "${TASK_SHELLS_SUCCESS}" = "yes" ]
@@ -143,75 +149,87 @@ test4() @@ -143,75 +149,87 @@ test4()
143 149
144test5() 150test5()
145{ 151{
146 describe="groups fail" 152 describe="groups fail"
147 TASK_GROUPS_SUCCESS="no" 153 TASK_GROUPS_SUCCESS="no"
148 if task_postremove "$datafile"; then 154 if task_postremove "$datafile"; then
149 return 1 155 return 1
150 fi 156 fi
151 return 0 157 return 0
152} 158}
153 159
154test6() 160test6()
155{ 161{
 162 describe="icon_themes fail"
 163 TASK_ICON_THEMES_SUCCESS="no"
 164 if task_postremove "$datafile"; then
 165 : "icon_themes result is ignored during postremove"
 166 else
 167 return 1
 168 fi
 169 return 0
 170}
 171
 172test7()
 173{
156 describe="info_files fail" 174 describe="info_files fail"
157 TASK_INFO_FILES_SUCCESS="no" 175 TASK_INFO_FILES_SUCCESS="no"
158 if task_postremove "$datafile"; then 176 if task_postremove "$datafile"; then
159 : "info_files should only be used to check" 177 : "info_files should only be used to check"
160 else 178 else
161 return 1 179 return 1
162 fi 180 fi
163 return 0 181 return 0
164} 182}
165 183
166test7() 184test8()
167{ 185{
168 describe="ocaml_findlib fail" 186 describe="ocaml_findlib fail"
169 TASK_OCAML_FINDLIB_SUCCESS="no" 187 TASK_OCAML_FINDLIB_SUCCESS="no"
170 if task_postremove "$datafile"; then 188 if task_postremove "$datafile"; then
171 return 1 189 return 1
172 fi 190 fi
173 return 0 191 return 0
174} 192}
175 193
176test8() 194test9()
177{ 195{
178 describe="shells fail" 196 describe="shells fail"
179 TASK_SHELLS_SUCCESS="no" 197 TASK_SHELLS_SUCCESS="no"
180 if task_postremove "$datafile"; then 198 if task_postremove "$datafile"; then
181 return 1 199 return 1
182 fi 200 fi
183 return 0 201 return 0
184} 202}
185 203
186test9() 204test10()
187{ 205{
188 describe="shlibs fail" 206 describe="shlibs fail"
189 TASK_SHLIBS_SUCCESS="no" 207 TASK_SHLIBS_SUCCESS="no"
190 if task_postremove "$datafile"; then 208 if task_postremove "$datafile"; then
191 return 1 209 return 1
192 fi 210 fi
193 return 0 211 return 0
194} 212}
195 213
196test10() 214test11()
197{ 215{
198 describe="users fail" 216 describe="users fail"
199 TASK_USERS_SUCCESS="no" 217 TASK_USERS_SUCCESS="no"
200 if task_postremove "$datafile"; then 218 if task_postremove "$datafile"; then
201 return 1 219 return 1
202 fi 220 fi
203 return 0 221 return 0
204} 222}
205 223
206test11() 224test12()
207{ 225{
208 describe="all succeed" 226 describe="all succeed"
209 if task_postremove "$datafile"; then 227 if task_postremove "$datafile"; then
210 : "success" 228 : "success"
211 else 229 else
212 return 1 230 return 1
213 fi 231 fi
214 return 0 232 return 0
215} 233}
216 234
217task_run_tests "$@" 235task_run_tests "$@"

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh 2017/08/10 05:38:30 1.2
@@ -26,80 +26,98 @@ @@ -26,80 +26,98 @@
26# POSSIBILITY OF SUCH DAMAGE. 26# POSSIBILITY OF SUCH DAMAGE.
27 27
28task_load createfile 28task_load createfile
29task_load preremove 29task_load preremove
30task_load unittest 30task_load unittest
31 31
32test_setup() 32test_setup()
33{ 33{
34 datafile="empty" 34 datafile="empty"
35 task_createfile "$datafile" 35 task_createfile "$datafile"
36 36
37 TASK_FILES_SUCCESS="yes" 37 TASK_FILES_SUCCESS="yes"
38 TASK_FUNCTION_SUCCESS="yes" 38 TASK_FUNCTION_SUCCESS="yes"
 39 TASK_ICON_THEMES_SUCCESS="yes"
39 TASK_INFO_FILES_SUCCESS="yes" 40 TASK_INFO_FILES_SUCCESS="yes"
40} 41}
41 42
42# Mock actions whose return values are ignored. 43# Mock actions whose return values are ignored.
43task_files() 44task_files()
44{ 45{
45 [ "${TASK_FILES_SUCCESS}" = "yes" ] 46 [ "${TASK_FILES_SUCCESS}" = "yes" ]
46} 47}
47 48
48task_function() 49task_function()
49{ 50{
50 [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] 51 [ "${TASK_FUNCTION_SUCCESS}" = "yes" ]
51} 52}
52 53
 54task_icon_themes()
 55{
 56 [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ]
 57}
 58
53task_info_files() 59task_info_files()
54{ 60{
55 [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ] 61 [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ]
56} 62}
57 63
58# Always succeed. 64# Always succeed except if "function" task fails.
59 65
60test1() 66test1()
61{ 67{
62 describe="files fail" 68 describe="files fail"
63 TASK_FILES_SUCCESS="no" 69 TASK_FILES_SUCCESS="no"
64 if task_preremove "$datafile"; then 70 if task_preremove "$datafile"; then
65 : "success" 71 : "success"
66 else 72 else
67 return 1 73 return 1
68 fi 74 fi
69 return 0 75 return 0
70} 76}
71 77
72test2() 78test2()
73{ 79{
74 describe="function fail" 80 describe="function fail"
75 TASK_FUNCTION_SUCCESS="no" 81 TASK_FUNCTION_SUCCESS="no"
76 if task_preremove "$datafile"; then 82 if task_preremove "$datafile"; then
77 return 1 83 return 1
78 fi 84 fi
79 return 0 85 return 0
80} 86}
81 87
82test3() 88test3()
83{ 89{
 90 describe="icon_themes fail"
 91 TASK_ICON_THEMES_SUCCESS="no"
 92 if task_preremove "$datafile"; then
 93 : "success"
 94 else
 95 return 1
 96 fi
 97 return 0
 98}
 99
 100test4()
 101{
84 describe="info_files fail" 102 describe="info_files fail"
85 TASK_INFO_FILES_SUCCESS="no" 103 TASK_INFO_FILES_SUCCESS="no"
86 if task_preremove "$datafile"; then 104 if task_preremove "$datafile"; then
87 : "success" 105 : "success"
88 else 106 else
89 return 1 107 return 1
90 fi 108 fi
91 return 0 109 return 0
92} 110}
93 111
94test4() 112test5()
95{ 113{
96 describe="all succeed" 114 describe="all succeed"
97 if task_preremove "$datafile"; then 115 if task_preremove "$datafile"; then
98 : "success" 116 : "success"
99 else 117 else
100 return 1 118 return 1
101 fi 119 fi
102 return 0 120 return 0
103} 121}
104 122
105task_run_tests "$@" 123task_run_tests "$@"

cvs diff -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/t_shells.sh (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkgtasks/files/t/t_shells.sh 2017/06/01 01:58:34 1.1
+++ pkgsrc/pkgtools/pkgtasks/files/t/t_shells.sh 2017/08/10 05:38:30 1.2
@@ -16,58 +16,55 @@ @@ -16,58 +16,55 @@
16# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26# POSSIBILITY OF SUCH DAMAGE. 26# POSSIBILITY OF SUCH DAMAGE.
27 27
28task_load createfile 28task_load createfile
 29task_load makedir
29task_load shells 30task_load shells
30task_load unittest 31task_load unittest
31 32
32test_setup() 33test_setup()
33{ 34{
34 : ${CAT:=cat} 35 : ${CAT:=cat}
35 : ${MKDIR:=mkdir} 36 : ${MKDIR:=mkdir}
36 37
37 PKG_PREFIX="${TEST_CURDIR}" 38 PKG_PREFIX="${TEST_CURDIR}"
38 PKG_DESTDIR= 39 PKG_DESTDIR=
39 40
40 shelldb="etc/shells" 41 shelldb="etc/shells"
41 shelldb_lock="$shelldb.lock" 42 shelldb_lock="$shelldb.lock"
42 43
43 datafile="datafile" 44 datafile="datafile"
44 ${CAT} > $datafile << EOF 45 ${CAT} > $datafile << EOF
45# SHELL: bin/pdksh $shelldb 46# SHELL: bin/pdksh $shelldb
46# SHELL: bin/bash $shelldb 47# SHELL: bin/bash $shelldb
47# SHELL: ${PKG_PREFIX}/bin/pdksh $shelldb 48# SHELL: ${PKG_PREFIX}/bin/pdksh $shelldb
48EOF 49EOF
49 
50 ${MKDIR} -p etc 
51} 50}
52 51
53test_destdir_setup() 52test_destdir_setup()
54{ 53{
55 : ${MKDIR:=mkdir} 
56 : ${MV:=mv} 54 : ${MV:=mv}
57 55
58 PKG_DESTDIR="${TEST_CURDIR}/destdir" 56 PKG_DESTDIR="${TEST_CURDIR}/destdir"
59 ${MKDIR} -p "${PKG_DESTDIR}${PKG_PREFIX}" 57 task_makedir "${PKG_DESTDIR}${PKG_PREFIX}"
60 ${MV} etc "${PKG_DESTDIR}${PKG_PREFIX}" 
61} 58}
62 59
63test1() 60test1()
64{ 61{
65 describe="check-add shells with empty shell database" 62 describe="check-add shells with empty shell database"
66 if task_shells check-add < $datafile; then 63 if task_shells check-add < $datafile; then
67 return 1 64 return 1
68 fi 65 fi
69 return 0 66 return 0
70} 67}
71 68
72test2() 69test2()
73{ 70{
@@ -162,26 +159,27 @@ test7() @@ -162,26 +159,27 @@ test7()
162 while read line; do 159 while read line; do
163 count="$count + 1" 160 count="$count + 1"
164 done < $shelldb 161 done < $shelldb
165 count=$(( $count )) 162 count=$(( $count ))
166 if [ $count -gt 0 ]; then 163 if [ $count -gt 0 ]; then
167 return 1 164 return 1
168 fi 165 fi
169 return 0 166 return 0
170} 167}
171 168
172test8() 169test8()
173{ 170{
174 describe="check-remove shells with empty shell database" 171 describe="check-remove shells with empty shell database"
 172 task_makedir "${shelldb%/*}"
175 task_createfile "$shelldb" 173 task_createfile "$shelldb"
176 if task_shells check-remove < $datafile; then 174 if task_shells check-remove < $datafile; then
177 : "success" 175 : "success"
178 else 176 else
179 return 1 177 return 1
180 fi 178 fi
181 if [ -f "$shelldb_lock" ]; then 179 if [ -f "$shelldb_lock" ]; then
182 describe="$describe: lock exists!" 180 describe="$describe: lock exists!"
183 return 1 181 return 1
184 fi 182 fi
185 return 0 183 return 0
186} 184}
187 185
@@ -309,26 +307,27 @@ test14() @@ -309,26 +307,27 @@ test14()
309 return 1 307 return 1
310 fi 308 fi
311 if [ -f "$shelldb" ]; then 309 if [ -f "$shelldb" ]; then
312 describe="$describe: $shelldb exists!" 310 describe="$describe: $shelldb exists!"
313 return 1 311 return 1
314 fi 312 fi
315 return 0 313 return 0
316} 314}
317 315
318test15() 316test15()
319{ 317{
320 describe="check-remove shells with empty shell database" 318 describe="check-remove shells with empty shell database"
321 test_destdir_setup 319 test_destdir_setup
 320 task_makedir "${PKG_DESTDIR}${PKG_PREFIX}/${shelldb%/*}"
322 task_createfile "${PKG_DESTDIR}${PKG_PREFIX}/$shelldb" 321 task_createfile "${PKG_DESTDIR}${PKG_PREFIX}/$shelldb"
323 if task_shells check-remove < $datafile; then 322 if task_shells check-remove < $datafile; then
324 : "success" 323 : "success"
325 else 324 else
326 return 1 325 return 1
327 fi 326 fi
328 if [ -f "${PKG_DESTDIR}${PKG_PREFIX}/$shelldb_lock" ]; then 327 if [ -f "${PKG_DESTDIR}${PKG_PREFIX}/$shelldb_lock" ]; then
329 describe="$describe: lock exists!" 328 describe="$describe: lock exists!"
330 return 1 329 return 1
331 fi 330 fi
332 if [ -f "$shelldb" ]; then 331 if [ -f "$shelldb" ]; then
333 describe="$describe: $shelldb exists!" 332 describe="$describe: $shelldb exists!"
334 return 1 333 return 1

File Added: pkgsrc/pkgtools/pkgtasks/files/t/t_icon_themes.sh
# Copyright (c) 2017 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Johnny C. Lam.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

task_load createfile
task_load icon_themes
task_load unittest

test_setup()
{
	: ${CAT:=cat}
	: ${MKDIR:=mkdir}

	PKG_PREFIX="${TEST_CURDIR}"
	PKG_DESTDIR=

	datafile="datafile"
	${CAT} > $datafile << EOF
# ICON_THEME: hicolor
# ICON_THEME: ${PKG_PREFIX}/share/icons/gnome
EOF

	${MKDIR} -p share/icons/hicolor
	${MKDIR} -p share/icons/gnome

	task_createfile share/icons/hicolor/index.theme
	task_createfile share/icons/gnome/index.theme

	GTK3_UPDATE_ICON_CACHE="mock_gtk_update_icon_cache"
	GTK2_UPDATE_ICON_CACHE="mock_gtk_update_icon_cache"
	GTK_UPDATE_ICON_CACHE="mock_gtk_update_icon_cache"
}

test_destdir_setup()
{
	: ${MKDIR:=mkdir}
	: ${MV:=mv}

	PKG_DESTDIR="${TEST_CURDIR}/destdir"
	${MKDIR} -p "${PKG_DESTDIR}${PKG_PREFIX}"
	${MV} share "${PKG_DESTDIR}${PKG_PREFIX}"
}

# Mock icon cache update command.
mock_gtk_update_icon_cache()
{
	while [ $# -gt 0 ]; do
		case $1 in
		-*)	shift ;;
		*)	break ;;
		esac
	done
	[ $# -gt 0 ] || return 127
	local themedir="$1"; shift
	local theme="$themedir/index.theme"
	local cache="$themedir/icon-theme.cache"

	[ -f "$theme" ] || return 1
	task_createfile "$cache"
}

test1()
{
	describe="add"
	if task_icon_themes add < $datafile; then
		: "success"
	else
		return 1
	fi
	# Assert the caches are all present.
	for themedir in hicolor gnome; do
		cache="${PKG_PREFIX}/share/icons/$themedir/icon-theme.cache"
		if [ ! -f "$cache" ]; then
			describe="$describe: $cache missing!"
			return 1
		fi
	done
	return 0
}

test2()
{
	: ${RM:=rm}

	describe="add with missing index.theme"
	local theme="${PKG_PREFIX}/share/icons/hicolor/index.theme"
	${RM} "$theme"
	if task_icon_themes add < $datafile; then
		# expected to fail
		return 1
	fi
	return 0
}

test3()
{
	describe="remove"
	task_icon_themes add < $datafile
	if task_icon_themes remove < $datafile; then
		: "success"
	else
		return 1
	fi
	# Assert the caches are gone.
	for themedir in hicolor gnome; do
		cache="${PKG_PREFIX}/share/icons/$themedir/icon-theme.cache"
		if [ -f "$cache" ]; then
			describe="$describe: $cache present!"
			return 1
		fi
	done
	return 0
}

test4()
{
	describe="remove with no caches"
	if task_icon_themes remove < $datafile; then
		: "success"
	else
		return 1
	fi
	# Assert the caches are gone.
	for themedir in hicolor gnome; do
		cache="${PKG_PREFIX}/share/icons/$themedir/icon-theme.cache"
		if [ -f "$cache" ]; then
			describe="$describe: $cache present!"
			return 1
		fi
	done
	return 0
}

test5()
{
	describe="remove during postremove"
	if task_icon_themes remove postremove < $datafile; then
		: "success"
	else
		return 1
	fi
	# Assert the caches have been recreated.
	for themedir in hicolor gnome; do
		cache="${PKG_PREFIX}/share/icons/$themedir/icon-theme.cache"
		if [ ! -f "$cache" ]; then
			describe="$describe: $cache missing!"
			return 1
		fi
	done
	return 0
}

test6()
{
	describe="add with PKG_DESTDIR"
	test_destdir_setup
	if task_icon_themes add < $datafile; then
		: "success"
	else
		return 1
	fi
	# Assert the caches are all present.
	for themedir in hicolor gnome; do
		cache="${PKG_PREFIX}/share/icons/$themedir/icon-theme.cache"
		cache="${PKG_DESTDIR}$cache"
		if [ ! -f "$cache" ]; then
			describe="$describe: $cache missing!"
			return 1
		fi
	done
	return 0
}

test7()
{
	: ${RM:=rm}

	describe="add with missing index.theme with PKG_DESTDIR"
	test_destdir_setup
	local theme="${PKG_PREFIX}/share/icons/hicolor/index.theme"
	theme="${PKG_DESTDIR}$theme"
	${RM} "$theme"
	if task_icon_themes add < $datafile; then
		# expected to fail
		return 1
	fi
	return 0
}

test8()
{
	describe="remove with PKG_DESTDIR"
	test_destdir_setup
	task_icon_themes add < $datafile
	if task_icon_themes remove < $datafile; then
		: "success"
	else
		return 1
	fi
	# Assert the caches are gone.
	for themedir in hicolor gnome; do
		cache="${PKG_PREFIX}/share/icons/$themedir/icon-theme.cache"
		cache="${PKG_DESTDIR}$cache"
		if [ -f "$cache" ]; then
			describe="$describe: $cache present!"
			return 1
		fi
	done
	return 0
}

test9()
{
	describe="remove with no caches with PKG_DESTDIR"
	test_destdir_setup
	if task_icon_themes remove < $datafile; then
		: "success"
	else
		return 1
	fi
	# Assert the caches are gone.
	for themedir in hicolor gnome; do
		cache="${PKG_PREFIX}/share/icons/$themedir/icon-theme.cache"
		cache="${PKG_DESTDIR}$cache"
		if [ -f "$cache" ]; then
			describe="$describe: $cache present!"
			return 1
		fi
	done
	return 0
}

test10()
{
	describe="remove during postremove with PKG_DESTDIR"
	if task_icon_themes remove postremove < $datafile; then
		: "success"
	else
		return 1
	fi
	# Assert the caches have been recreated.
	for themedir in hicolor gnome; do
		cache="${PKG_PREFIX}/share/icons/$themedir/icon-theme.cache"
		cache="${PKG_DESTDIR}$cache"
		if [ ! -f "$cache" ]; then
			describe="$describe: $cache missing!"
			return 1
		fi
	done
	return 0
}

task_run_tests "$@"