[dune-common] 04/06: Rename git-whitespace-hook to dune-git-whitespace-hook.
Ansgar Burchardt
ansgar at moszumanska.debian.org
Wed Jan 15 12:44:23 UTC 2014
This is an automated email from the git hooks/post-receive script.
ansgar pushed a commit to annotated tag debian/2.3.20140111beta1-1
in repository dune-common.
commit a37b4572ec1e72773764cd0ffa1960ed64639fa0
Author: Ansgar Burchardt <ansgar at debian.org>
Date: Wed Jan 15 09:01:06 2014 +0100
Rename git-whitespace-hook to dune-git-whitespace-hook.
The name git-whitespace-hook is a bit too generic for a DUNE-specific
tool.
---
debian/patches/rename-git-whitespace-hook.patch | 40 +++++++++++++++++++++++++
debian/patches/series | 1 +
debian/rules | 1 +
3 files changed, 42 insertions(+)
diff --git a/debian/patches/rename-git-whitespace-hook.patch b/debian/patches/rename-git-whitespace-hook.patch
new file mode 100644
index 0000000..2a881e5
--- /dev/null
+++ b/debian/patches/rename-git-whitespace-hook.patch
@@ -0,0 +1,40 @@
+From: Ansgar Burchardt <ansgar at debian.org>
+Subject: Rename git-whitespace-hook to dune-git-whitespace-hook.
+
+The name git-whitespace-hook is a bit too generic for a DUNE-specific
+tool.
+
+--- a/bin/dunecontrol
++++ b/bin/dunecontrol
+@@ -466,17 +466,28 @@
+ fi
+ else
+ # standard handling of Git whitespace hook
++ for f in dune-git-whitespace-hook git-whitespace-hook; do
++ f="${PREFIX_DIR}/bin/${f}"
++ if [ -e "${f}" ]; then
++ git_whitespace_hook="${f}"
++ break
++ fi
++ done
++ if [ -z "${git_whitespace_hook:-}" ]; then
++ echo "Did not find git-whitespace-hook." >&2
++ exit 1
++ fi
+ if [ ! -e "$GITHOOKPATH" ]; then
+ # there is no hook yet, we can safely install ours
+ echo "--> Installing Git pre-commit hook to enforce whitespace policy"
+- cp -p "$PREFIX_DIR/bin/git-whitespace-hook" "$GITHOOKPATH"
++ cp -p "${git_whitespace_hook}" "$GITHOOKPATH"
+ else
+ # there is already a hook, check whether it is our whitespace hook
+ local HOOKTAG="$(eval head -n 2 \"$GITHOOKPATH\" | tail -n 1)"
+ if [ "x$HOOKTAG" = "x# dune-git-whitespace-hook" ]; then
+- if [ "$PREFIX_DIR/bin/git-whitespace-hook" -nt "$GITHOOKPATH" ]; then
++ if [ "${git_whitespace_hook}" -nt "$GITHOOKPATH" ]; then
+ echo "--> Updating Git pre-commit hook with newer version"
+- cp -p "$PREFIX_DIR/bin/git-whitespace-hook" "$GITHOOKPATH"
++ cp -p "${git_whitespace_hook}" "$GITHOOKPATH"
+ fi
+ else
+ echo "WARNING: Existing pre-commit hook found!"
diff --git a/debian/patches/series b/debian/patches/series
index ace4780..71465ab 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ dune-autogen.patch
aclocal.patch
svn-version.patch
skip-dirs-starting-with-dot.patch
+rename-git-whitespace-hook.patch
diff --git a/debian/rules b/debian/rules
index 82d89cb..0f2d0a4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,6 +18,7 @@ override_dh_auto_install-arch:
mv debian/tmp/usr/bin/mpi-config debian/tmp/usr/bin/dune-mpi-config
mv debian/tmp/usr/bin/am2cmake.py debian/tmp/usr/bin/dune-am2cmake
+ mv debian/tmp/usr/bin/git-whitespace-hook debian/tmp/usr/bin/dune-git-whitespace-hook
sed -i "s,/usr/lib/dunecontrol/,& /usr/lib/$(DEB_HOST_MULTIARCH)/dunecontrol/," debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/dunemodules.lib
override_dh_auto_install-indep:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/dune-common.git
More information about the debian-science-commits
mailing list