[gnome-ostree] Move triggers from ostree to here



commit 89c498759a4018aee15669b88852e49716ee06db
Author: Colin Walters <walters verbum org>
Date:   Sun Jul 7 15:20:05 2013 -0400

    Move triggers from ostree to here
    
    Previously, "ostree checkout" would by default run a set of triggers
    that came with ostree itself.  This had various flaws, see the ostree
    git log.

 Makefile-ostbuild.am                      |   17 ++++++
 manifest.json                             |    5 --
 src/gnome-ostree-run-triggers             |   23 ++++++++
 src/js/tasks/task-build.js                |   87 ++++++++++++++++------------
 src/triggers/0001ldconfig.trigger         |   23 ++++++++
 src/triggers/0005depmod.trigger           |   27 +++++++++
 src/triggers/0010mime-database.trigger    |   23 ++++++++
 src/triggers/0020dconf.trigger            |   23 ++++++++
 src/triggers/0030glib.trigger             |   23 ++++++++
 src/triggers/0040gdk-pixbuf.trigger       |   24 ++++++++
 src/triggers/0060immodules.trigger        |   23 ++++++++
 src/triggers/0070pango.trigger            |   29 ++++++++++
 src/triggers/0080gtk+.trigger             |   30 ++++++++++
 src/triggers/0090desktop-database.trigger |   23 ++++++++
 src/triggers/0100fontconfig-cache.trigger |   23 ++++++++
 15 files changed, 361 insertions(+), 42 deletions(-)
---
diff --git a/Makefile-ostbuild.am b/Makefile-ostbuild.am
index 02b9f8e..0976ad0 100644
--- a/Makefile-ostbuild.am
+++ b/Makefile-ostbuild.am
@@ -33,10 +33,27 @@ bin_SCRIPTS += ostbuild \
 
 utils_SCRIPTS = \
        src/ostree-build-compile-one \
+       src/gnome-ostree-run-triggers \
        src/ostree-build-yocto \
        $(NULL)
 utilsdir = $(pkglibdir)
 
+triggersdir = $(pkglibdir)/triggers
+triggers_SCRIPTS = \
+       src/triggers/0001ldconfig.trigger \
+       src/triggers/0005depmod.trigger \
+       src/triggers/0010mime-database.trigger \
+       src/triggers/0020dconf.trigger \
+       src/triggers/0030glib.trigger \
+       src/triggers/0040gdk-pixbuf.trigger \
+       src/triggers/0060immodules.trigger \
+       src/triggers/0070pango.trigger \
+       src/triggers/0080gtk+.trigger \
+       src/triggers/0090desktop-database.trigger \
+       src/triggers/0100fontconfig-cache.trigger \
+       $(NULL)
+EXTRA_DIST += $(triggers_SCRIPTS)
+
 jsostbuilddir=$(pkgdatadir)/js
 jsostbuild_DATA= \
        src/js/argparse.js \
diff --git a/manifest.json b/manifest.json
index 8e7a743..0f17c0d 100644
--- a/manifest.json
+++ b/manifest.json
@@ -49,11 +49,6 @@
                  "config-opts": ["--disable-modular-tests",
                                 "--enable-installed-tests"]},
 
-               {"src": "gnome:ostree",
-                "name": "ostree-triggers",
-                "bootstrap": true,
-                "config-opts": ["--enable-triggers-only"]},
-
                {"src": "gnome:gnome-common",
                 "component": "devel"},
 
diff --git a/src/gnome-ostree-run-triggers b/src/gnome-ostree-run-triggers
new file mode 100755
index 0000000..a8b56d5
--- /dev/null
+++ b/src/gnome-ostree-run-triggers
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Copyright (C) 2013 Colin Walters <walters verbum org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+set -e
+set -x
+
+for x in ${1}/*; do ${x}; done
+
diff --git a/src/js/tasks/task-build.js b/src/js/tasks/task-build.js
index 7868d37..ea0f4bf 100644
--- a/src/js/tasks/task-build.js
+++ b/src/js/tasks/task-build.js
@@ -138,6 +138,8 @@ const TaskBuild = new Lang.Class({
                          'checkout', '--user-mode', '--union',
                          '--from-file=' + tmpPath.get_path(), cachedRootTmp.get_path()], cancellable);
         GSystem.file_unlink(tmpPath, cancellable);
+       
+       this._runTriggersInRoot(cachedRootTmp, cancellable);
 
         let builddirTmp = cachedRootTmp.get_child('ostbuild');
         GSystem.file_ensure_directory(builddirTmp.resolve_relative_path('source/' + componentName), true, 
cancellable);
@@ -507,17 +509,6 @@ const TaskBuild = new Lang.Class({
        return this._componentBuildRefFromName(component['name'], architecture);
     },
     
-    _replaceTmpWithDir: function(root, cancellable) {
-       // The default now is for tmp -> sysroot/tmp, which doesn't
-       // exist.  Make tmp in the buildroot a regular dir, which
-       // we'll then bind mount to the host's /tmp.
-       let tmp = root.get_child('tmp');
-       if (tmp.query_file_type(Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null) == 
Gio.FileType.SYMBOLIC_LINK) {
-           GSystem.file_unlink(tmp, cancellable);
-           GSystem.file_ensure_directory(tmp, true, cancellable);
-       }
-    },
-
     _buildOneComponent: function(component, architecture, cancellable, params) {
        params = Params.parse(params, { installedTests: false });
         let basename = component['name'];
@@ -638,21 +629,19 @@ const TaskBuild = new Lang.Class({
            }
        }
 
-       this._replaceTmpWithDir(rootdir, cancellable);
-
         childArgs = ['setarch', architecture];
         childArgs.push.apply(childArgs, BuildUtil.getBaseUserChrootArgs());
         childArgs.push.apply(childArgs, [
-                '--mount-readonly', '/',
-                '--mount-proc', '/proc', 
-                '--mount-bind', '/dev', '/dev',
-                '--mount-bind', tmpdir.get_path(), '/tmp',
-                '--mount-bind', componentSrc.get_path(), chrootSourcedir.get_path(),
-                '--mount-bind', componentResultdir.get_path(), '/ostbuild/results',
-                '--chdir', chrootChdir.get_path(),
-                rootdir.get_path(), '/ostree-build-compile-one',
-                '--ostbuild-resultdir=/ostbuild/results',
-                '--ostbuild-meta=_ostbuild-meta.json']);
+            '--mount-readonly', '/',
+            '--mount-bind', '/', '/sysroot',
+            '--mount-proc', '/proc', 
+            '--mount-bind', '/dev', '/dev',
+            '--mount-bind', componentSrc.get_path(), chrootSourcedir.get_path(),
+            '--mount-bind', componentResultdir.get_path(), '/ostbuild/results',
+            '--chdir', chrootChdir.get_path(),
+            rootdir.get_path(), '/ostree-build-compile-one',
+            '--ostbuild-resultdir=/ostbuild/results',
+            '--ostbuild-meta=_ostbuild-meta.json']);
        let envCopy = {};
        Lang.copyProperties(BuildUtil.BUILD_ENV, envCopy);
         envCopy['PWD'] = chrootSourcedir.get_path();
@@ -714,7 +703,9 @@ const TaskBuild = new Lang.Class({
         return ostreeRevision;
     },
     
-    _checkoutOneTreeCoreAsync: function(name, composeContents, cancellable, callback) {
+    _checkoutOneTreeCoreAsync: function(name, composeContents, cancellable, callback,
+                                       params) {
+       params = Params.parse(params, { runTriggers: true });
         let composeRootdir = this.subworkdir.get_child(name);
        print("Checking out " + composeRootdir.get_path());
        GSystem.shutil_rm_rf(composeRootdir, cancellable);
@@ -748,6 +739,9 @@ const TaskBuild = new Lang.Class({
                callback(null, ""+e);
                return;
            }
+
+           if (params.runTriggers)
+               this._runTriggersInRoot(composeRootdir, cancellable);
            
             let contentsPath = composeRootdir.resolve_relative_path('usr/share/contents.json');
            GSystem.file_ensure_directory(contentsPath.get_parent(), true, cancellable);
@@ -816,16 +810,35 @@ const TaskBuild = new Lang.Class({
                                           }
                                       }));
     },
+    
+    _runTriggersInRoot: function(rootdir, cancellable) {
+       let triggersScriptPath = this.libdir.resolve_relative_path('gnome-ostree-run-triggers');
+       let triggersPath = this.libdir.resolve_relative_path('triggers');
+       let childArgs = BuildUtil.getBaseUserChrootArgs();
+        childArgs.push.apply(childArgs, [
+           '--mount-bind', '/', '/sysroot',
+            '--mount-proc', '/proc', 
+            '--mount-bind', '/dev', '/dev',
+            rootdir.get_path(), '/sysroot' + triggersScriptPath.get_path(),
+           '/sysroot' + triggersPath.get_path()]);
+       let envCopy = {};
+       Lang.copyProperties(BuildUtil.BUILD_ENV, envCopy);
+        envCopy['PWD'] = '/';
+
+       let context = new GSystem.SubprocessContext({ argv: childArgs });
+       context.set_environment(ProcUtil.objectToEnvironment(envCopy));
+       let proc = new GSystem.Subprocess({ context: context });
+       proc.init(cancellable);
+       print("Started child process " + context.argv.map(GLib.shell_quote).join(' '));
+       try {
+           proc.wait_sync_check(cancellable);
+       } catch (e) {
+           print("Trigger execution in root " + rootdir.get_path() + " failed");
+           throw e;
+       }
+    },
 
     _postComposeTransform: function(composeRootdir, cancellable) {
-       // Create /usr/share/ostree/triggers-run; this is a temporary
-       // hack until the trigger functionality moves outside of ostree
-       // entirely.
-       let shareOstree = composeRootdir.resolve_relative_path('usr/share/ostree');
-       GSystem.file_ensure_directory(shareOstree, true, cancellable);
-       let triggersRunPath = shareOstree.get_child('triggers-run');
-       triggersRunPath.create(Gio.FileCreateFlags.REPLACE_DESTINATION, cancellable).close(cancellable);
-       
        // Move /etc to /usr/etc, since it contains defaults.
        let etc = composeRootdir.resolve_relative_path("etc");
        let usrEtc = composeRootdir.resolve_relative_path("usr/etc");
@@ -958,19 +971,18 @@ const TaskBuild = new Lang.Class({
            GSystem.file_ensure_directory(tmpDir, true, cancellable);
            let initramfsTmp = tmpDir.get_child('initramfs-ostree.img');
 
-           this._replaceTmpWithDir(composeRootdir, cancellable);
-
            // HACK: Temporarily move /usr/etc to /etc to help dracut
            // find stuff, like the config file telling it to use the
            // ostree module.
            let etcDir = composeRootdir.resolve_relative_path('etc');
            let usrEtcDir = composeRootdir.resolve_relative_path('usr/etc');
            GSystem.file_rename(usrEtcDir, etcDir, cancellable);
-           let args = ['linux-user-chroot', '--mount-readonly', '/',
+           let args = ['linux-user-chroot',
                        '--mount-proc', '/proc',
                        '--mount-bind', '/dev', '/dev',
+                       '--mount-bind', '/', '/sysroot',
+                       '--mount-bind', tmpDir.get_path(), '/sysroot/tmp',
                        '--mount-bind', varDir.get_path(), '/var',
-                       '--mount-bind', tmpDir.get_path(), '/tmp',
                        composeRootdir.get_path(),
                        'dracut', '--tmpdir=/tmp', '-f', '/tmp/initramfs-ostree.img',
                        kernelRelease];
@@ -1530,7 +1542,8 @@ const TaskBuild = new Lang.Class({
                                                                                 if (composeTreeTaskCount == 
0)
                                                                                     
composeTreeTaskLoop.quit();
                                                                             }));
-                                          }));
+                                          }),
+                                         { runTriggers: false });
        }
 
        composeTreeTaskLoop.run();
diff --git a/src/triggers/0001ldconfig.trigger b/src/triggers/0001ldconfig.trigger
new file mode 100755
index 0000000..daed471
--- /dev/null
+++ b/src/triggers/0001ldconfig.trigger
@@ -0,0 +1,23 @@
+#!/bin/bash
+# Post-installation hook for shared libraries.  -*- mode: sh -*-
+#
+# Written by Colin Walters <walters verbum org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if test -x "$(which ldconfig 2>/dev/null)"; then
+    exec ldconfig
+fi
diff --git a/src/triggers/0005depmod.trigger b/src/triggers/0005depmod.trigger
new file mode 100755
index 0000000..fc786b2
--- /dev/null
+++ b/src/triggers/0005depmod.trigger
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Post-installation hook for kernel modules.  -*- mode: sh -*-
+#
+# Written by Colin Walters <walters verbum org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+set -e
+
+if test -x "$(which depmod 2>/dev/null)"; then
+    for d in /usr/lib/modules/*; do
+       if test -d "$d"; then depmod $(basename "$d"); fi
+    done
+fi
diff --git a/src/triggers/0010mime-database.trigger b/src/triggers/0010mime-database.trigger
new file mode 100755
index 0000000..e99cf2e
--- /dev/null
+++ b/src/triggers/0010mime-database.trigger
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Post-installation hook for shared-mime-info.  -*- mode: sh -*-
+#
+# Written by Matthias Clasen <mclasen redhat com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if test -x "$(which update-mime-database 2>/dev/null)"; then
+    exec update-mime-database /usr/share/mime
+fi
diff --git a/src/triggers/0020dconf.trigger b/src/triggers/0020dconf.trigger
new file mode 100755
index 0000000..620d4e0
--- /dev/null
+++ b/src/triggers/0020dconf.trigger
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Post-installation hook for system dconf schemas.  -*- mode: sh -*-
+#
+# Written by Colin Walters <walters verbum org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if test -x "$(which dconf 2>/dev/null)"; then
+    exec dconf update
+fi
diff --git a/src/triggers/0030glib.trigger b/src/triggers/0030glib.trigger
new file mode 100755
index 0000000..8c8bf50
--- /dev/null
+++ b/src/triggers/0030glib.trigger
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Post-installation hook for glib/gschema.  -*- mode: sh -*-
+#
+# Written by Colin Walters <walters verbum org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if test -x "$(which glib-compile-schemas 2>/dev/null)"; then
+    exec glib-compile-schemas /usr/share/glib-2.0/schemas
+fi
diff --git a/src/triggers/0040gdk-pixbuf.trigger b/src/triggers/0040gdk-pixbuf.trigger
new file mode 100755
index 0000000..989d08b
--- /dev/null
+++ b/src/triggers/0040gdk-pixbuf.trigger
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Post-installation hook for gdk-pixbuf.  -*- mode: sh -*-
+# Corresponds to gdk-pixbuf/gdk-pixbuf/Makefile.am:install-data-hook
+#
+# Written by Colin Walters <walters verbum org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if test -x "$(which gdk-pixbuf-query-loaders 2>/dev/null)"; then
+    exec gdk-pixbuf-query-loaders --update-cache
+fi
diff --git a/src/triggers/0060immodules.trigger b/src/triggers/0060immodules.trigger
new file mode 100755
index 0000000..b9738ee
--- /dev/null
+++ b/src/triggers/0060immodules.trigger
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Post-installation hook for GTK+ input method modules.  -*- mode: sh -*-
+#
+# Written by Matthias Clasen <mclasen redhat com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if test -x "$(which gtk-query-immodules-3.0 2>/dev/null)"; then
+    exec gtk-query-immodules-3.0 --update-cache
+fi
diff --git a/src/triggers/0070pango.trigger b/src/triggers/0070pango.trigger
new file mode 100755
index 0000000..250d896
--- /dev/null
+++ b/src/triggers/0070pango.trigger
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Post-installation hook for pango.  -*- mode: sh -*-
+# Corresponds to gdk-pixbuf/gdk-pixbuf/Makefile.am:install-data-hook
+#
+# Written by Colin Walters <walters verbum org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if test -x "$(which pango-querymodules 2>/dev/null)"; then
+    # Support both old and new pango-querymodules; see
+    # http://git.gnome.org/browse/pango/commit/?id=9bbb992671140b840bedb4339f6c326a2ae2c072
+    if ! pango-querymodules --system --update-cache; then
+       DEST=/etc/pango/pango.modules
+       pango-querymodules --system > ${DEST}.tmp && mv ${DEST}.tmp ${DEST}
+    fi
+fi
diff --git a/src/triggers/0080gtk+.trigger b/src/triggers/0080gtk+.trigger
new file mode 100755
index 0000000..85b9e79
--- /dev/null
+++ b/src/triggers/0080gtk+.trigger
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Post-installation hook for gtk icon cache.  -*- mode: sh -*-
+#
+# Written by Colin Walters <walters verbum org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if test -x "$(which gtk-update-icon-cache 2>/dev/null)"; then
+    for dir in /usr/share/icons/*; do
+       if test -f $dir/index.theme; then
+           if ! gtk-update-icon-cache --quiet $dir; then
+               echo "Failed to run gtk-update-icon-cache for $dir"
+               exit 1
+           fi
+       fi
+    done
+fi
diff --git a/src/triggers/0090desktop-database.trigger b/src/triggers/0090desktop-database.trigger
new file mode 100755
index 0000000..25da1e9
--- /dev/null
+++ b/src/triggers/0090desktop-database.trigger
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Post-installation hook for desktop files.  -*- mode: sh -*-
+#
+# Written by Matthias Clasen <mclasen redhat com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if test -x "$(which update-desktop-database 2>/dev/null)"; then
+    exec update-desktop-database -q /usr/share/applications
+fi
diff --git a/src/triggers/0100fontconfig-cache.trigger b/src/triggers/0100fontconfig-cache.trigger
new file mode 100755
index 0000000..3b93b8b
--- /dev/null
+++ b/src/triggers/0100fontconfig-cache.trigger
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Post-installation hook for the FontConfig cache -*- mode: sh -*-
+#
+# Written by Adrian Perez de Castro <aperez igalia com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+if test -x "$(which fc-cache 2>/dev/null)"; then
+    exec fc-cache --system-only
+fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]