summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/Makefile.am2
-rwxr-xr-xcontrib/removetrailingwhitespace14
-rwxr-xr-xcontrib/removetrailingwhitespace.py.in15
-rwxr-xr-xpre-commit4
4 files changed, 19 insertions, 16 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 1db5b3091..40e6d3e92 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -19,6 +19,7 @@ endif
noinst_SCRIPTS = \
terminate.py \
pydiffer.py \
+ removetrailingwhitespace.py \
gnunet_pyexpect.py \
gnunet_janitor.py \
gnunet-chk.py
@@ -52,6 +53,7 @@ EXTRA_DIST = \
gnunet_pyexpect.py.in \
gnunet_janitor.py.in \
gnunet-chk.py.in \
+ removetrailingwhitespace.py.in \
pydiffer.py.in \
gnunet-gns-import.sh \
openvpn-tap32/tapw32/tap0901.sys \
diff --git a/contrib/removetrailingwhitespace b/contrib/removetrailingwhitespace
deleted file mode 100755
index 9e620cbb2..000000000
--- a/contrib/removetrailingwhitespace
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import re
-
-for fileName in sys.argv[1:]:
- f = open(fileName, 'r+')
- fileString = f.read()
-
- fileString = re.sub(r'[ ]+\n', r'\n', fileString)
- fileString = re.sub(r'\r', r'', fileString)
- f.seek(0)
- f.write(fileString)
- f.truncate(len(fileString))
diff --git a/contrib/removetrailingwhitespace.py.in b/contrib/removetrailingwhitespace.py.in
new file mode 100755
index 000000000..5824fb591
--- /dev/null
+++ b/contrib/removetrailingwhitespace.py.in
@@ -0,0 +1,15 @@
+#!@PYTHON@
+
+import sys
+import re
+
+
+for fileName in sys.argv[1:]:
+ f = open(fileName, 'r+')
+ fileString = f.read()
+
+ fileString = re.sub(r'[ ]+\n', r'\n', fileString)
+ fileString = re.sub(r'\r', r'', fileString)
+ f.seek(0)
+ f.write(fileString)
+ f.truncate(len(fileString))
diff --git a/pre-commit b/pre-commit
index 5213f2cf4..777728a6b 100755
--- a/pre-commit
+++ b/pre-commit
@@ -12,8 +12,8 @@ find $PATHS -name "*.c" -exec indent {} \;
find $PATHS -name "*.h" -exec indent {} \;
find $PATHS -name "*.c" -exec indent {} \;
find $PATHS -name "*.h" -exec indent {} \;
-find $PATHS -name "*.c" -exec contrib/removetrailingwhitespace {} \;
-find $PATHS -name "*.h" -exec contrib/removetrailingwhitespace {} \;
+find $PATHS -name "*.c" -exec contrib/removetrailingwhitespace.py {} \;
+find $PATHS -name "*.h" -exec contrib/removetrailingwhitespace.py {} \;
if test -x "`which 'dos2unix'`"
then
find $PATHS -name "*.c" -exec dos2unix {} \;