summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/hook-metadata22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/hook-metadata b/scripts/hook-metadata
new file mode 100755
index 00000000..fd8b3e0c
--- /dev/null
+++ b/scripts/hook-metadata
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# (c) 2014 - Bertrand Jacquin <beber@meleeweb.net>
+#
+# Called by git-commit with no arguments. The hook should
+# exit with non-zero status after issuing an appropriate message if
+# it wants to stop the commit.
+#
+# To enable this hook, run:
+# cd $(git rev-parse --show-toplevel)
+# chmod +x scripts/hook-metadata
+# ln -s scripts/hook-metadata .git/hooks/pre-commit
+
+ROOT="$(git rev-parse --show-toplevel)"
+REPO="$(< ${ROOT}/profiles/repo_name)"
+
+egencache --repo="${REPO}" \
+ --update \
+ --update-use-local-desc
+
+git add -vA "${ROOT}/profiles/use.local.desc"
+git add -vA "${ROOT}/metadata/md5-cache"