Received: by mail.netbsd.org (Postfix, from userid 605) id B1F5384D7E; Thu, 10 Aug 2017 05:38:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 446ED84D26 for ; Thu, 10 Aug 2017 05:38:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id xqOlyYYhhVSU for ; Thu, 10 Aug 2017 05:38:31 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 1A79C84CF0 for ; Thu, 10 Aug 2017 05:38:31 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 18571FACE; Thu, 10 Aug 2017 05:38:31 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1502343511108190" MIME-Version: 1.0 Date: Thu, 10 Aug 2017 05:38:31 +0000 From: "Johnny C. Lam" Subject: CVS commit: pkgsrc/pkgtools/pkgtasks To: pkgsrc-changes@NetBSD.org Reply-To: jlam@netbsd.org X-Mailer: log_accum Message-Id: <20170810053831.18571FACE@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1502343511108190 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: jlam Date: Thu Aug 10 05:38:30 UTC 2017 Modified Files: pkgsrc/pkgtools/pkgtasks: Makefile PLIST pkgsrc/pkgtools/pkgtasks/files: Makefile.am Makefile.in README.md configure configure.ac fonts.subr groups.subr info_files.subr load.subr ocaml_findlib.subr postinstall.subr postremove.subr preremove.subr shells.subr users.subr pkgsrc/pkgtools/pkgtasks/files/build-aux: install-sh pkgsrc/pkgtools/pkgtasks/files/t: Kyuafile t_ocaml_findlib.sh t_postinstall.sh t_postremove.sh t_preremove.sh t_shells.sh Added Files: pkgsrc/pkgtools/pkgtasks/files: NEWS.md icon_themes.subr pkgsrc/pkgtools/pkgtasks/files/t: t_icon_themes.sh Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 pkgsrc/pkgtools/pkgtasks/Makefile cvs rdiff -u -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/PLIST cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/Makefile.am \ pkgsrc/pkgtools/pkgtasks/files/Makefile.in \ pkgsrc/pkgtools/pkgtasks/files/README.md \ pkgsrc/pkgtools/pkgtasks/files/configure \ pkgsrc/pkgtools/pkgtasks/files/configure.ac cvs rdiff -u -r0 -r1.1 pkgsrc/pkgtools/pkgtasks/files/NEWS.md \ pkgsrc/pkgtools/pkgtasks/files/icon_themes.subr cvs rdiff -u -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/fonts.subr \ pkgsrc/pkgtools/pkgtasks/files/groups.subr \ pkgsrc/pkgtools/pkgtasks/files/info_files.subr \ pkgsrc/pkgtools/pkgtasks/files/load.subr \ pkgsrc/pkgtools/pkgtasks/files/ocaml_findlib.subr \ pkgsrc/pkgtools/pkgtasks/files/postinstall.subr \ pkgsrc/pkgtools/pkgtasks/files/postremove.subr \ pkgsrc/pkgtools/pkgtasks/files/preremove.subr \ pkgsrc/pkgtools/pkgtasks/files/shells.subr \ pkgsrc/pkgtools/pkgtasks/files/users.subr cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh cvs rdiff -u -r1.1 -r1.2 pkgsrc/pkgtools/pkgtasks/files/t/Kyuafile \ pkgsrc/pkgtools/pkgtasks/files/t/t_ocaml_findlib.sh \ pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh \ pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh \ pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh \ pkgsrc/pkgtools/pkgtasks/files/t/t_shells.sh cvs rdiff -u -r0 -r1.1 pkgsrc/pkgtools/pkgtasks/files/t/t_icon_themes.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1502343511108190 Content-Disposition: inline Content-Length: 60115 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/pkgtools/pkgtasks/Makefile diff -u pkgsrc/pkgtools/pkgtasks/Makefile:1.4 pkgsrc/pkgtools/pkgtasks/Makefile:1.5 --- pkgsrc/pkgtools/pkgtasks/Makefile:1.4 Sat Jun 3 23:54:53 2017 +++ pkgsrc/pkgtools/pkgtasks/Makefile Thu Aug 10 05:38:30 2017 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.4 2017/06/03 23:54:53 jlam Exp $ +# $NetBSD: Makefile,v 1.5 2017/08/10 05:38:30 jlam Exp $ -DISTNAME= pkgtasks-1-1.10 +DISTNAME= pkgtasks-1-1.13 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty Index: pkgsrc/pkgtools/pkgtasks/PLIST diff -u pkgsrc/pkgtools/pkgtasks/PLIST:1.1 pkgsrc/pkgtools/pkgtasks/PLIST:1.2 --- pkgsrc/pkgtools/pkgtasks/PLIST:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/PLIST Thu Aug 10 05:38:30 2017 @@ -1,7 +1,8 @@ -@comment $NetBSD: PLIST,v 1.1 2017/06/01 01:58:34 jlam Exp $ +@comment $NetBSD: PLIST,v 1.2 2017/08/10 05:38:30 jlam Exp $ share/doc/${PKGBASE}/AUTHORS -share/doc/${PKGBASE}/COPYING share/doc/${PKGBASE}/README.md +share/doc/${PKGBASE}/NEWS.md +share/doc/${PKGBASE}/COPYING share/${PKGBASE}/cleanup.subr share/${PKGBASE}/compare.subr share/${PKGBASE}/createfile.subr @@ -11,6 +12,7 @@ share/${PKGBASE}/echo.subr share/${PKGBASE}/files.subr share/${PKGBASE}/fonts.subr share/${PKGBASE}/groups.subr +share/${PKGBASE}/icon_themes.subr share/${PKGBASE}/info_files.subr share/${PKGBASE}/load.subr share/${PKGBASE}/lock.subr @@ -57,6 +59,7 @@ tests/${PKGBASE}/t_echo tests/${PKGBASE}/t_files tests/${PKGBASE}/t_fonts tests/${PKGBASE}/t_groups +tests/${PKGBASE}/t_icon_themes tests/${PKGBASE}/t_info_files tests/${PKGBASE}/t_lock tests/${PKGBASE}/t_makedir Index: pkgsrc/pkgtools/pkgtasks/files/Makefile.am diff -u pkgsrc/pkgtools/pkgtasks/files/Makefile.am:1.2 pkgsrc/pkgtools/pkgtasks/files/Makefile.am:1.3 --- pkgsrc/pkgtools/pkgtasks/files/Makefile.am:1.2 Sat Jun 3 23:54:53 2017 +++ pkgsrc/pkgtools/pkgtasks/files/Makefile.am Thu Aug 10 05:38:30 2017 @@ -25,9 +25,12 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -doc_DATA = AUTHORS COPYING README.md +doc_DATA = AUTHORS COPYING NEWS.md README.md noinst_DATA = README.md EXTRA_DIST = $(doc_DATA) +MAINTAINERCLEANFILES = Makefile.in aclocal.m4 +MAINTAINERCLEANFILES += build-aux/install-sh build-aux/missing +MAINTAINERCLEANFILES += configure $(DIST_ARCHIVES) PHONY_TARGETS = @@ -54,6 +57,7 @@ dist_pkgdata_DATA += echo.subr dist_pkgdata_DATA += files.subr dist_pkgdata_DATA += fonts.subr dist_pkgdata_DATA += groups.subr +dist_pkgdata_DATA += icon_themes.subr dist_pkgdata_DATA += info_files.subr dist_pkgdata_DATA += load.subr dist_pkgdata_DATA += lock.subr @@ -184,6 +188,14 @@ t/t_groups: t/t_groups.sh t/build_test $(AM_V_GEN)target="$(builddir)/t/t_groups" source="$(srcdir)/t/t_groups.sh"; \ $(BUILD_TEST) +pkgtests_SCRIPTS += t/t_icon_themes +CLEANFILES += t/t_icon_themes +EXTRA_DIST += t/t_icon_themes.sh +t/t_icon_themes: t/t_icon_themes.sh t/build_test + -$(MKDIR_P) $(builddir)/t + $(AM_V_GEN)target="$(builddir)/t/t_icon_themes" source="$(srcdir)/t/t_icon_themes.sh"; \ + $(BUILD_TEST) + pkgtests_SCRIPTS += t/t_info_files CLEANFILES += t/t_info_files EXTRA_DIST += t/t_info_files.sh @@ -490,7 +502,14 @@ check-local: check-run-tests installcheck-local: installcheck-run-tests endif # HAVE_KYUA -maintainer-clean-local: - -rm -f Makefile.in aclocal.m4 configure - -rm -f build-aux/install-sh build-aux/missing - -rm -f $(PACKAGE)-*.tar.* +# Duplicate Automake's check-news target, but verify NEWS.md instead of NEWS. +dist-hook: check-news-local +PHONY_TARGETS += check-news-local +check-news-local: + @newsfile="$(srcdir)/NEWS.md"; \ + case `sed 15q "$$newsfile"` in \ + *"$(VERSION)"*) : ;; \ + *) \ + echo "$$newsfile not updated; not releasing" 1>&2; \ + exit 1;; \ + esac Index: pkgsrc/pkgtools/pkgtasks/files/Makefile.in diff -u pkgsrc/pkgtools/pkgtasks/files/Makefile.in:1.2 pkgsrc/pkgtools/pkgtasks/files/Makefile.in:1.3 --- pkgsrc/pkgtools/pkgtasks/files/Makefile.in:1.2 Sat Jun 3 23:54:53 2017 +++ pkgsrc/pkgtools/pkgtasks/files/Makefile.in Thu Aug 10 05:38:30 2017 @@ -280,23 +280,26 @@ testsdir = @testsdir@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -doc_DATA = AUTHORS COPYING README.md +doc_DATA = AUTHORS COPYING NEWS.md README.md noinst_DATA = README.md EXTRA_DIST = $(doc_DATA) version.subr.in t/build_test.sh \ t/run_tests.sh t/t_compare.sh t/t_createfile.sh \ t/t_directories.sh t/t_dirwalk.sh t/t_echo.sh t/t_files.sh \ - t/t_fonts.sh t/t_groups.sh t/t_info_files.sh t/t_lock.sh \ - t/t_makedir.sh t/t_maketemp.sh t/t_match.sh \ - t/t_ocaml_findlib.sh t/t_permissions.sh t/t_platform.sh \ - t/t_postinstall.sh t/t_postremove.sh t/t_preinstall.sh \ - t/t_preremove.sh t/t_quote.sh t/t_random.sh t/t_refcount.sh \ - t/t_shells.sh t/t_shlibs.sh t/t_sort.sh t/t_taskfunc.sh \ - t/t_tee.sh t/t_truthy.sh t/t_usergroup.sh \ + t/t_fonts.sh t/t_groups.sh t/t_icon_themes.sh \ + t/t_info_files.sh t/t_lock.sh t/t_makedir.sh t/t_maketemp.sh \ + t/t_match.sh t/t_ocaml_findlib.sh t/t_permissions.sh \ + t/t_platform.sh t/t_postinstall.sh t/t_postremove.sh \ + t/t_preinstall.sh t/t_preremove.sh t/t_quote.sh t/t_random.sh \ + t/t_refcount.sh t/t_shells.sh t/t_shlibs.sh t/t_sort.sh \ + t/t_taskfunc.sh t/t_tee.sh t/t_truthy.sh t/t_usergroup.sh \ t/t_usergroup_FreeBSD.sh t/t_usergroup_Linux.sh \ t/t_usergroup_MirBSD.sh t/t_usergroup_NetBSD.sh \ t/t_usergroup_exists.sh t/t_usergroup_mock.sh t/t_users.sh \ t/t_valid_options.sh t/t_version.sh t/t_which.sh -PHONY_TARGETS = check-run-tets installcheck-run-tests $(am__append_1) +MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/install-sh \ + build-aux/missing configure $(DIST_ARCHIVES) +PHONY_TARGETS = check-run-tets installcheck-run-tests $(am__append_1) \ + check-news-local CHMOD = chmod MV = mv @@ -312,9 +315,10 @@ BUILD_FILE = \ BUILD_SCRIPT = $(BUILD_FILE) && $(CHMOD) +x "$$target" dist_pkgdata_DATA = cleanup.subr compare.subr createfile.subr \ directories.subr dirwalk.subr echo.subr files.subr fonts.subr \ - groups.subr info_files.subr load.subr lock.subr makedir.subr \ - maketemp.subr match.subr ocaml_findlib.subr permissions.subr \ - platform.subr postinstall.subr postremove.subr preinstall.subr \ + groups.subr icon_themes.subr info_files.subr load.subr \ + lock.subr makedir.subr maketemp.subr match.subr \ + ocaml_findlib.subr permissions.subr platform.subr \ + postinstall.subr postremove.subr preinstall.subr \ preremove.subr quote.subr random.subr refcount.subr \ refcount_file.subr say.subr shells.subr shlibs.subr sort.subr \ taskfunc.subr tee.subr truthy.subr unittest.subr \ @@ -325,11 +329,11 @@ dist_pkgdata_DATA = cleanup.subr compare pkgdata_DATA = version.subr CLEANFILES = version.subr t/build_test t/run_tests t/t_compare \ t/t_createfile t/t_directories t/t_dirwalk t/t_echo t/t_files \ - t/t_fonts t/t_groups t/t_info_files t/t_lock t/t_makedir \ - t/t_maketemp t/t_match t/t_ocaml_findlib t/t_permissions \ - t/t_platform t/t_postinstall t/t_postremove t/t_preinstall \ - t/t_preremove t/t_quote t/t_random t/t_refcount t/t_shells \ - t/t_shlibs t/t_sort t/t_taskfunc t/t_tee t/t_truthy \ + t/t_fonts t/t_groups t/t_icon_themes t/t_info_files t/t_lock \ + t/t_makedir t/t_maketemp t/t_match t/t_ocaml_findlib \ + t/t_permissions t/t_platform t/t_postinstall t/t_postremove \ + t/t_preinstall t/t_preremove t/t_quote t/t_random t/t_refcount \ + t/t_shells t/t_shlibs t/t_sort t/t_taskfunc t/t_tee t/t_truthy \ t/t_usergroup t/t_usergroup_FreeBSD t/t_usergroup_Linux \ t/t_usergroup_MirBSD t/t_usergroup_NetBSD t/t_usergroup_exists \ t/t_usergroup_mock t/t_users t/t_valid_options t/t_version \ @@ -344,14 +348,15 @@ dist_pkgtests_DATA = t/Kyuafile noinst_SCRIPTS = t/build_test pkgtests_SCRIPTS = t/run_tests t/t_compare t/t_createfile \ t/t_directories t/t_dirwalk t/t_echo t/t_files t/t_fonts \ - t/t_groups t/t_info_files t/t_lock t/t_makedir t/t_maketemp \ - t/t_match t/t_ocaml_findlib t/t_permissions t/t_platform \ - t/t_postinstall t/t_postremove t/t_preinstall t/t_preremove \ - t/t_quote t/t_random t/t_refcount t/t_shells t/t_shlibs \ - t/t_sort t/t_taskfunc t/t_tee t/t_truthy t/t_usergroup \ - t/t_usergroup_FreeBSD t/t_usergroup_Linux t/t_usergroup_MirBSD \ - t/t_usergroup_NetBSD t/t_usergroup_exists t/t_usergroup_mock \ - t/t_users t/t_valid_options t/t_version t/t_which + t/t_groups t/t_icon_themes t/t_info_files t/t_lock t/t_makedir \ + t/t_maketemp t/t_match t/t_ocaml_findlib t/t_permissions \ + t/t_platform t/t_postinstall t/t_postremove t/t_preinstall \ + t/t_preremove t/t_quote t/t_random t/t_refcount t/t_shells \ + t/t_shlibs t/t_sort t/t_taskfunc t/t_tee t/t_truthy \ + t/t_usergroup t/t_usergroup_FreeBSD t/t_usergroup_Linux \ + t/t_usergroup_MirBSD t/t_usergroup_NetBSD t/t_usergroup_exists \ + t/t_usergroup_mock t/t_users t/t_valid_options t/t_version \ + t/t_which # CHECK_ENVIRONMENT # This is used to set variables before calling kyua on the tests in @@ -558,6 +563,9 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ @@ -728,6 +736,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic mostlyclean-am @@ -782,8 +791,7 @@ maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic \ - maintainer-clean-local +maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am @@ -805,10 +813,10 @@ uninstall-am: uninstall-dist_pkgdataDATA .PHONY: all all-am am--refresh check check-am check-local clean \ clean-generic cscopelist-am ctags-am dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-generic distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am \ + dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ install-dist_pkgdataDATA install-dist_pkgtestsDATA \ install-docDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ @@ -816,11 +824,11 @@ uninstall-am: uninstall-dist_pkgdataDATA install-pkgdataDATA install-pkgtestsSCRIPTS install-ps \ install-ps-am install-strip installcheck installcheck-am \ installcheck-local installdirs maintainer-clean \ - maintainer-clean-generic maintainer-clean-local mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-dist_pkgdataDATA \ - uninstall-dist_pkgtestsDATA uninstall-docDATA \ - uninstall-pkgdataDATA uninstall-pkgtestsSCRIPTS + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags-am uninstall uninstall-am \ + uninstall-dist_pkgdataDATA uninstall-dist_pkgtestsDATA \ + uninstall-docDATA uninstall-pkgdataDATA \ + uninstall-pkgtestsSCRIPTS .PRECIOUS: Makefile @@ -868,6 +876,10 @@ t/t_groups: t/t_groups.sh t/build_test -$(MKDIR_P) $(builddir)/t $(AM_V_GEN)target="$(builddir)/t/t_groups" source="$(srcdir)/t/t_groups.sh"; \ $(BUILD_TEST) +t/t_icon_themes: t/t_icon_themes.sh t/build_test + -$(MKDIR_P) $(builddir)/t + $(AM_V_GEN)target="$(builddir)/t/t_icon_themes" source="$(srcdir)/t/t_icon_themes.sh"; \ + $(BUILD_TEST) t/t_info_files: t/t_info_files.sh t/build_test -$(MKDIR_P) $(builddir)/t $(AM_V_GEN)target="$(builddir)/t/t_info_files" source="$(srcdir)/t/t_info_files.sh"; \ @@ -1024,10 +1036,16 @@ installcheck-run-tests: @HAVE_KYUA_FALSE@check-local: check-run-tests @HAVE_KYUA_FALSE@installcheck-local: installcheck-run-tests -maintainer-clean-local: - -rm -f Makefile.in aclocal.m4 configure - -rm -f build-aux/install-sh build-aux/missing - -rm -f $(PACKAGE)-*.tar.* +# Duplicate Automake's check-news target, but verify NEWS.md instead of NEWS. +dist-hook: check-news-local +check-news-local: + @newsfile="$(srcdir)/NEWS.md"; \ + case `sed 15q "$$newsfile"` in \ + *"$(VERSION)"*) : ;; \ + *) \ + echo "$$newsfile not updated; not releasing" 1>&2; \ + exit 1;; \ + esac # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Index: pkgsrc/pkgtools/pkgtasks/files/README.md diff -u pkgsrc/pkgtools/pkgtasks/files/README.md:1.2 pkgsrc/pkgtools/pkgtasks/files/README.md:1.3 --- pkgsrc/pkgtools/pkgtasks/files/README.md:1.2 Sat Jun 3 23:54:53 2017 +++ pkgsrc/pkgtools/pkgtasks/files/README.md Thu Aug 10 05:38:30 2017 @@ -26,7 +26,7 @@ same entry more than once. Getting sources --------------- -The latest version of *pkgtasks* is 1.10 and was released on June 3rd, 2017. +The latest version of *pkgtasks* is 1.13 and was released on August 8th, 2017. See the [release notes](NEWS.md) for information about the changes in this and all previous releases. @@ -52,6 +52,7 @@ The individual package tasks supported b * `files`: copy and remove configuration files * `fonts`: regenerate X11 font indices * `groups`: create groups and warn about groups that may be removed + * `icon_themes`: create caches in GTK+ icon theme directories * `info_files`: register and unregister GNU info files * `ocaml_findlib`: update OCaml findlib search paths * `permissions`: check and set modes and permissions on special files Index: pkgsrc/pkgtools/pkgtasks/files/configure diff -u pkgsrc/pkgtools/pkgtasks/files/configure:1.2 pkgsrc/pkgtools/pkgtasks/files/configure:1.3 --- pkgsrc/pkgtools/pkgtasks/files/configure:1.2 Sat Jun 3 23:54:53 2017 +++ pkgsrc/pkgtools/pkgtasks/files/configure Thu Aug 10 05:38:30 2017 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for pkgtasks-1 1.10. +# Generated by GNU Autoconf 2.69 for pkgtasks-1 1.13. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='pkgtasks-1' PACKAGE_TARNAME='pkgtasks-1' -PACKAGE_VERSION='1.10' -PACKAGE_STRING='pkgtasks-1 1.10' +PACKAGE_VERSION='1.13' +PACKAGE_STRING='pkgtasks-1 1.13' PACKAGE_BUGREPORT='jlam@NetBSD.org' PACKAGE_URL='' @@ -1209,7 +1209,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pkgtasks-1 1.10 to adapt to many kinds of systems. +\`configure' configures pkgtasks-1 1.13 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1275,7 +1275,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pkgtasks-1 1.10:";; + short | recursive ) echo "Configuration of pkgtasks-1 1.13:";; esac cat <<\_ACEOF @@ -1355,7 +1355,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pkgtasks-1 configure 1.10 +pkgtasks-1 configure 1.13 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1372,7 +1372,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pkgtasks-1 $as_me 1.10, which was +It was created by pkgtasks-1 $as_me 1.13, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2242,7 +2242,7 @@ fi # Define the identity of the package. PACKAGE='pkgtasks-1' - VERSION='1.10' + VERSION='1.13' cat >>confdefs.h <<_ACEOF @@ -3078,7 +3078,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pkgtasks-1 $as_me 1.10, which was +This file was extended by pkgtasks-1 $as_me 1.13, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3131,7 +3131,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -pkgtasks-1 config.status 1.10 +pkgtasks-1 config.status 1.13 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Index: pkgsrc/pkgtools/pkgtasks/files/configure.ac diff -u pkgsrc/pkgtools/pkgtasks/files/configure.ac:1.2 pkgsrc/pkgtools/pkgtasks/files/configure.ac:1.3 --- pkgsrc/pkgtools/pkgtasks/files/configure.ac:1.2 Sat Jun 3 23:54:53 2017 +++ pkgsrc/pkgtools/pkgtasks/files/configure.ac Thu Aug 10 05:38:30 2017 @@ -26,7 +26,7 @@ dnl ARISING IN ANY WAY OUT OF THE USE OF dnl POSSIBILITY OF SUCH DAMAGE. dnl -AC_INIT([pkgtasks-1], [1.10], [jlam@NetBSD.org]) +AC_INIT([pkgtasks-1], [1.13], [jlam@NetBSD.org]) AC_CONFIG_AUX_DIR([build-aux]) Index: pkgsrc/pkgtools/pkgtasks/files/fonts.subr diff -u pkgsrc/pkgtools/pkgtasks/files/fonts.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/fonts.subr:1.2 --- pkgsrc/pkgtools/pkgtasks/files/fonts.subr:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/fonts.subr Thu Aug 10 05:38:30 2017 @@ -90,6 +90,9 @@ # String prepended to all normal message written to # standard output. # +# TYPE1INST +# The name or path to the type1inst(1) utility. +# # TTMKFDIR # The name or path to the ttmkfdir(1) utility. # Index: pkgsrc/pkgtools/pkgtasks/files/groups.subr diff -u pkgsrc/pkgtools/pkgtasks/files/groups.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/groups.subr:1.2 --- pkgsrc/pkgtools/pkgtasks/files/groups.subr:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/groups.subr Thu Aug 10 05:38:30 2017 @@ -157,7 +157,7 @@ task_groups() task_group_exists "$group" "$gid" case $? in 0) # $group exists and has gid $gid - $echo "${TASK_MSG}! group already exists: $msg" ;; + $echo "${TASK_MSG}! group already exists: $group" ;; 1) # neither $group nor $gid exist if [ -z "$create" ]; then $echo "${TASK_MSG}! group creation skipped: $msg" @@ -178,7 +178,7 @@ task_groups() esac else # add refcount failed; skip to next line - $echo "${TASK_MSG}! refcount add failure: groups $msg" + $echo "${TASK_MSG}! refcount add failure: groups $group" result=1 continue fi ;; @@ -191,7 +191,7 @@ task_groups() fi else # remove refcount failed - $echo "${TASK_MSG}! refcount remove failure: groups $msg" + $echo "${TASK_MSG}! refcount remove failure: groups $group" line_result=1 fi ;; check-add) Index: pkgsrc/pkgtools/pkgtasks/files/info_files.subr diff -u pkgsrc/pkgtools/pkgtasks/files/info_files.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/info_files.subr:1.2 --- pkgsrc/pkgtools/pkgtasks/files/info_files.subr:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/info_files.subr Thu Aug 10 05:38:30 2017 @@ -164,23 +164,25 @@ task_info_files() line_result=0 case $action in - add) # Remove any existing file entry from the "dir" file, even for - # the "add" action to guard against a duplicate entry when we - # add later. + add) # Remove any existing file entry from the "dir" file + # to guard against a duplicate entry when we add later. + # Suppress the output since we don't care if the removal + # was successful or not. # - if [ -f "$index" ]; then - ${INSTALL_INFO} --delete "$file" "$index" >/dev/null 2>&1 - fi + ${INSTALL_INFO} --info-dir="$infodir" --delete "$file" >/dev/null 2>&1 # Add the file entry to the "dir" file. - [ -d "$infodir" ] || task_makedir "$infodir" - ${INSTALL_INFO} "$file" "$index" || line_result=1 + [ -d "$infodir" ] || task_makedir "$infodir" 2>/dev/null + [ -d "$infodir" ] || line_result=1 + if [ $line_result -eq 0 ]; then + ${INSTALL_INFO} --info-dir="$infodir" "$file" || line_result=1 + fi if [ $line_result -eq 0 ]; then $echo "${TASK_MSG}> info file registered: $file" else $echo "${TASK_MSG}! info file not registered: $file" fi ;; remove) if [ -f "$index" ]; then - ${INSTALL_INFO} --delete "$file" "$index" || line_result=1 + ${INSTALL_INFO} --info-dir="$infodir" --delete "$file" || line_result=1 if [ $line_result -eq 0 ]; then $echo "${TASK_MSG}> info file unregistered: $file" else Index: pkgsrc/pkgtools/pkgtasks/files/load.subr diff -u pkgsrc/pkgtools/pkgtasks/files/load.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/load.subr:1.2 --- pkgsrc/pkgtools/pkgtasks/files/load.subr:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/load.subr Thu Aug 10 05:38:30 2017 @@ -1,4 +1,3 @@ -# Copyright (c) 2017 The NetBSD Foundation, Inc. # All rights reserved. # # This code is derived from software contributed to The NetBSD Foundation Index: pkgsrc/pkgtools/pkgtasks/files/ocaml_findlib.subr diff -u pkgsrc/pkgtools/pkgtasks/files/ocaml_findlib.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/ocaml_findlib.subr:1.2 --- pkgsrc/pkgtools/pkgtasks/files/ocaml_findlib.subr:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/ocaml_findlib.subr Thu Aug 10 05:38:30 2017 @@ -102,6 +102,7 @@ __task_ocaml_findlib_init__="_task_ocaml task_load cleanup task_load echo task_load lock +task_load makedir task_load maketemp task_load match task_load quote @@ -173,15 +174,21 @@ task_ocaml_findlib() [!/]*) ldconf="$prefix/$ldconf" ;; esac ldconf="${PKG_DESTDIR}$ldconf" + local ldconfdir=${ldconf%/*} line_result=0 case $action in add|remove) - lock="$ldconf.lock" - task_quote "$lock" - lock_quoted=$quoted - __task_ocaml_findlib_locks__="$quoted $__task_ocaml_findlib_locks__" - task_lock "$lock" || line_result=1 + # Ensure that the ld.conf directory exists. + [ -d "$ldconfdir" ] || task_makedir "$ldconfdir" 2>/dev/null + [ -d "$ldconfdir" ] || line_result=1 + if [ $line_result -eq 0 ]; then + lock="$ldconf.lock" + task_quote "$lock" + lock_quoted=$quoted + __task_ocaml_findlib_locks__="$quoted $__task_ocaml_findlib_locks__" + task_lock "$lock" || line_result=1 + fi ;; esac if [ $line_result -eq 0 ]; then case $action in Index: pkgsrc/pkgtools/pkgtasks/files/postinstall.subr diff -u pkgsrc/pkgtools/pkgtasks/files/postinstall.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/postinstall.subr:1.2 --- pkgsrc/pkgtools/pkgtasks/files/postinstall.subr:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/postinstall.subr Thu Aug 10 05:38:30 2017 @@ -40,6 +40,7 @@ # o Set special permissions on package files and directories. # o Rebuild the system run-time library search path database. # o Update fonts databases. +# o Create caches within GTK+ icon theme directories. # o Register shells in the system shells database. # o Register GNU info files. # o Update OCaml module run-time library search path database. @@ -59,6 +60,7 @@ __task_postinstall__="yes" task_load directories task_load files task_load fonts +task_load icon_themes task_load info_files task_load ocaml_findlib task_load permissions @@ -83,6 +85,8 @@ task_postinstall() post_actions="$post_actions task_shlibs" # Update font databases. post_actions="$post_actions task_fonts" + # Update GTK+ icon theme caches. + post_actions="$post_actions task_icon_themes" # Register shells. post_actions="$post_actions task_shells" # Register GNU info files. Index: pkgsrc/pkgtools/pkgtasks/files/postremove.subr diff -u pkgsrc/pkgtools/pkgtasks/files/postremove.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/postremove.subr:1.2 --- pkgsrc/pkgtools/pkgtasks/files/postremove.subr:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/postremove.subr Thu Aug 10 05:38:30 2017 @@ -37,6 +37,7 @@ # # o Unregister shells from the system shells database. # o Update fonts databases. +# o Update caches within GTK+ icon theme directories. # o Rebuild the system run-time library search path database. # o Update OCaml module run-time library search path database. # o Remove empty directories. @@ -59,6 +60,7 @@ task_load directories task_load files task_load fonts task_load groups +task_load icon_themes task_load info_files task_load ocaml_findlib task_load shells @@ -79,6 +81,8 @@ task_postremove() post_actions="task_shells" # Update font databases. post_actions="$post_actions task_fonts" + # Update GTK+ icon theme caches + post_actions="$post_actions task_icon_themes" # Rebuild the system run-time library search path database. post_actions="$post_actions task_shlibs" # Update OCaml module run-time library search path database. @@ -96,9 +100,9 @@ task_postremove() local post_checks="task_info_files task_files" local result=0 - local stage="preinstall" + local stage="postremove" - local post_fn silent + local post_fn silent action_result for post_fn in $post_actions; do case $post_fn in task_directories|\ @@ -116,7 +120,15 @@ task_postremove() task_sort -r < $datafile | $post_fn $silent remove $stage ;; *) $post_fn $silent remove $stage < $datafile ;; esac - [ $? -eq 0 ] || result=1 + action_result="$?" + case $post_fn in + task_icon_themes) + # Any errors in updating icon caches during postremove + # are non-fatal, so adjust the action result. + # + action_result=0 ;; + esac + [ $action_result -eq 0 ] || result=1 post_checks="$post_checks $post_fn" done Index: pkgsrc/pkgtools/pkgtasks/files/preremove.subr diff -u pkgsrc/pkgtools/pkgtasks/files/preremove.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/preremove.subr:1.2 --- pkgsrc/pkgtools/pkgtasks/files/preremove.subr:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/preremove.subr Thu Aug 10 05:38:30 2017 @@ -36,6 +36,7 @@ # deleting the package files for the removal to be successful: # # o Unregister GNU info files. +# o Remove GTK+ icon theme caches. # o Remove unmodified configuration files. # # The datafile contains lines of the form: @@ -51,6 +52,7 @@ __task_preremove__="yes" task_load files +task_load icon_themes task_load info_files task_load sort task_load taskfunc @@ -62,7 +64,7 @@ task_preremove() [ -f "$datafile" ] || return 1 - local stage="preinstall" + local stage="preremove" # Unregistering a GNU info files requires reading the file to find # all nodes listed in the file, so it must be done before the file @@ -71,6 +73,13 @@ task_preremove() # task_info_files -s remove $stage < $datafile + # GTK+ icon theme caches exist in the package installation + # directory, so they must be removed before their packages can be + # successfully removed. Any errors in removing icon caches are + # non-fatal. + # + task_icon_themes -s remove $stage < $datafile + # Removing a configuration file requires comparing it to the # example file from which it was copied, so it must be done before # the example file is removed. Any errors in removing Index: pkgsrc/pkgtools/pkgtasks/files/shells.subr diff -u pkgsrc/pkgtools/pkgtasks/files/shells.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/shells.subr:1.2 --- pkgsrc/pkgtools/pkgtasks/files/shells.subr:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/shells.subr Thu Aug 10 05:38:30 2017 @@ -101,6 +101,7 @@ __task_shells_init__="_task_shells_init" task_load cleanup task_load echo task_load lock +task_load makedir task_load maketemp task_load match task_load quote @@ -171,15 +172,21 @@ task_shells() [!/]*) shelldb="$prefix/$shelldb" ;; esac shelldb="${PKG_DESTDIR}$shelldb" + local shelldbdir=${shelldb%/*} line_result=0 case $action in add|remove) - lock="$shelldb.lock" - task_quote "$lock" - lock_quoted=$quoted - __task_shells_locks__="$lock_quoted $__task_shells_locks__" - task_lock "$lock" || line_result=1 ;; + # Ensure that the shelldb directory exists. + [ -d "$shelldbdir" ] || task_makedir "$shelldbdir" 2>/dev/null + [ -d "$shelldbdir" ] || line_result=1 + if [ $line_result -eq 0 ]; then + lock="$shelldb.lock" + task_quote "$lock" + lock_quoted=$quoted + __task_shells_locks__="$lock_quoted $__task_shells_locks__" + task_lock "$lock" || line_result=1 + fi ;; esac if [ $line_result -eq 0 ]; then case $action in Index: pkgsrc/pkgtools/pkgtasks/files/users.subr diff -u pkgsrc/pkgtools/pkgtasks/files/users.subr:1.1 pkgsrc/pkgtools/pkgtasks/files/users.subr:1.2 --- pkgsrc/pkgtools/pkgtasks/files/users.subr:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/users.subr Thu Aug 10 05:38:30 2017 @@ -128,7 +128,7 @@ task_users() task_is_truthy "${PKG_CREATE_USERGROUP}" || create= local result line_result - local save_IFS user group uid descr home shell msg + local save_IFS user group uid descr home shell msg submsg result=0 local hash tag entry @@ -147,14 +147,17 @@ task_users() IFS=$save_IFS [ -n "$user" -a -n "$group" ] || continue - if [ -n "$uid" ]; then - msg="$user (uid = $uid)" - else + submsg= + [ -z "$uid" ] || submsg="$submsg, uid = $uid" + [ -z "$group" ] || submsg="$submsg, group = $group" + [ -z "$home" ] || submsg="$submsg, home = $home" + [ -z "$shell" ] || submsg="$submsg, shell = $shell" + submsg="(${submsg#, })" + if [ "$submsg" = "()" ]; then msg="$user" + else + msg="$user $submsg" fi - msg="$msg: $group" - [ -z "$home" ] || msg="$msg, $home" - [ -z "$shell" ] || msg="$msg, $shell" line_result=0 case $action in @@ -162,7 +165,7 @@ task_users() task_user_exists "$user" "$uid" case $? in 0) # $user exists and has uid $uid - $echo "${TASK_MSG}! user already exists: $msg" ;; + $echo "${TASK_MSG}! user already exists: $user" ;; 1) # neither $user nor $uid exist if [ -z "$create" ]; then $echo "${TASK_MSG}! user creation skipped: $msg" @@ -182,7 +185,7 @@ task_users() esac else # add refcount failed; skip to next line - $echo "${TASK_MSG}! refcount add failure: users $msg" + $echo "${TASK_MSG}! refcount add failure: users $user" result=1 continue fi ;; @@ -195,7 +198,7 @@ task_users() fi else # remove refcount failed - $echo "${TASK_MSG}! refcount remove failure: users $msg" + $echo "${TASK_MSG}! refcount remove failure: users $user" line_result=1 fi ;; check-add) Index: pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh diff -u pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh:1.2 pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh:1.3 --- pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh:1.2 Sat Jun 3 23:54:53 2017 +++ pkgsrc/pkgtools/pkgtasks/files/build-aux/install-sh Thu Aug 10 05:38:30 2017 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: install-sh,v 1.2 2017/06/03 23:54:53 jlam Exp $ +# $NetBSD: install-sh,v 1.3 2017/08/10 05:38:30 jlam Exp $ # This script now also installs multiple files, but might choke on installing # multiple files with spaces in the file names. # Index: pkgsrc/pkgtools/pkgtasks/files/t/Kyuafile diff -u pkgsrc/pkgtools/pkgtasks/files/t/Kyuafile:1.1 pkgsrc/pkgtools/pkgtasks/files/t/Kyuafile:1.2 --- pkgsrc/pkgtools/pkgtasks/files/t/Kyuafile:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/t/Kyuafile Thu Aug 10 05:38:30 2017 @@ -50,6 +50,7 @@ tap_test_program { name = "t_echo" } tap_test_program { name = "t_files" } tap_test_program { name = "t_fonts" } tap_test_program { name = "t_groups" } +tap_test_program { name = "t_icon_themes" } tap_test_program { name = "t_info_files" } tap_test_program { name = "t_lock" } tap_test_program { name = "t_makedir" } Index: pkgsrc/pkgtools/pkgtasks/files/t/t_ocaml_findlib.sh diff -u pkgsrc/pkgtools/pkgtasks/files/t/t_ocaml_findlib.sh:1.1 pkgsrc/pkgtools/pkgtasks/files/t/t_ocaml_findlib.sh:1.2 --- pkgsrc/pkgtools/pkgtasks/files/t/t_ocaml_findlib.sh:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/t/t_ocaml_findlib.sh Thu Aug 10 05:38:30 2017 @@ -26,6 +26,7 @@ # POSSIBILITY OF SUCH DAMAGE. task_load createfile +task_load makedir task_load ocaml_findlib task_load unittest @@ -36,7 +37,7 @@ test_setup() PKG_PREFIX=${TEST_CURDIR} PKG_DESTDIR= - ldconf="ld.conf" + ldconf="lib/ocaml/ld.conf" ldconf_lock="$ldconf.lock" datafile="datafile" @@ -50,11 +51,10 @@ EOF test_destdir_setup() { - : ${MKDIR:=mkdir} : ${MV:=mv} PKG_DESTDIR="${TEST_CURDIR}/destdir" - ${MKDIR} -p "${PKG_DESTDIR}${PKG_PREFIX}" + task_makedir "${PKG_DESTDIR}${PKG_PREFIX}" } test1() @@ -174,6 +174,7 @@ test7() test8() { describe="check-remove findlib dirs with empty ld.conf" + task_makedir "${ldconf%/*}" task_createfile "$ldconf" if task_ocaml_findlib check-remove < $datafile; then : "success" @@ -326,6 +327,7 @@ test15() { describe="check-remove findlib dirs with empty ld.conf with PKG_DESTDIR" test_destdir_setup + task_makedir "${PKG_DESTDIR}${PKG_PREFIX}/${ldconf%/*}" task_createfile "${PKG_DESTDIR}${PKG_PREFIX}/$ldconf" if task_ocaml_findlib check-remove < $datafile; then : "success" Index: pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh diff -u pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh:1.1 pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh:1.2 --- pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/t/t_postinstall.sh Thu Aug 10 05:38:30 2017 @@ -38,6 +38,7 @@ test_setup() TASK_FILES_SUCCESS="yes" TASK_FONTS_SUCCESS="yes" TASK_FUNCTION_SUCCESS="yes" + TASK_ICON_THEMES_SUCCESS="yes" TASK_INFO_FILES_SUCCESS="yes" TASK_OCAML_FINDLIB_SUCCESS="yes" TASK_PERMISSIONS_SUCCESS="yes" @@ -66,6 +67,11 @@ task_function() [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] } +task_icon_themes() +{ + [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ] +} + task_info_files() { [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ] @@ -137,6 +143,16 @@ test4() test5() { + describe="icon_themes fail" + TASK_ICON_THEMES_SUCCESS="no" + if task_postinstall "$datafile"; then + return 1 + fi + return 0 +} + +test6() +{ describe="info_files fail" TASK_INFO_FILES_SUCCESS="no" if task_postinstall "$datafile"; then @@ -145,7 +161,7 @@ test5() return 0 } -test6() +test7() { describe="ocaml_findlib fail" TASK_OCAML_FINDLIB_SUCCESS="no" @@ -155,7 +171,7 @@ test6() return 0 } -test7() +test8() { describe="permissions fail" TASK_PERMISSIONS_SUCCESS="no" @@ -165,7 +181,7 @@ test7() return 0 } -test8() +test9() { describe="shells fail" TASK_SHELLS_SUCCESS="no" @@ -175,7 +191,7 @@ test8() return 0 } -test9() +test10() { describe="shlibs fail" TASK_SHLIBS_SUCCESS="no" @@ -185,7 +201,7 @@ test9() return 0 } -test10() +test11() { describe="all succeed" if task_postinstall "$datafile"; then Index: pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh diff -u pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh:1.1 pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh:1.2 --- pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/t/t_postremove.sh Thu Aug 10 05:38:30 2017 @@ -39,6 +39,7 @@ test_setup() TASK_FONTS_SUCCESS="yes" TASK_FUNCTION_SUCCESS="yes" TASK_GROUPS_SUCCESS="yes" + TASK_ICON_THEMES_SUCCESS="yes" TASK_INFO_FILES_SUCCESS="yes" TASK_OCAML_FINDLIB_SUCCESS="yes" TASK_SHELLS_SUCCESS="yes" @@ -72,6 +73,11 @@ task_groups() [ "${TASK_GROUPS_SUCCESS}" = "yes" ] } +task_icon_themes() +{ + [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ] +} + task_info_files() { [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ] @@ -153,6 +159,18 @@ test5() test6() { + describe="icon_themes fail" + TASK_ICON_THEMES_SUCCESS="no" + if task_postremove "$datafile"; then + : "icon_themes result is ignored during postremove" + else + return 1 + fi + return 0 +} + +test7() +{ describe="info_files fail" TASK_INFO_FILES_SUCCESS="no" if task_postremove "$datafile"; then @@ -163,7 +181,7 @@ test6() return 0 } -test7() +test8() { describe="ocaml_findlib fail" TASK_OCAML_FINDLIB_SUCCESS="no" @@ -173,7 +191,7 @@ test7() return 0 } -test8() +test9() { describe="shells fail" TASK_SHELLS_SUCCESS="no" @@ -183,7 +201,7 @@ test8() return 0 } -test9() +test10() { describe="shlibs fail" TASK_SHLIBS_SUCCESS="no" @@ -193,7 +211,7 @@ test9() return 0 } -test10() +test11() { describe="users fail" TASK_USERS_SUCCESS="no" @@ -203,7 +221,7 @@ test10() return 0 } -test11() +test12() { describe="all succeed" if task_postremove "$datafile"; then Index: pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh diff -u pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh:1.1 pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh:1.2 --- pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/t/t_preremove.sh Thu Aug 10 05:38:30 2017 @@ -36,6 +36,7 @@ test_setup() TASK_FILES_SUCCESS="yes" TASK_FUNCTION_SUCCESS="yes" + TASK_ICON_THEMES_SUCCESS="yes" TASK_INFO_FILES_SUCCESS="yes" } @@ -50,12 +51,17 @@ task_function() [ "${TASK_FUNCTION_SUCCESS}" = "yes" ] } +task_icon_themes() +{ + [ "${TASK_ICON_THEMES_SUCCESS}" = "yes" ] +} + task_info_files() { [ "${TASK_INFO_FILES_SUCCESS}" = "yes" ] } -# Always succeed. +# Always succeed except if "function" task fails. test1() { @@ -81,6 +87,18 @@ test2() test3() { + describe="icon_themes fail" + TASK_ICON_THEMES_SUCCESS="no" + if task_preremove "$datafile"; then + : "success" + else + return 1 + fi + return 0 +} + +test4() +{ describe="info_files fail" TASK_INFO_FILES_SUCCESS="no" if task_preremove "$datafile"; then @@ -91,7 +109,7 @@ test3() return 0 } -test4() +test5() { describe="all succeed" if task_preremove "$datafile"; then Index: pkgsrc/pkgtools/pkgtasks/files/t/t_shells.sh diff -u pkgsrc/pkgtools/pkgtasks/files/t/t_shells.sh:1.1 pkgsrc/pkgtools/pkgtasks/files/t/t_shells.sh:1.2 --- pkgsrc/pkgtools/pkgtasks/files/t/t_shells.sh:1.1 Thu Jun 1 01:58:34 2017 +++ pkgsrc/pkgtools/pkgtasks/files/t/t_shells.sh Thu Aug 10 05:38:30 2017 @@ -26,6 +26,7 @@ # POSSIBILITY OF SUCH DAMAGE. task_load createfile +task_load makedir task_load shells task_load unittest @@ -46,18 +47,14 @@ test_setup() # SHELL: bin/bash $shelldb # SHELL: ${PKG_PREFIX}/bin/pdksh $shelldb EOF - - ${MKDIR} -p etc } test_destdir_setup() { - : ${MKDIR:=mkdir} : ${MV:=mv} PKG_DESTDIR="${TEST_CURDIR}/destdir" - ${MKDIR} -p "${PKG_DESTDIR}${PKG_PREFIX}" - ${MV} etc "${PKG_DESTDIR}${PKG_PREFIX}" + task_makedir "${PKG_DESTDIR}${PKG_PREFIX}" } test1() @@ -172,6 +169,7 @@ test7() test8() { describe="check-remove shells with empty shell database" + task_makedir "${shelldb%/*}" task_createfile "$shelldb" if task_shells check-remove < $datafile; then : "success" @@ -319,6 +317,7 @@ test15() { describe="check-remove shells with empty shell database" test_destdir_setup + task_makedir "${PKG_DESTDIR}${PKG_PREFIX}/${shelldb%/*}" task_createfile "${PKG_DESTDIR}${PKG_PREFIX}/$shelldb" if task_shells check-remove < $datafile; then : "success" Added files: Index: pkgsrc/pkgtools/pkgtasks/files/NEWS.md diff -u /dev/null pkgsrc/pkgtools/pkgtasks/files/NEWS.md:1.1 --- /dev/null Thu Aug 10 05:38:31 2017 +++ pkgsrc/pkgtools/pkgtasks/files/NEWS.md Thu Aug 10 05:38:30 2017 @@ -0,0 +1,215 @@ +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. Index: pkgsrc/pkgtools/pkgtasks/files/icon_themes.subr diff -u /dev/null pkgsrc/pkgtools/pkgtasks/files/icon_themes.subr:1.1 --- /dev/null Thu Aug 10 05:38:31 2017 +++ pkgsrc/pkgtools/pkgtasks/files/icon_themes.subr Thu Aug 10 05:38:30 2017 @@ -0,0 +1,221 @@ +# 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 +# +# 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: +# +# 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__= Index: pkgsrc/pkgtools/pkgtasks/files/t/t_icon_themes.sh diff -u /dev/null pkgsrc/pkgtools/pkgtasks/files/t/t_icon_themes.sh:1.1 --- /dev/null Thu Aug 10 05:38:31 2017 +++ pkgsrc/pkgtools/pkgtasks/files/t/t_icon_themes.sh Thu Aug 10 05:38:30 2017 @@ -0,0 +1,276 @@ +# 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 "$@" --_----------=_1502343511108190--