diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2013-04-10 17:41:34 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2013-04-10 17:41:34 +0200 |
commit | 081ea50281a0785223389810c0703f5ac65df5af (patch) | |
tree | bf52082c66ce73ef78b92a09989713745c2c68ad /scripts/gconf | |
parent | 1f85e924bac34e3bb24dd36f073555bb0819a4b4 (diff) | |
download | dotfiles-081ea50281a0785223389810c0703f5ac65df5af.tar.gz dotfiles-081ea50281a0785223389810c0703f5ac65df5af.tar.xz dotfiles-081ea50281a0785223389810c0703f5ac65df5af.zip |
Scripts: slightly reorganize
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'scripts/gconf')
-rw-r--r-- | scripts/gconf/identity_modulo_mtime.xsl | 13 | ||||
-rwxr-xr-x | scripts/gconf/mtime_strip.sh | 10 |
2 files changed, 23 insertions, 0 deletions
diff --git a/scripts/gconf/identity_modulo_mtime.xsl b/scripts/gconf/identity_modulo_mtime.xsl new file mode 100644 index 0000000..06a49c7 --- /dev/null +++ b/scripts/gconf/identity_modulo_mtime.xsl @@ -0,0 +1,13 @@ +<!-- + shamelessly copied from + http://en.wikipedia.org/wiki/Identity_transform#Using_XSLT + --> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + <xsl:template match="@mtime"/> +</xsl:stylesheet> diff --git a/scripts/gconf/mtime_strip.sh b/scripts/gconf/mtime_strip.sh new file mode 100755 index 0000000..7a9a336 --- /dev/null +++ b/scripts/gconf/mtime_strip.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +STARTDIR=. +if [ $# -ge 1 ]; then + STARTDIR="$1" +fi + +find "${STARTDIR}" -name '*.xml' -and -not -empty -print0 \ + | xargs -0 -I "{}" \ + sh -c 'mv "{}" "{}.orig"; xsltproc identity_modulo_mtime.xsl "{}.orig" > "{}"; rm -- "{}.orig"' |