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.diff -r1.4 -r1.5 pkgsrc/pkgtools/pkgtasks/Makefile
(jlam)
@@ -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 | |||
3 | DISTNAME= pkgtasks-1-1.10 | 3 | DISTNAME= pkgtasks-1-1.13 | |
4 | CATEGORIES= pkgtools | 4 | CATEGORIES= pkgtools | |
5 | MASTER_SITES= # empty | 5 | MASTER_SITES= # empty | |
6 | DISTFILES= # empty | 6 | DISTFILES= # empty | |
7 | 7 | |||
8 | MAINTAINER= jlam@NetBSD.org | 8 | MAINTAINER= jlam@NetBSD.org | |
9 | HOMEPAGE= https://github.com/ultijlam/pkgtasks | 9 | HOMEPAGE= https://github.com/ultijlam/pkgtasks | |
10 | COMMENT= Package tasks | 10 | COMMENT= Package tasks | |
11 | LICENSE= 2-clause-bsd | 11 | LICENSE= 2-clause-bsd | |
12 | 12 | |||
13 | TEST_TARGET= check | 13 | TEST_TARGET= check | |
14 | USE_LANGUAGES= # empty | 14 | USE_LANGUAGES= # empty | |
15 | USE_TOOLS= sh | 15 | USE_TOOLS= sh | |
16 | 16 |
@@ -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 $ | |
2 | share/doc/${PKGBASE}/AUTHORS | 2 | share/doc/${PKGBASE}/AUTHORS | |
3 | share/doc/${PKGBASE}/COPYING | |||
4 | share/doc/${PKGBASE}/README.md | 3 | share/doc/${PKGBASE}/README.md | |
4 | share/doc/${PKGBASE}/NEWS.md | |||
5 | share/doc/${PKGBASE}/COPYING | |||
5 | share/${PKGBASE}/cleanup.subr | 6 | share/${PKGBASE}/cleanup.subr | |
6 | share/${PKGBASE}/compare.subr | 7 | share/${PKGBASE}/compare.subr | |
7 | share/${PKGBASE}/createfile.subr | 8 | share/${PKGBASE}/createfile.subr | |
8 | share/${PKGBASE}/directories.subr | 9 | share/${PKGBASE}/directories.subr | |
9 | share/${PKGBASE}/dirwalk.subr | 10 | share/${PKGBASE}/dirwalk.subr | |
10 | share/${PKGBASE}/echo.subr | 11 | share/${PKGBASE}/echo.subr | |
11 | share/${PKGBASE}/files.subr | 12 | share/${PKGBASE}/files.subr | |
12 | share/${PKGBASE}/fonts.subr | 13 | share/${PKGBASE}/fonts.subr | |
13 | share/${PKGBASE}/groups.subr | 14 | share/${PKGBASE}/groups.subr | |
15 | share/${PKGBASE}/icon_themes.subr | |||
14 | share/${PKGBASE}/info_files.subr | 16 | share/${PKGBASE}/info_files.subr | |
15 | share/${PKGBASE}/load.subr | 17 | share/${PKGBASE}/load.subr | |
16 | share/${PKGBASE}/lock.subr | 18 | share/${PKGBASE}/lock.subr | |
17 | share/${PKGBASE}/makedir.subr | 19 | share/${PKGBASE}/makedir.subr | |
18 | share/${PKGBASE}/maketemp.subr | 20 | share/${PKGBASE}/maketemp.subr | |
19 | share/${PKGBASE}/match.subr | 21 | share/${PKGBASE}/match.subr | |
20 | share/${PKGBASE}/ocaml_findlib.subr | 22 | share/${PKGBASE}/ocaml_findlib.subr | |
21 | share/${PKGBASE}/permissions.subr | 23 | share/${PKGBASE}/permissions.subr | |
22 | share/${PKGBASE}/platform.subr | 24 | share/${PKGBASE}/platform.subr | |
23 | share/${PKGBASE}/postinstall.subr | 25 | share/${PKGBASE}/postinstall.subr | |
24 | share/${PKGBASE}/postremove.subr | 26 | share/${PKGBASE}/postremove.subr | |
25 | share/${PKGBASE}/preinstall.subr | 27 | share/${PKGBASE}/preinstall.subr | |
26 | share/${PKGBASE}/preremove.subr | 28 | share/${PKGBASE}/preremove.subr | |
@@ -47,26 +49,27 @@ share/${PKGBASE}/users.subr | @@ -47,26 +49,27 @@ share/${PKGBASE}/users.subr | |||
47 | share/${PKGBASE}/valid_options.subr | 49 | share/${PKGBASE}/valid_options.subr | |
48 | share/${PKGBASE}/version.subr | 50 | share/${PKGBASE}/version.subr | |
49 | share/${PKGBASE}/which.subr | 51 | share/${PKGBASE}/which.subr | |
50 | tests/${PKGBASE}/Kyuafile | 52 | tests/${PKGBASE}/Kyuafile | |
51 | tests/${PKGBASE}/run_tests | 53 | tests/${PKGBASE}/run_tests | |
52 | tests/${PKGBASE}/t_compare | 54 | tests/${PKGBASE}/t_compare | |
53 | tests/${PKGBASE}/t_createfile | 55 | tests/${PKGBASE}/t_createfile | |
54 | tests/${PKGBASE}/t_directories | 56 | tests/${PKGBASE}/t_directories | |
55 | tests/${PKGBASE}/t_dirwalk | 57 | tests/${PKGBASE}/t_dirwalk | |
56 | tests/${PKGBASE}/t_echo | 58 | tests/${PKGBASE}/t_echo | |
57 | tests/${PKGBASE}/t_files | 59 | tests/${PKGBASE}/t_files | |
58 | tests/${PKGBASE}/t_fonts | 60 | tests/${PKGBASE}/t_fonts | |
59 | tests/${PKGBASE}/t_groups | 61 | tests/${PKGBASE}/t_groups | |
62 | tests/${PKGBASE}/t_icon_themes | |||
60 | tests/${PKGBASE}/t_info_files | 63 | tests/${PKGBASE}/t_info_files | |
61 | tests/${PKGBASE}/t_lock | 64 | tests/${PKGBASE}/t_lock | |
62 | tests/${PKGBASE}/t_makedir | 65 | tests/${PKGBASE}/t_makedir | |
63 | tests/${PKGBASE}/t_maketemp | 66 | tests/${PKGBASE}/t_maketemp | |
64 | tests/${PKGBASE}/t_match | 67 | tests/${PKGBASE}/t_match | |
65 | tests/${PKGBASE}/t_ocaml_findlib | 68 | tests/${PKGBASE}/t_ocaml_findlib | |
66 | tests/${PKGBASE}/t_permissions | 69 | tests/${PKGBASE}/t_permissions | |
67 | tests/${PKGBASE}/t_platform | 70 | tests/${PKGBASE}/t_platform | |
68 | tests/${PKGBASE}/t_postinstall | 71 | tests/${PKGBASE}/t_postinstall | |
69 | tests/${PKGBASE}/t_postremove | 72 | tests/${PKGBASE}/t_postremove | |
70 | tests/${PKGBASE}/t_preinstall | 73 | tests/${PKGBASE}/t_preinstall | |
71 | tests/${PKGBASE}/t_preremove | 74 | tests/${PKGBASE}/t_preremove | |
72 | tests/${PKGBASE}/t_quote | 75 | tests/${PKGBASE}/t_quote |
@@ -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 | |||
28 | doc_DATA = AUTHORS COPYING README.md | 28 | doc_DATA = AUTHORS COPYING NEWS.md README.md | |
29 | noinst_DATA = README.md | 29 | noinst_DATA = README.md | |
30 | EXTRA_DIST = $(doc_DATA) | 30 | EXTRA_DIST = $(doc_DATA) | |
31 | MAINTAINERCLEANFILES = Makefile.in aclocal.m4 | |||
32 | MAINTAINERCLEANFILES += build-aux/install-sh build-aux/missing | |||
33 | MAINTAINERCLEANFILES += configure $(DIST_ARCHIVES) | |||
31 | 34 | |||
32 | PHONY_TARGETS = | 35 | PHONY_TARGETS = | |
33 | 36 | |||
34 | CHMOD = chmod | 37 | CHMOD = chmod | |
35 | MV = mv | 38 | MV = 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. | |
38 | BUILD_FILE = \ | 41 | BUILD_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 | |||
46 | BUILD_SCRIPT = $(BUILD_FILE) && $(CHMOD) +x "$$target" | 49 | BUILD_SCRIPT = $(BUILD_FILE) && $(CHMOD) +x "$$target" | |
47 | 50 | |||
48 | dist_pkgdata_DATA = cleanup.subr | 51 | dist_pkgdata_DATA = cleanup.subr | |
49 | dist_pkgdata_DATA += compare.subr | 52 | dist_pkgdata_DATA += compare.subr | |
50 | dist_pkgdata_DATA += createfile.subr | 53 | dist_pkgdata_DATA += createfile.subr | |
51 | dist_pkgdata_DATA += directories.subr | 54 | dist_pkgdata_DATA += directories.subr | |
52 | dist_pkgdata_DATA += dirwalk.subr | 55 | dist_pkgdata_DATA += dirwalk.subr | |
53 | dist_pkgdata_DATA += echo.subr | 56 | dist_pkgdata_DATA += echo.subr | |
54 | dist_pkgdata_DATA += files.subr | 57 | dist_pkgdata_DATA += files.subr | |
55 | dist_pkgdata_DATA += fonts.subr | 58 | dist_pkgdata_DATA += fonts.subr | |
56 | dist_pkgdata_DATA += groups.subr | 59 | dist_pkgdata_DATA += groups.subr | |
60 | dist_pkgdata_DATA += icon_themes.subr | |||
57 | dist_pkgdata_DATA += info_files.subr | 61 | dist_pkgdata_DATA += info_files.subr | |
58 | dist_pkgdata_DATA += load.subr | 62 | dist_pkgdata_DATA += load.subr | |
59 | dist_pkgdata_DATA += lock.subr | 63 | dist_pkgdata_DATA += lock.subr | |
60 | dist_pkgdata_DATA += makedir.subr | 64 | dist_pkgdata_DATA += makedir.subr | |
61 | dist_pkgdata_DATA += maketemp.subr | 65 | dist_pkgdata_DATA += maketemp.subr | |
62 | dist_pkgdata_DATA += match.subr | 66 | dist_pkgdata_DATA += match.subr | |
63 | dist_pkgdata_DATA += ocaml_findlib.subr | 67 | dist_pkgdata_DATA += ocaml_findlib.subr | |
64 | dist_pkgdata_DATA += permissions.subr | 68 | dist_pkgdata_DATA += permissions.subr | |
65 | dist_pkgdata_DATA += platform.subr | 69 | dist_pkgdata_DATA += platform.subr | |
66 | dist_pkgdata_DATA += postinstall.subr | 70 | dist_pkgdata_DATA += postinstall.subr | |
67 | dist_pkgdata_DATA += postremove.subr | 71 | dist_pkgdata_DATA += postremove.subr | |
68 | dist_pkgdata_DATA += preinstall.subr | 72 | dist_pkgdata_DATA += preinstall.subr | |
69 | dist_pkgdata_DATA += preremove.subr | 73 | dist_pkgdata_DATA += preremove.subr | |
@@ -174,26 +178,34 @@ EXTRA_DIST += t/t_fonts.sh | @@ -174,26 +178,34 @@ EXTRA_DIST += t/t_fonts.sh | |||
174 | t/t_fonts: t/t_fonts.sh t/build_test | 178 | t/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 | |||
179 | pkgtests_SCRIPTS += t/t_groups | 183 | pkgtests_SCRIPTS += t/t_groups | |
180 | CLEANFILES += t/t_groups | 184 | CLEANFILES += t/t_groups | |
181 | EXTRA_DIST += t/t_groups.sh | 185 | EXTRA_DIST += t/t_groups.sh | |
182 | t/t_groups: t/t_groups.sh t/build_test | 186 | t/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 | |||
191 | pkgtests_SCRIPTS += t/t_icon_themes | |||
192 | CLEANFILES += t/t_icon_themes | |||
193 | EXTRA_DIST += t/t_icon_themes.sh | |||
194 | t/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 | ||||
187 | pkgtests_SCRIPTS += t/t_info_files | 199 | pkgtests_SCRIPTS += t/t_info_files | |
188 | CLEANFILES += t/t_info_files | 200 | CLEANFILES += t/t_info_files | |
189 | EXTRA_DIST += t/t_info_files.sh | 201 | EXTRA_DIST += t/t_info_files.sh | |
190 | t/t_info_files: t/t_info_files.sh t/build_test | 202 | t/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 | |||
195 | pkgtests_SCRIPTS += t/t_lock | 207 | pkgtests_SCRIPTS += t/t_lock | |
196 | CLEANFILES += t/t_lock | 208 | CLEANFILES += t/t_lock | |
197 | EXTRA_DIST += t/t_lock.sh | 209 | EXTRA_DIST += t/t_lock.sh | |
198 | t/t_lock: t/t_lock.sh t/build_test | 210 | t/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 | |||
480 | installcheck-kyua: | 492 | installcheck-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 | |
488 | else # HAVE_KYUA | 500 | else # HAVE_KYUA | |
489 | check-local: check-run-tests | 501 | check-local: check-run-tests | |
490 | installcheck-local: installcheck-run-tests | 502 | installcheck-local: installcheck-run-tests | |
491 | endif # HAVE_KYUA | 503 | endif # HAVE_KYUA | |
492 | 504 | |||
493 | maintainer-clean-local: | 505 | # Duplicate Automake's check-news target, but verify NEWS.md instead of NEWS. | |
494 | -rm -f Makefile.in aclocal.m4 configure | 506 | dist-hook: check-news-local | |
495 | -rm -f build-aux/install-sh build-aux/missing | 507 | PHONY_TARGETS += check-news-local | |
496 | -rm -f $(PACKAGE)-*.tar.* | 508 | check-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 |
@@ -270,98 +270,103 @@ pdfdir = @pdfdir@ | @@ -270,98 +270,103 @@ pdfdir = @pdfdir@ | |||
270 | pkgtestsdir = @pkgtestsdir@ | 270 | pkgtestsdir = @pkgtestsdir@ | |
271 | prefix = @prefix@ | 271 | prefix = @prefix@ | |
272 | program_transform_name = @program_transform_name@ | 272 | program_transform_name = @program_transform_name@ | |
273 | psdir = @psdir@ | 273 | psdir = @psdir@ | |
274 | sbindir = @sbindir@ | 274 | sbindir = @sbindir@ | |
275 | sharedstatedir = @sharedstatedir@ | 275 | sharedstatedir = @sharedstatedir@ | |
276 | srcdir = @srcdir@ | 276 | srcdir = @srcdir@ | |
277 | sysconfdir = @sysconfdir@ | 277 | sysconfdir = @sysconfdir@ | |
278 | target_alias = @target_alias@ | 278 | target_alias = @target_alias@ | |
279 | testsdir = @testsdir@ | 279 | testsdir = @testsdir@ | |
280 | top_build_prefix = @top_build_prefix@ | 280 | top_build_prefix = @top_build_prefix@ | |
281 | top_builddir = @top_builddir@ | 281 | top_builddir = @top_builddir@ | |
282 | top_srcdir = @top_srcdir@ | 282 | top_srcdir = @top_srcdir@ | |
283 | doc_DATA = AUTHORS COPYING README.md | 283 | doc_DATA = AUTHORS COPYING NEWS.md README.md | |
284 | noinst_DATA = README.md | 284 | noinst_DATA = README.md | |
285 | EXTRA_DIST = $(doc_DATA) version.subr.in t/build_test.sh \ | 285 | EXTRA_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 | |
299 | PHONY_TARGETS = check-run-tets installcheck-run-tests $(am__append_1) | 299 | MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/install-sh \ | |
300 | build-aux/missing configure $(DIST_ARCHIVES) | |||
301 | PHONY_TARGETS = check-run-tets installcheck-run-tests $(am__append_1) \ | |||
302 | check-news-local | |||
300 | CHMOD = chmod | 303 | CHMOD = chmod | |
301 | MV = mv | 304 | MV = 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. | |
304 | BUILD_FILE = \ | 307 | BUILD_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 | |||
312 | BUILD_SCRIPT = $(BUILD_FILE) && $(CHMOD) +x "$$target" | 315 | BUILD_SCRIPT = $(BUILD_FILE) && $(CHMOD) +x "$$target" | |
313 | dist_pkgdata_DATA = cleanup.subr compare.subr createfile.subr \ | 316 | dist_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 | |
325 | pkgdata_DATA = version.subr | 329 | pkgdata_DATA = version.subr | |
326 | CLEANFILES = version.subr t/build_test t/run_tests t/t_compare \ | 330 | CLEANFILES = 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. | |
339 | BUILD_TEST = \ | 343 | BUILD_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 | |||
343 | dist_pkgtests_DATA = t/Kyuafile | 347 | dist_pkgtests_DATA = t/Kyuafile | |
344 | noinst_SCRIPTS = t/build_test | 348 | noinst_SCRIPTS = t/build_test | |
345 | pkgtests_SCRIPTS = t/run_tests t/t_compare t/t_createfile \ | 349 | pkgtests_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 | |||
367 | all: all-am | 372 | all: 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)" | |
568 | dist-gzip: distdir | 576 | dist-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 | |||
572 | dist-bzip2: distdir | 580 | dist-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 | |
719 | mostlyclean-generic: | 727 | mostlyclean-generic: | |
720 | 728 | |||
721 | clean-generic: | 729 | clean-generic: | |
722 | -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) | 730 | -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) | |
723 | 731 | |||
724 | distclean-generic: | 732 | distclean-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 | |||
728 | maintainer-clean-generic: | 736 | maintainer-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) | |||
731 | clean: clean-am | 740 | clean: clean-am | |
732 | 741 | |||
733 | clean-am: clean-generic mostlyclean-am | 742 | clean-am: clean-generic mostlyclean-am | |
734 | 743 | |||
735 | distclean: distclean-am | 744 | distclean: distclean-am | |
736 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) | 745 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) | |
737 | -rm -f Makefile | 746 | -rm -f Makefile | |
738 | distclean-am: clean-am distclean-generic | 747 | distclean-am: clean-am distclean-generic | |
739 | 748 | |||
740 | dvi: dvi-am | 749 | dvi: dvi-am | |
741 | 750 | |||
742 | dvi-am: | 751 | dvi-am: | |
743 | 752 | |||
@@ -772,65 +781,64 @@ install-pdf: install-pdf-am | @@ -772,65 +781,64 @@ install-pdf: install-pdf-am | |||
772 | 781 | |||
773 | install-pdf-am: | 782 | install-pdf-am: | |
774 | 783 | |||
775 | install-ps: install-ps-am | 784 | install-ps: install-ps-am | |
776 | 785 | |||
777 | install-ps-am: | 786 | install-ps-am: | |
778 | 787 | |||
779 | installcheck-am: installcheck-local | 788 | installcheck-am: installcheck-local | |
780 | 789 | |||
781 | maintainer-clean: maintainer-clean-am | 790 | maintainer-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 | |
785 | maintainer-clean-am: distclean-am maintainer-clean-generic \ | 794 | maintainer-clean-am: distclean-am maintainer-clean-generic | |
786 | maintainer-clean-local | |||
787 | 795 | |||
788 | mostlyclean: mostlyclean-am | 796 | mostlyclean: mostlyclean-am | |
789 | 797 | |||
790 | mostlyclean-am: mostlyclean-generic | 798 | mostlyclean-am: mostlyclean-generic | |
791 | 799 | |||
792 | pdf: pdf-am | 800 | pdf: pdf-am | |
793 | 801 | |||
794 | pdf-am: | 802 | pdf-am: | |
795 | 803 | |||
796 | ps: ps-am | 804 | ps: ps-am | |
797 | 805 | |||
798 | ps-am: | 806 | ps-am: | |
799 | 807 | |||
800 | uninstall-am: uninstall-dist_pkgdataDATA uninstall-dist_pkgtestsDATA \ | 808 | uninstall-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 | |||
827 | version.subr: version.subr.in | 835 | version.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) | |
831 | t/build_test: t/build_test.sh | 839 | t/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) | |
835 | t/run_tests: t/run_tests.sh | 843 | t/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) | |
859 | t/t_files: t/t_files.sh t/build_test | 867 | t/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) | |
863 | t/t_fonts: t/t_fonts.sh t/build_test | 871 | t/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) | |
867 | t/t_groups: t/t_groups.sh t/build_test | 875 | t/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) | |
879 | t/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) | |||
871 | t/t_info_files: t/t_info_files.sh t/build_test | 883 | t/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) | |
875 | t/t_lock: t/t_lock.sh t/build_test | 887 | t/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) | |
879 | t/t_makedir: t/t_makedir.sh t/build_test | 891 | t/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) | |
883 | t/t_maketemp: t/t_maketemp.sh t/build_test | 895 | t/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 | |||
1027 | maintainer-clean-local: | 1039 | # Duplicate Automake's check-news target, but verify NEWS.md instead of NEWS. | |
1028 | -rm -f Makefile.in aclocal.m4 configure | 1040 | dist-hook: check-news-local | |
1029 | -rm -f build-aux/install-sh build-aux/missing | 1041 | check-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: |
@@ -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 | |||
20 | Package tasks have the property of *idempotence* -- they may be invoked | 20 | Package tasks have the property of *idempotence* -- they may be invoked | |
21 | multiple times, but the result must be the same as when invoked once, e.g., | 21 | multiple times, but the result must be the same as when invoked once, e.g., | |
22 | the `shells` task adds an entry to /etc/shells, but will avoid adding the | 22 | the `shells` task adds an entry to /etc/shells, but will avoid adding the | |
23 | same entry more than once. | 23 | same entry more than once. | |
24 | 24 | |||
25 | 25 | |||
26 | Getting sources | 26 | Getting sources | |
27 | --------------- | 27 | --------------- | |
28 | 28 | |||
29 | The latest version of *pkgtasks* is 1.10 and was released on June 3rd, 2017. | 29 | The latest version of *pkgtasks* is 1.13 and was released on August 8th, 2017. | |
30 | 30 | |||
31 | See the [release notes](NEWS.md) for information about the changes in this | 31 | See the [release notes](NEWS.md) for information about the changes in this | |
32 | and all previous releases. | 32 | and all previous releases. | |
33 | 33 | |||
34 | 34 | |||
35 | Documentation | 35 | Documentation | |
36 | ------------- | 36 | ------------- | |
37 | 37 | |||
38 | A script may load task modules to define shell functions to perform | 38 | A script may load task modules to define shell functions to perform | |
39 | various tasks. A task module is loaded in a POSIX-compliant shell script | 39 | various tasks. A task module is loaded in a POSIX-compliant shell script | |
40 | by adding the following boilerplate to the script: | 40 | by 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 | |||
49 | The individual package tasks supported by *pkgtasks* are: | 49 | The 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 | |||
62 | These package tasks support `${PKG_DESTDIR}` to manipulate the correct | 63 | These package tasks support `${PKG_DESTDIR}` to manipulate the correct | |
63 | filesystem paths for a destdir-installed package. | 64 | filesystem paths for a destdir-installed package. | |
64 | 65 | |||
65 | For convenience, these have been composed into larger meta-tasks: | 66 | For 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 |
@@ -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 | # | |
571 | ac_default_prefix=/usr/local | 571 | ac_default_prefix=/usr/local | |
572 | ac_clean_files= | 572 | ac_clean_files= | |
573 | ac_config_libobj_dir=. | 573 | ac_config_libobj_dir=. | |
574 | LIBOBJS= | 574 | LIBOBJS= | |
575 | cross_compiling=no | 575 | cross_compiling=no | |
576 | subdirs= | 576 | subdirs= | |
577 | MFLAGS= | 577 | MFLAGS= | |
578 | MAKEFLAGS= | 578 | MAKEFLAGS= | |
579 | 579 | |||
580 | # Identity of this package. | 580 | # Identity of this package. | |
581 | PACKAGE_NAME='pkgtasks-1' | 581 | PACKAGE_NAME='pkgtasks-1' | |
582 | PACKAGE_TARNAME='pkgtasks-1' | 582 | PACKAGE_TARNAME='pkgtasks-1' | |
583 | PACKAGE_VERSION='1.10' | 583 | PACKAGE_VERSION='1.13' | |
584 | PACKAGE_STRING='pkgtasks-1 1.10' | 584 | PACKAGE_STRING='pkgtasks-1 1.13' | |
585 | PACKAGE_BUGREPORT='jlam@NetBSD.org' | 585 | PACKAGE_BUGREPORT='jlam@NetBSD.org' | |
586 | PACKAGE_URL='' | 586 | PACKAGE_URL='' | |
587 | 587 | |||
588 | ac_unique_file="load.subr" | 588 | ac_unique_file="load.subr" | |
589 | ac_subst_vars='LTLIBOBJS | 589 | ac_subst_vars='LTLIBOBJS | |
590 | LIBOBJS | 590 | LIBOBJS | |
591 | pkgtestsdir | 591 | pkgtestsdir | |
592 | testsdir | 592 | testsdir | |
593 | SED | 593 | SED | |
594 | HAVE_KYUA_FALSE | 594 | HAVE_KYUA_FALSE | |
595 | HAVE_KYUA_TRUE | 595 | HAVE_KYUA_TRUE | |
596 | KYUA | 596 | KYUA | |
597 | POSIX_SHELL | 597 | POSIX_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} | |
1203 | done | 1203 | done | |
1204 | 1204 | |||
1205 | # | 1205 | # | |
1206 | # Report the --help message. | 1206 | # Report the --help message. | |
1207 | # | 1207 | # | |
1208 | if test "$ac_init_help" = "long"; then | 1208 | if 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 | |||
1214 | Usage: $0 [OPTION]... [VAR=VALUE]... | 1214 | Usage: $0 [OPTION]... [VAR=VALUE]... | |
1215 | 1215 | |||
1216 | To assign environment variables (e.g., CC, CFLAGS...), specify them as | 1216 | To assign environment variables (e.g., CC, CFLAGS...), specify them as | |
1217 | VAR=VALUE. See below for descriptions of some of the useful variables. | 1217 | VAR=VALUE. See below for descriptions of some of the useful variables. | |
1218 | 1218 | |||
1219 | Defaults for the options are specified in brackets. | 1219 | Defaults for the options are specified in brackets. | |
1220 | 1220 | |||
1221 | Configuration: | 1221 | Configuration: | |
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 | |||
1269 | Program names: | 1269 | Program 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 | |
1274 | fi | 1274 | fi | |
1275 | 1275 | |||
1276 | if test -n "$ac_init_help"; then | 1276 | if 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 | |||
1282 | Optional Features: | 1282 | Optional 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 | |||
1289 | Some influential environment variables: | 1289 | Some 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 | |
1353 | fi | 1353 | fi | |
1354 | 1354 | |||
1355 | test -n "$ac_init_help" && exit $ac_status | 1355 | test -n "$ac_init_help" && exit $ac_status | |
1356 | if $ac_init_version; then | 1356 | if $ac_init_version; then | |
1357 | cat <<\_ACEOF | 1357 | cat <<\_ACEOF | |
1358 | pkgtasks-1 configure 1.10 | 1358 | pkgtasks-1 configure 1.13 | |
1359 | generated by GNU Autoconf 2.69 | 1359 | generated by GNU Autoconf 2.69 | |
1360 | 1360 | |||
1361 | Copyright (C) 2012 Free Software Foundation, Inc. | 1361 | Copyright (C) 2012 Free Software Foundation, Inc. | |
1362 | This configure script is free software; the Free Software Foundation | 1362 | This configure script is free software; the Free Software Foundation | |
1363 | gives unlimited permission to copy, distribute and modify it. | 1363 | gives unlimited permission to copy, distribute and modify it. | |
1364 | _ACEOF | 1364 | _ACEOF | |
1365 | exit | 1365 | exit | |
1366 | fi | 1366 | fi | |
1367 | 1367 | |||
1368 | ## ------------------------ ## | 1368 | ## ------------------------ ## | |
1369 | ## Autoconf initialization. ## | 1369 | ## Autoconf initialization. ## | |
1370 | ## ------------------------ ## | 1370 | ## ------------------------ ## | |
1371 | cat >config.log <<_ACEOF | 1371 | cat >config.log <<_ACEOF | |
1372 | This file contains any messages produced by compilers while | 1372 | This file contains any messages produced by compilers while | |
1373 | running configure, to aid debugging if configure makes a mistake. | 1373 | running configure, to aid debugging if configure makes a mistake. | |
1374 | 1374 | |||
1375 | It was created by pkgtasks-1 $as_me 1.10, which was | 1375 | It was created by pkgtasks-1 $as_me 1.13, which was | |
1376 | generated by GNU Autoconf 2.69. Invocation command line was | 1376 | generated by GNU Autoconf 2.69. Invocation command line was | |
1377 | 1377 | |||
1378 | $ $0 $@ | 1378 | $ $0 $@ | |
1379 | 1379 | |||
1380 | _ACEOF | 1380 | _ACEOF | |
1381 | exec 5>>config.log | 1381 | exec 5>>config.log | |
1382 | { | 1382 | { | |
1383 | cat <<_ASUNAME | 1383 | cat <<_ASUNAME | |
1384 | ## --------- ## | 1384 | ## --------- ## | |
1385 | ## Platform. ## | 1385 | ## Platform. ## | |
1386 | ## --------- ## | 1386 | ## --------- ## | |
1387 | 1387 | |||
1388 | hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` | 1388 | hostname = `(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 | |
2234 | if test -z "$CYGPATH_W"; then | 2234 | if 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 | |
2240 | fi | 2240 | fi | |
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 | |||
2248 | cat >>confdefs.h <<_ACEOF | 2248 | cat >>confdefs.h <<_ACEOF | |
2249 | #define PACKAGE "$PACKAGE" | 2249 | #define PACKAGE "$PACKAGE" | |
2250 | _ACEOF | 2250 | _ACEOF | |
2251 | 2251 | |||
2252 | 2252 | |||
2253 | cat >>confdefs.h <<_ACEOF | 2253 | cat >>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 | |||
3069 | exec 6>&1 | 3069 | exec 6>&1 | |
3070 | ## ----------------------------------- ## | 3070 | ## ----------------------------------- ## | |
3071 | ## Main body of $CONFIG_STATUS script. ## | 3071 | ## Main body of $CONFIG_STATUS script. ## | |
3072 | ## ----------------------------------- ## | 3072 | ## ----------------------------------- ## | |
3073 | _ASEOF | 3073 | _ASEOF | |
3074 | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 | 3074 | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 | |
3075 | 3075 | |||
3076 | cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 | 3076 | cat >>$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. | |
3080 | ac_log=" | 3080 | ac_log=" | |
3081 | This file was extended by pkgtasks-1 $as_me 1.10, which was | 3081 | This file was extended by pkgtasks-1 $as_me 1.13, which was | |
3082 | generated by GNU Autoconf 2.69. Invocation command line was | 3082 | generated 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 | |||
3090 | on `(hostname || uname -n) 2>/dev/null | sed 1q` | 3090 | on `(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 | |||
3125 | Configuration files: | 3125 | Configuration files: | |
3126 | $config_files | 3126 | $config_files | |
3127 | 3127 | |||
3128 | Report bugs to <jlam@NetBSD.org>." | 3128 | Report bugs to <jlam@NetBSD.org>." | |
3129 | 3129 | |||
3130 | _ACEOF | 3130 | _ACEOF | |
3131 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | 3131 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 | |
3132 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" | 3132 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" | |
3133 | ac_cs_version="\\ | 3133 | ac_cs_version="\\ | |
3134 | pkgtasks-1 config.status 1.10 | 3134 | pkgtasks-1 config.status 1.13 | |
3135 | configured by $0, generated by GNU Autoconf 2.69, | 3135 | configured by $0, generated by GNU Autoconf 2.69, | |
3136 | with options \\"\$ac_cs_config\\" | 3136 | with options \\"\$ac_cs_config\\" | |
3137 | 3137 | |||
3138 | Copyright (C) 2012 Free Software Foundation, Inc. | 3138 | Copyright (C) 2012 Free Software Foundation, Inc. | |
3139 | This config.status script is free software; the Free Software Foundation | 3139 | This config.status script is free software; the Free Software Foundation | |
3140 | gives unlimited permission to copy, distribute and modify it." | 3140 | gives unlimited permission to copy, distribute and modify it." | |
3141 | 3141 | |||
3142 | ac_pwd='$ac_pwd' | 3142 | ac_pwd='$ac_pwd' | |
3143 | srcdir='$srcdir' | 3143 | srcdir='$srcdir' | |
3144 | INSTALL='$INSTALL' | 3144 | INSTALL='$INSTALL' | |
3145 | MKDIR_P='$MKDIR_P' | 3145 | MKDIR_P='$MKDIR_P' | |
3146 | AWK='$AWK' | 3146 | AWK='$AWK' | |
3147 | test -n "\$AWK" || AWK=awk | 3147 | test -n "\$AWK" || AWK=awk |
@@ -16,27 +16,27 @@ dnl | @@ -16,27 +16,27 @@ dnl | |||
16 | dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 16 | dnl THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
17 | dnl ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 17 | dnl ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
18 | dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 18 | dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
19 | dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 19 | dnl PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
20 | dnl BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | dnl BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | dnl POSSIBILITY OF SUCH DAMAGE. | 26 | dnl POSSIBILITY OF SUCH DAMAGE. | |
27 | dnl | 27 | dnl | |
28 | 28 | |||
29 | AC_INIT([pkgtasks-1], [1.10], [jlam@NetBSD.org]) | 29 | AC_INIT([pkgtasks-1], [1.13], [jlam@NetBSD.org]) | |
30 | 30 | |||
31 | 31 | |||
32 | AC_CONFIG_AUX_DIR([build-aux]) | 32 | AC_CONFIG_AUX_DIR([build-aux]) | |
33 | AC_CONFIG_SRCDIR([load.subr]) | 33 | AC_CONFIG_SRCDIR([load.subr]) | |
34 | AC_CONFIG_FILES([Makefile]) | 34 | AC_CONFIG_FILES([Makefile]) | |
35 | 35 | |||
36 | 36 | |||
37 | AM_INIT_AUTOMAKE([foreign subdir-objects -Wall]) | 37 | AM_INIT_AUTOMAKE([foreign subdir-objects -Wall]) | |
38 | 38 | |||
39 | 39 | |||
40 | AC_ARG_VAR([POSIX_SHELL], [Location of the POSIX shell interpreter to use]) | 40 | AC_ARG_VAR([POSIX_SHELL], [Location of the POSIX shell interpreter to use]) | |
41 | if test "${POSIX_SHELL}" = ""; then | 41 | if test "${POSIX_SHELL}" = ""; then | |
42 | AC_PATH_PROGS(POSIX_SHELL, [ksh bash sh]) | 42 | AC_PATH_PROGS(POSIX_SHELL, [ksh bash sh]) |
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.
# 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__=
@@ -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 | |||
103 | task_load cleanup | 106 | task_load cleanup | |
104 | task_load echo | 107 | task_load echo | |
105 | task_load dirwalk | 108 | task_load dirwalk |
@@ -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 |
@@ -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 |
@@ -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. |
@@ -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 | |||
102 | task_load cleanup | 102 | task_load cleanup | |
103 | task_load echo | 103 | task_load echo | |
104 | task_load lock | 104 | task_load lock | |
105 | task_load makedir | |||
105 | task_load maketemp | 106 | task_load maketemp | |
106 | task_load match | 107 | task_load match | |
107 | task_load quote | 108 | task_load quote | |
108 | 109 | |||
109 | task_ocaml_findlib() | 110 | task_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" |
@@ -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 | |||
59 | task_load directories | 60 | task_load directories | |
60 | task_load files | 61 | task_load files | |
61 | task_load fonts | 62 | task_load fonts | |
63 | task_load icon_themes | |||
62 | task_load info_files | 64 | task_load info_files | |
63 | task_load ocaml_findlib | 65 | task_load ocaml_findlib | |
64 | task_load permissions | 66 | task_load permissions | |
65 | task_load shells | 67 | task_load shells | |
66 | task_load shlibs | 68 | task_load shlibs | |
67 | task_load sort | 69 | task_load sort | |
68 | task_load taskfunc | 70 | task_load taskfunc | |
69 | 71 | |||
70 | task_postinstall() | 72 | task_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 |
@@ -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 | |||
58 | task_load directories | 59 | task_load directories | |
59 | task_load files | 60 | task_load files | |
60 | task_load fonts | 61 | task_load fonts | |
61 | task_load groups | 62 | task_load groups | |
63 | task_load icon_themes | |||
62 | task_load info_files | 64 | task_load info_files | |
63 | task_load ocaml_findlib | 65 | task_load ocaml_findlib | |
64 | task_load shells | 66 | task_load shells | |
65 | task_load shlibs | 67 | task_load shlibs | |
66 | task_load sort | 68 | task_load sort | |
67 | task_load taskfunc | 69 | task_load taskfunc | |
68 | task_load users | 70 | task_load users | |
69 | 71 | |||
70 | task_postremove() | 72 | task_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 ;; |
@@ -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 | |||
53 | task_load files | 54 | task_load files | |
55 | task_load icon_themes | |||
54 | task_load info_files | 56 | task_load info_files | |
55 | task_load sort | 57 | task_load sort | |
56 | task_load taskfunc | 58 | task_load taskfunc | |
57 | 59 | |||
58 | task_preremove() | 60 | task_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 |
@@ -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 | |||
101 | task_load cleanup | 101 | task_load cleanup | |
102 | task_load echo | 102 | task_load echo | |
103 | task_load lock | 103 | task_load lock | |
104 | task_load makedir | |||
104 | task_load maketemp | 105 | task_load maketemp | |
105 | task_load match | 106 | task_load match | |
106 | task_load quote | 107 | task_load quote | |
107 | task_load truthy | 108 | task_load truthy | |
108 | 109 | |||
109 | task_shells() | 110 | task_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 |
@@ -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 |
@@ -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 |
@@ -40,26 +40,27 @@ POSSIBILITY OF SUCH DAMAGE. | @@ -40,26 +40,27 @@ POSSIBILITY OF SUCH DAMAGE. | |||
40 | 40 | |||
41 | syntax( 2 ) | 41 | syntax( 2 ) | |
42 | 42 | |||
43 | test_suite( "pkgtasks" ) | 43 | test_suite( "pkgtasks" ) | |
44 | 44 | |||
45 | tap_test_program { name = "t_compare" } | 45 | tap_test_program { name = "t_compare" } | |
46 | tap_test_program { name = "t_createfile" } | 46 | tap_test_program { name = "t_createfile" } | |
47 | tap_test_program { name = "t_directories" } | 47 | tap_test_program { name = "t_directories" } | |
48 | tap_test_program { name = "t_dirwalk" } | 48 | tap_test_program { name = "t_dirwalk" } | |
49 | tap_test_program { name = "t_echo" } | 49 | tap_test_program { name = "t_echo" } | |
50 | tap_test_program { name = "t_files" } | 50 | tap_test_program { name = "t_files" } | |
51 | tap_test_program { name = "t_fonts" } | 51 | tap_test_program { name = "t_fonts" } | |
52 | tap_test_program { name = "t_groups" } | 52 | tap_test_program { name = "t_groups" } | |
53 | tap_test_program { name = "t_icon_themes" } | |||
53 | tap_test_program { name = "t_info_files" } | 54 | tap_test_program { name = "t_info_files" } | |
54 | tap_test_program { name = "t_lock" } | 55 | tap_test_program { name = "t_lock" } | |
55 | tap_test_program { name = "t_makedir" } | 56 | tap_test_program { name = "t_makedir" } | |
56 | tap_test_program { name = "t_maketemp" } | 57 | tap_test_program { name = "t_maketemp" } | |
57 | tap_test_program { name = "t_match" } | 58 | tap_test_program { name = "t_match" } | |
58 | tap_test_program { name = "t_ocaml_findlib" } | 59 | tap_test_program { name = "t_ocaml_findlib" } | |
59 | tap_test_program { name = "t_permissions" } | 60 | tap_test_program { name = "t_permissions" } | |
60 | tap_test_program { name = "t_platform" } | 61 | tap_test_program { name = "t_platform" } | |
61 | tap_test_program { name = "t_postinstall" } | 62 | tap_test_program { name = "t_postinstall" } | |
62 | tap_test_program { name = "t_postremove" } | 63 | tap_test_program { name = "t_postremove" } | |
63 | tap_test_program { name = "t_preinstall" } | 64 | tap_test_program { name = "t_preinstall" } | |
64 | tap_test_program { name = "t_preremove" } | 65 | tap_test_program { name = "t_preremove" } | |
65 | tap_test_program { name = "t_quote" } | 66 | tap_test_program { name = "t_quote" } |
@@ -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 | |||
28 | task_load createfile | 28 | task_load createfile | |
29 | task_load makedir | |||
29 | task_load ocaml_findlib | 30 | task_load ocaml_findlib | |
30 | task_load unittest | 31 | task_load unittest | |
31 | 32 | |||
32 | test_setup() | 33 | test_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 | |
48 | EOF | 49 | EOF | |
49 | } | 50 | } | |
50 | 51 | |||
51 | test_destdir_setup() | 52 | test_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 | |||
60 | test1() | 60 | test1() | |
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 | |||
69 | test2() | 69 | test2() | |
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 | |||
174 | test8() | 174 | test8() | |
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 | |||
325 | test15() | 326 | test15() | |
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 |
@@ -28,26 +28,27 @@ | @@ -28,26 +28,27 @@ | |||
28 | task_load createfile | 28 | task_load createfile | |
29 | task_load postinstall | 29 | task_load postinstall | |
30 | task_load unittest | 30 | task_load unittest | |
31 | 31 | |||
32 | test_setup() | 32 | test_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. | |
49 | task_directories() | 50 | task_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 | |||
59 | task_fonts() | 60 | task_fonts() | |
60 | { | 61 | { | |
61 | [ "${TASK_FONTS_SUCCESS}" = "yes" ] | 62 | [ "${TASK_FONTS_SUCCESS}" = "yes" ] | |
62 | } | 63 | } | |
63 | 64 | |||
64 | task_function() | 65 | task_function() | |
65 | { | 66 | { | |
66 | [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] | 67 | [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] | |
67 | } | 68 | } | |
68 | 69 | |||
70 | task_icon_themes() | |||
71 | { | |||
72 | [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ] | |||
73 | } | |||
74 | ||||
69 | task_info_files() | 75 | task_info_files() | |
70 | { | 76 | { | |
71 | [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ] | 77 | [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ] | |
72 | } | 78 | } | |
73 | 79 | |||
74 | task_ocaml_findlib() | 80 | task_ocaml_findlib() | |
75 | { | 81 | { | |
76 | [ "${TASK_OCAML_FINDLIB_SUCCESS}" = "yes" ] | 82 | [ "${TASK_OCAML_FINDLIB_SUCCESS}" = "yes" ] | |
77 | } | 83 | } | |
78 | 84 | |||
79 | task_permissions() | 85 | task_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 | |||
128 | test4() | 134 | test4() | |
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 | |||
138 | test5() | 144 | test5() | |
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 | ||||
154 | test6() | |||
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 | |||
148 | test6() | 164 | test7() | |
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 | |||
158 | test7() | 174 | test8() | |
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 | |||
168 | test8() | 184 | test9() | |
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 | |||
178 | test9() | 194 | test10() | |
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 | |||
188 | test10() | 204 | test11() | |
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 | |||
199 | task_run_tests "$@" | 215 | task_run_tests "$@" |
@@ -29,26 +29,27 @@ task_load createfile | @@ -29,26 +29,27 @@ task_load createfile | |||
29 | task_load postremove | 29 | task_load postremove | |
30 | task_load unittest | 30 | task_load unittest | |
31 | 31 | |||
32 | test_setup() | 32 | test_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. | |
50 | task_directories() | 51 | task_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 | |||
65 | task_function() | 66 | task_function() | |
66 | { | 67 | { | |
67 | [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] | 68 | [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] | |
68 | } | 69 | } | |
69 | 70 | |||
70 | task_groups() | 71 | task_groups() | |
71 | { | 72 | { | |
72 | [ "${TASK_GROUPS_SUCCESS}" = "yes" ] | 73 | [ "${TASK_GROUPS_SUCCESS}" = "yes" ] | |
73 | } | 74 | } | |
74 | 75 | |||
76 | task_icon_themes() | |||
77 | { | |||
78 | [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ] | |||
79 | } | |||
80 | ||||
75 | task_info_files() | 81 | task_info_files() | |
76 | { | 82 | { | |
77 | [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ] | 83 | [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ] | |
78 | } | 84 | } | |
79 | 85 | |||
80 | task_ocaml_findlib() | 86 | task_ocaml_findlib() | |
81 | { | 87 | { | |
82 | [ "${TASK_OCAML_FINDLIB_SUCCESS}" = "yes" ] | 88 | [ "${TASK_OCAML_FINDLIB_SUCCESS}" = "yes" ] | |
83 | } | 89 | } | |
84 | 90 | |||
85 | task_shells() | 91 | task_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 | |||
144 | test5() | 150 | test5() | |
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 | |||
154 | test6() | 160 | test6() | |
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 | ||||
172 | test7() | |||
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 | |||
166 | test7() | 184 | test8() | |
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 | |||
176 | test8() | 194 | test9() | |
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 | |||
186 | test9() | 204 | test10() | |
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 | |||
196 | test10() | 214 | test11() | |
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 | |||
206 | test11() | 224 | test12() | |
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 | |||
217 | task_run_tests "$@" | 235 | task_run_tests "$@" |
@@ -26,80 +26,98 @@ | @@ -26,80 +26,98 @@ | |||
26 | # POSSIBILITY OF SUCH DAMAGE. | 26 | # POSSIBILITY OF SUCH DAMAGE. | |
27 | 27 | |||
28 | task_load createfile | 28 | task_load createfile | |
29 | task_load preremove | 29 | task_load preremove | |
30 | task_load unittest | 30 | task_load unittest | |
31 | 31 | |||
32 | test_setup() | 32 | test_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. | |
43 | task_files() | 44 | task_files() | |
44 | { | 45 | { | |
45 | [ "${TASK_FILES_SUCCESS}" = "yes" ] | 46 | [ "${TASK_FILES_SUCCESS}" = "yes" ] | |
46 | } | 47 | } | |
47 | 48 | |||
48 | task_function() | 49 | task_function() | |
49 | { | 50 | { | |
50 | [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] | 51 | [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] | |
51 | } | 52 | } | |
52 | 53 | |||
54 | task_icon_themes() | |||
55 | { | |||
56 | [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ] | |||
57 | } | |||
58 | ||||
53 | task_info_files() | 59 | task_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 | |||
60 | test1() | 66 | test1() | |
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 | |||
72 | test2() | 78 | test2() | |
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 | |||
82 | test3() | 88 | test3() | |
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 | ||||
100 | test4() | |||
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 | |||
94 | test4() | 112 | test5() | |
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 | |||
105 | task_run_tests "$@" | 123 | task_run_tests "$@" |
@@ -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 | |||
28 | task_load createfile | 28 | task_load createfile | |
29 | task_load makedir | |||
29 | task_load shells | 30 | task_load shells | |
30 | task_load unittest | 31 | task_load unittest | |
31 | 32 | |||
32 | test_setup() | 33 | test_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 | |
48 | EOF | 49 | EOF | |
49 | ||||
50 | ${MKDIR} -p etc | |||
51 | } | 50 | } | |
52 | 51 | |||
53 | test_destdir_setup() | 52 | test_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 | |||
63 | test1() | 60 | test1() | |
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 | |||
72 | test2() | 69 | test2() | |
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 | |||
172 | test8() | 169 | test8() | |
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 | |||
318 | test15() | 316 | test15() | |
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 |
# 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 "$@"