@exec goo automation MODULE prototype

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

@exec goo automation MODULE prototype

Vadim Zhukov
Hello all.

Here is a working prototype of cache invalidating helper framework.
With it you can just add something like:

MODULES += updb
MODUPDB_WHAT = desktop-files icons

and have all RUN_DEPENDS and @exec/@unexec-goo added to final plist
on the fly. Module is MULTI_PACKAGES aware but require small patch
to bsd.port.mk (see below). PKG_ARGS_TAIL is the same as PKG_ARGS
but is appended at the last; this way we get packaging list fragments
where they belong, at the end of the plist.

In the future I think it's possible to add automatic checks in plist
create/update stage, making make-plist warn when something is missed.

Comments and flames are welcome. :)

--
WBR,
Vadim Zhukov


Index: mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1183
diff -u -p -r1.1183 bsd.port.mk
--- mk/bsd.port.mk 4 Aug 2012 14:23:30 -0000 1.1183
+++ mk/bsd.port.mk 12 Aug 2012 17:56:02 -0000
@@ -993,6 +993,9 @@ PKG_ARGS${_S} += -A'${PKG_ARCH${_S}}'
 .  if !defined(_COMMENT${_S})
 ERRORS += "Fatal: Missing comment for ${_S:S/^-$/main package/}."
 .  endif
+
+PKG_ARGS${_S} += ${PKG_ARGS_TAIL}
+PKG_ARGS${_S} += ${PKG_ARGS_TAIL${_S}}
 .endfor
 
 GUNZIP_CMD ?= /usr/bin/gunzip -f
Index: mk/updb.port.mk
===================================================================
RCS file: mk/updb.port.mk
diff -N mk/updb.port.mk
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ mk/updb.port.mk 12 Aug 2012 17:56:02 -0000
@@ -0,0 +1,82 @@
+# $OpenBSD$
+# Simplify adding different "update-*" goo.
+# Written by Vadim Zhukov 2012, public domain
+#
+# How to use:
+# - Set MODUPDB_WHAT to a list of caches you want to invalidate/rebuild,
+#   list of possible names below.
+# - If any icon caches should be invalidated, set MODUPDB_ICON_THEMES to
+#   a list of themes to be updated. List is fixed, see below.
+#
+#
+# What Effect
+# =====================================================
+# desktop-files Runs update-desktop-database
+# icons Runs gtk-update-icon-cache
+# mime Runs update-mime-database
+#
+#
+# Icon theme Where
+# =====================================================
+# hicolor ${PREFIX}/share/icons/hicolor
+# oxygen ${PREFIX}/share/icons/oxygen
+# oxygen-colored ${PREFIX}/share/icons/Oxygen_Black
+# ${PREFIX}/share/icons/Oxygen_Blue
+# ${PREFIX}/share/icons/Oxygen_White
+# ${PREFIX}/share/icons/Oxygen_Yellow
+# ${PREFIX}/share/icons/Oxygen_Zion
+#
+
+MODUPDB_WHAT ?=
+MODUPDB_ICON_THEMES ?= hicolor
+_MODUPDB_PFRAG_BASE = ${PORTSDIR}/infrastructure/plist
+
+# List of all cache types and corresponding RUN_DEPENDS for them
+_MODUPDB_DEPS_MAP = \
+ desktop-files devel/desktop-file-utils \
+ icons x11/gtk+2,-guic \
+ mime misc/shared-mime-info \
+
+
+.if !defined(MULTI_PACKAGES) || empty(MULTI_PACKAGES)
+# Make users happy, do not use "-" subpackage to allow usual
+# "make show=RUN_DEPENDS" checks
+
+. for _what _dep in ${_MODUPDB_DEPS_MAP}
+.   if ${MODUPDB_WHAT:M${_what}}
+RUN_DEPENDS += ${_dep}
+
+.     if "${_what}" == "icons"
+.       for _t in ${MODUPDB_ICON_THEMES}
+PKG_ARGS_TAIL += -f ${_MODUPDB_PFRAG_BASE}/PFRAG.icons-${_t}
+.       endfor
+.     else
+PKG_ARGS_TAIL += -f ${_MODUPDB_PFRAG_BASE}/PFRAG.${_what}
+.     endif
+
+.   endif
+. endfor
+
+.else
+# Go thorugh subpackages as usual
+
+. for _s in ${MULTI_PACKAGES}
+MODUPDB_WHAT${_s} ?= ${MODUPDB_WHAT}
+MODUPDB_ICON_THEMES${_s} ?= ${MODUPDB_ICON_THEMES}
+
+.   for _what _dep in ${_MODUPDB_DEPS_MAP}
+.     if ${MODUPDB_WHAT${_s}:M${_what}}
+RUN_DEPENDS${_s} += ${_dep}
+
+.       if "${_what}" == "icons"
+.         for _t in ${MODUPDB_ICON_THEMES${_s}}
+PKG_ARGS_TAIL${_s} += -f ${_MODUPDB_PFRAG_BASE}/PFRAG.icons-${_t}
+.         endfor
+.       else
+PKG_ARGS_TAIL${_s} += -f ${_MODUPDB_PFRAG_BASE}/PFRAG.${_what}
+.       endif
+
+.     endif
+.   endfor
+. endfor
+.endif
Index: plist/PFRAG.desktop-files
===================================================================
RCS file: plist/PFRAG.desktop-files
diff -N plist/PFRAG.desktop-files
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ plist/PFRAG.desktop-files 12 Aug 2012 17:56:02 -0000
@@ -0,0 +1,2 @@
+@exec %D/bin/update-desktop-database
+@unexec-delete %D/bin/update-desktop-database
Index: plist/PFRAG.icons-hicolor
===================================================================
RCS file: plist/PFRAG.icons-hicolor
diff -N plist/PFRAG.icons-hicolor
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ plist/PFRAG.icons-hicolor 12 Aug 2012 17:56:02 -0000
@@ -0,0 +1,2 @@
+@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/hicolor
+@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/hicolor
Index: plist/PFRAG.icons-oxygen
===================================================================
RCS file: plist/PFRAG.icons-oxygen
diff -N plist/PFRAG.icons-oxygen
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ plist/PFRAG.icons-oxygen 12 Aug 2012 17:56:02 -0000
@@ -0,0 +1,2 @@
+@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/oxygen
+@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/oxygen
Index: plist/PFRAG.icons-oxygen-colored
===================================================================
RCS file: plist/PFRAG.icons-oxygen-colored
diff -N plist/PFRAG.icons-oxygen-colored
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ plist/PFRAG.icons-oxygen-colored 12 Aug 2012 17:56:02 -0000
@@ -0,0 +1,10 @@
+@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Black
+@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Black
+@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Blue
+@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Blue
+@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_White
+@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_White
+@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Yellow
+@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Yellow
+@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Zion
+@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Zion
Index: plist/PFRAG.mime
===================================================================
RCS file: plist/PFRAG.mime
diff -N plist/PFRAG.mime
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ plist/PFRAG.mime 12 Aug 2012 17:56:02 -0000
@@ -0,0 +1,2 @@
+@exec %D/bin/update-mime-database %D/share/mime
+@unexec-delete %D/bin/update-mime-database %D/share/mime

Reply | Threaded
Open this post in threaded view
|

Re: @exec goo automation MODULE prototype

Vadim Zhukov
2012/8/12 Vadim Zhukov <[hidden email]>:

> Hello all.
>
> Here is a working prototype of cache invalidating helper framework.
> With it you can just add something like:
>
> MODULES +=      updb
> MODUPDB_WHAT =  desktop-files icons
>
> and have all RUN_DEPENDS and @exec/@unexec-goo added to final plist
> on the fly. Module is MULTI_PACKAGES aware but require small patch
> to bsd.port.mk (see below). PKG_ARGS_TAIL is the same as PKG_ARGS
> but is appended at the last; this way we get packaging list fragments
> where they belong, at the end of the plist.
>
> In the future I think it's possible to add automatic checks in plist
> create/update stage, making make-plist warn when something is missed.

For those who interested, I quickly collected some statistics about
different @{,un}exec* lines, see below. I've left only those lines
that at least doubles somewhere. Please note that it covers not only
official tree but also openbsd-wip and mystuff (a few ports there).

--
  WBR,
  Vadim Zhukov


2       @exec %D/bin/gdk-pixbuf-query-loaders --update-cache
2       @exec %D/bin/genkdmconf --in %D/share/config/kdm || true
2       @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons
2       @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Locolor
2       @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Tango
2       @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/ikons
2       @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/kdeclassic
2       @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/kids
2       @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/slick
2       @exec TEXMFMAIN=%D/share/texmf %D/bin/mktexlsr
2       @exec cd %D/share/texmf/tex/ && \ls -1LAR ./ >ls-R
2       @exec install -d ${SYSCONFDIR}/php-${PV}.sample/
2       @exec install -d ${SYSCONFDIR}/php-${PV}/
2       @exec-add PREFIX=%D SYSCONFDIR=${SYSCONFDIR}
${PREFIX}/sbin/postfix-install install
2       @exec-update PREFIX=%D SYSCONFDIR=${SYSCONFDIR}
${PREFIX}/sbin/postfix-install upgrade
2       @unexec TEXMFMAIN=%D/share/texmf %D/bin/mktexlsr
2       @unexec-delete ${PREFIX}/sbin/postfix-disable
2       @unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons
2       @unexec-delete rm -f %D/share/icons/Locolor/icon-theme.cache
2       @unexec-delete rm -f %D/share/icons/ikons/icon-theme.cache
2       @unexec-delete rm -f %D/share/icons/kdeclassic/icon-theme.cache
2       @unexec-delete rm -f %D/share/icons/kids/icon-theme.cache
2       @unexec-delete rm -f %D/share/icons/slick/icon-theme.cache
2       @unexec-delete rm -f /etc/mailer.conf.postfix
2       @unexec-delete rm -fr ${SYSCONFDIR}/php-${PV}.sample/
3       @exec %D/bin/mktexlsr > /dev/null 2>&1
3       @exec if [ ! -e ${CATALINA_BASE}/conf ]; then ln -sf
${CONFDIR} ${CATALINA_BASE}/conf; fi
3       @exec mktexlsr > /dev/null 2>&1
3       @unexec if [ -h ${CATALINA_BASE}/conf ]; then rm
${CATALINA_BASE}/conf; fi
3       @unexec rm -rf ${GAMEDIR}/save/*
3       @unexec-delete %D/bin/gtk-query-immodules-2.0 >
${SYSCONFDIR}/gtk-2.0/gtk.immodules
3       @unexec-delete %D/bin/mktexlsr > /dev/null 2>&1
4       @exec %D/bin/gtk-query-immodules-2.0 >
${SYSCONFDIR}/gtk-2.0/gtk.immodules
4       @unexec-delete %D/bin/gio-querymodules %D/lib/gio/modules/
4       @unexec-delete %D/share/libxml2/rebuild
5       @exec %D/bin/gio-querymodules %D/lib/gio/modules/
5       @exec %D/share/libxml2/rebuild
5       @unexec-delete %D/bin/gtk-update-icon-cache -q -t
%D/share/crystalsvg/hicolor
6       @exec ${WNNBASE}/lib/wnn/install-script
6       @unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/gnome
7       @exec %D/bin/gtk-update-icon-cache -q -f -t
%D/share/icons/hicolor 2> /dev/null || true
7       @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/gnome
7       @unexec-delete %D/bin/gtk-update-icon-cache -q -f -t
%D/share/icons/hicolor 2> /dev/null || true
9       @exec %D/sbin/twisted-regen-dropin.cache
9       @unexec %D/sbin/twisted-regen-dropin.cache
12      @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/oxygen
12      @unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/oxygen
22      @exec-update test ! -f ${MODAPACHE_FINAL} || cp -fp %D/%F
${MODAPACHE_FINAL}
22      @unexec-delete rm -f ${MODAPACHE_FINAL}
25      @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/locolor
25      @unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/locolor
26      @unexec-delete %D/bin/gtk-update-icon-cache -q -t
%D/share/icons/crystalsvg
32      @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/crystalsvg
37      @exec GCONF_CONFIG_SOURCE=`%D/bin/gconftool-2
--get-default-source` %D/bin/gconftool-2 --makefile-install-rule
%D/${SCHEMAS_INSTDIR}/*.schemas > /dev/null
38      @unexec GCONF_CONFIG_SOURCE=`%D/bin/gconftool-2
--get-default-source` %D/bin/gconftool-2 --makefile-uninstall-rule
%D/${SCHEMAS_INSTDIR}/*.schemas > /dev/null
62      @exec %D/bin/update-mime-database %D/share/mime
62      @unexec-delete %D/bin/update-mime-database %D/share/mime
72      @unexec-delete %D/bin/glib-compile-schemas
%D/share/glib-2.0/schemas >/dev/null
73      @exec %D/bin/glib-compile-schemas %D/share/glib-2.0/schemas >/dev/null
169     @exec /usr/bin/env HOME=/nonexistent
%D/lib/ghc/${DISTNAME}/register.sh -v0
169     @unexec /usr/bin/env HOME=/nonexistent
%D/lib/ghc/${DISTNAME}/unregister.sh -v0 --force
297     @exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/hicolor
297     @unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/hicolor
550     @unexec-delete %D/bin/update-desktop-database
552     @exec %D/bin/update-desktop-database

Reply | Threaded
Open this post in threaded view
|

Re: @exec goo automation MODULE prototype

Antoine Jacoutot-7
In reply to this post by Vadim Zhukov
On Sun, Aug 12, 2012 at 10:06:15PM +0400, Vadim Zhukov wrote:

> Hello all.
>
> Here is a working prototype of cache invalidating helper framework.
> With it you can just add something like:
>
> MODULES += updb
> MODUPDB_WHAT = desktop-files icons
>
> and have all RUN_DEPENDS and @exec/@unexec-goo added to final plist
> on the fly. Module is MULTI_PACKAGES aware but require small patch
> to bsd.port.mk (see below). PKG_ARGS_TAIL is the same as PKG_ARGS
> but is appended at the last; this way we get packaging list fragments
> where they belong, at the end of the plist.
>
> In the future I think it's possible to add automatic checks in plist
> create/update stage, making make-plist warn when something is missed.
>
> Comments and flames are welcome. :)

We decided some time ago to go with triggers which espie@ is working on.
It'll eventually work similar to @fontdir (similar as in a marker, not similar in the code) so it was decided not to go the way you are proposing.



> Index: mk/bsd.port.mk
> ===================================================================
> RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
> retrieving revision 1.1183
> diff -u -p -r1.1183 bsd.port.mk
> --- mk/bsd.port.mk 4 Aug 2012 14:23:30 -0000 1.1183
> +++ mk/bsd.port.mk 12 Aug 2012 17:56:02 -0000
> @@ -993,6 +993,9 @@ PKG_ARGS${_S} += -A'${PKG_ARCH${_S}}'
>  .  if !defined(_COMMENT${_S})
>  ERRORS += "Fatal: Missing comment for ${_S:S/^-$/main package/}."
>  .  endif
> +
> +PKG_ARGS${_S} += ${PKG_ARGS_TAIL}
> +PKG_ARGS${_S} += ${PKG_ARGS_TAIL${_S}}
>  .endfor
>  
>  GUNZIP_CMD ?= /usr/bin/gunzip -f
> Index: mk/updb.port.mk
> ===================================================================
> RCS file: mk/updb.port.mk
> diff -N mk/updb.port.mk
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ mk/updb.port.mk 12 Aug 2012 17:56:02 -0000
> @@ -0,0 +1,82 @@
> +# $OpenBSD$
> +# Simplify adding different "update-*" goo.
> +# Written by Vadim Zhukov 2012, public domain
> +#
> +# How to use:
> +# - Set MODUPDB_WHAT to a list of caches you want to invalidate/rebuild,
> +#   list of possible names below.
> +# - If any icon caches should be invalidated, set MODUPDB_ICON_THEMES to
> +#   a list of themes to be updated. List is fixed, see below.
> +#
> +#
> +# What Effect
> +# =====================================================
> +# desktop-files Runs update-desktop-database
> +# icons Runs gtk-update-icon-cache
> +# mime Runs update-mime-database
> +#
> +#
> +# Icon theme Where
> +# =====================================================
> +# hicolor ${PREFIX}/share/icons/hicolor
> +# oxygen ${PREFIX}/share/icons/oxygen
> +# oxygen-colored ${PREFIX}/share/icons/Oxygen_Black
> +# ${PREFIX}/share/icons/Oxygen_Blue
> +# ${PREFIX}/share/icons/Oxygen_White
> +# ${PREFIX}/share/icons/Oxygen_Yellow
> +# ${PREFIX}/share/icons/Oxygen_Zion
> +#
> +
> +MODUPDB_WHAT ?=
> +MODUPDB_ICON_THEMES ?= hicolor
> +_MODUPDB_PFRAG_BASE = ${PORTSDIR}/infrastructure/plist
> +
> +# List of all cache types and corresponding RUN_DEPENDS for them
> +_MODUPDB_DEPS_MAP = \
> + desktop-files devel/desktop-file-utils \
> + icons x11/gtk+2,-guic \
> + mime misc/shared-mime-info \
> +
> +
> +.if !defined(MULTI_PACKAGES) || empty(MULTI_PACKAGES)
> +# Make users happy, do not use "-" subpackage to allow usual
> +# "make show=RUN_DEPENDS" checks
> +
> +. for _what _dep in ${_MODUPDB_DEPS_MAP}
> +.   if ${MODUPDB_WHAT:M${_what}}
> +RUN_DEPENDS += ${_dep}
> +
> +.     if "${_what}" == "icons"
> +.       for _t in ${MODUPDB_ICON_THEMES}
> +PKG_ARGS_TAIL += -f ${_MODUPDB_PFRAG_BASE}/PFRAG.icons-${_t}
> +.       endfor
> +.     else
> +PKG_ARGS_TAIL += -f ${_MODUPDB_PFRAG_BASE}/PFRAG.${_what}
> +.     endif
> +
> +.   endif
> +. endfor
> +
> +.else
> +# Go thorugh subpackages as usual
> +
> +. for _s in ${MULTI_PACKAGES}
> +MODUPDB_WHAT${_s} ?= ${MODUPDB_WHAT}
> +MODUPDB_ICON_THEMES${_s} ?= ${MODUPDB_ICON_THEMES}
> +
> +.   for _what _dep in ${_MODUPDB_DEPS_MAP}
> +.     if ${MODUPDB_WHAT${_s}:M${_what}}
> +RUN_DEPENDS${_s} += ${_dep}
> +
> +.       if "${_what}" == "icons"
> +.         for _t in ${MODUPDB_ICON_THEMES${_s}}
> +PKG_ARGS_TAIL${_s} += -f ${_MODUPDB_PFRAG_BASE}/PFRAG.icons-${_t}
> +.         endfor
> +.       else
> +PKG_ARGS_TAIL${_s} += -f ${_MODUPDB_PFRAG_BASE}/PFRAG.${_what}
> +.       endif
> +
> +.     endif
> +.   endfor
> +. endfor
> +.endif
> Index: plist/PFRAG.desktop-files
> ===================================================================
> RCS file: plist/PFRAG.desktop-files
> diff -N plist/PFRAG.desktop-files
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ plist/PFRAG.desktop-files 12 Aug 2012 17:56:02 -0000
> @@ -0,0 +1,2 @@
> +@exec %D/bin/update-desktop-database
> +@unexec-delete %D/bin/update-desktop-database
> Index: plist/PFRAG.icons-hicolor
> ===================================================================
> RCS file: plist/PFRAG.icons-hicolor
> diff -N plist/PFRAG.icons-hicolor
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ plist/PFRAG.icons-hicolor 12 Aug 2012 17:56:02 -0000
> @@ -0,0 +1,2 @@
> +@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/hicolor
> +@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/hicolor
> Index: plist/PFRAG.icons-oxygen
> ===================================================================
> RCS file: plist/PFRAG.icons-oxygen
> diff -N plist/PFRAG.icons-oxygen
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ plist/PFRAG.icons-oxygen 12 Aug 2012 17:56:02 -0000
> @@ -0,0 +1,2 @@
> +@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/oxygen
> +@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/oxygen
> Index: plist/PFRAG.icons-oxygen-colored
> ===================================================================
> RCS file: plist/PFRAG.icons-oxygen-colored
> diff -N plist/PFRAG.icons-oxygen-colored
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ plist/PFRAG.icons-oxygen-colored 12 Aug 2012 17:56:02 -0000
> @@ -0,0 +1,10 @@
> +@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Black
> +@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Black
> +@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Blue
> +@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Blue
> +@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_White
> +@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_White
> +@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Yellow
> +@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Yellow
> +@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Zion
> +@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/Oxygen_Zion
> Index: plist/PFRAG.mime
> ===================================================================
> RCS file: plist/PFRAG.mime
> diff -N plist/PFRAG.mime
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ plist/PFRAG.mime 12 Aug 2012 17:56:02 -0000
> @@ -0,0 +1,2 @@
> +@exec %D/bin/update-mime-database %D/share/mime
> +@unexec-delete %D/bin/update-mime-database %D/share/mime
>

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: @exec goo automation MODULE prototype

Vadim Zhukov
2012/8/13 Antoine Jacoutot <[hidden email]>:

> On Sun, Aug 12, 2012 at 10:06:15PM +0400, Vadim Zhukov wrote:
>> Hello all.
>>
>> Here is a working prototype of cache invalidating helper framework.
>> With it you can just add something like:
>>
>> MODULES +=    updb
>> MODUPDB_WHAT =        desktop-files icons
>>
>> and have all RUN_DEPENDS and @exec/@unexec-goo added to final plist
>> on the fly. Module is MULTI_PACKAGES aware but require small patch
>> to bsd.port.mk (see below). PKG_ARGS_TAIL is the same as PKG_ARGS
>> but is appended at the last; this way we get packaging list fragments
>> where they belong, at the end of the plist.
>>
>> In the future I think it's possible to add automatic checks in plist
>> create/update stage, making make-plist warn when something is missed.
>>
>> Comments and flames are welcome. :)
>
> We decided some time ago to go with triggers which espie@ is working on.
> It'll eventually work similar to @fontdir (similar as in a marker, not similar in the code) so it was decided not to go the way you are proposing.

It's nice to hear the work is already going in that land. :) Thanks
for the answer.

--
  WBR,
  Vadim Zhukov

Reply | Threaded
Open this post in threaded view
|

Re: @exec goo automation MODULE prototype

Marc Espie-2
On Mon, Aug 13, 2012 at 12:03:59PM +0400, Vadim Zhukov wrote:

> 2012/8/13 Antoine Jacoutot <[hidden email]>:
> > On Sun, Aug 12, 2012 at 10:06:15PM +0400, Vadim Zhukov wrote:
> >> Hello all.
> >>
> >> Here is a working prototype of cache invalidating helper framework.
> >> With it you can just add something like:
> >>
> >> MODULES +=    updb
> >> MODUPDB_WHAT =        desktop-files icons
> >>
> >> and have all RUN_DEPENDS and @exec/@unexec-goo added to final plist
> >> on the fly. Module is MULTI_PACKAGES aware but require small patch
> >> to bsd.port.mk (see below). PKG_ARGS_TAIL is the same as PKG_ARGS
> >> but is appended at the last; this way we get packaging list fragments
> >> where they belong, at the end of the plist.
> >>
> >> In the future I think it's possible to add automatic checks in plist
> >> create/update stage, making make-plist warn when something is missed.
> >>
> >> Comments and flames are welcome. :)
> >
> > We decided some time ago to go with triggers which espie@ is working on.
> > It'll eventually work similar to @fontdir (similar as in a marker, not similar in the code) so it was decided not to go the way you are proposing.
>
> It's nice to hear the work is already going in that land. :) Thanks
> for the answer.

If you look very closely in pkg_add, you'll see some partial framework
that deals with @tag and @define-tag.

Rough todo list concerning that:

- I need to be more precise wrt updates, as antoine found out. Being in
"replace" mode is not enough to switch to exec-update/unexec-update. I have
to actually say that I'm dealing with a packing-list that's an active part
of an update.

- the tag/define-tag goo is only handled during addition. Similar code must
be done for deletion (it should be easier, since the addition is the part
that scans for define-tags and can add the corresponding dependency to
+REQUIRED/+REQUIRING).

- then modes have to be defined for define-tag, with preferably simple syntax.
update-desktop-database is very simple, since basically it needs to be run
once. But the @tag are actually linked to plist entries, so we can accumulate
directories/files, remove duplicates, run commands on addition/deletion, and
so on... I haven't really looked at that part yet.

- I was wondering about what's going to happen if we remove the package that
has the define-tag... I think that, in that case, too bad for the tags, the
package is gone. *but* I can insert @unexec directly in THAT specific package
to cater to that case. Again, taking the update-desktop-database, when
removing that package, you probably want to run it right before you remove
update-desktop-database binary...


Well, that's all part of all the stuff slated for "after 5.2" in general...
slowly making progress on various thingies...