summaryrefslogtreecommitdiff
path: root/.private
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2012-05-10 15:56:51 +0100
committerPete Batard <pete@akeo.ie>2012-05-10 15:56:51 +0100
commita221271c67414ad5372431dced352fc2b1e15cbc (patch)
treed478296fd62f6ccc4bf35a6c6dece525295703cc /.private
parent7e52e1e7534ead3f66b13bdcb28ac8587ff47ab0 (diff)
downloadlibusb-a221271c67414ad5372431dced352fc2b1e15cbc.tar.gz
Misc: Separate nano from version.h
* As version.h processed by autotools, the automatic updating of the nano there can result in unneeded reconfs (eg. after issuing a git pull, regardless of whether the conf is still valid) * Avoid this by placing the nano in its own file, as it won't be processed by autoconf. This also simplifies the versioning git hooks and removes the sed dependency.
Diffstat (limited to '.private')
-rwxr-xr-x.private/pre-commit.sh12
1 files changed, 2 insertions, 10 deletions
diff --git a/.private/pre-commit.sh b/.private/pre-commit.sh
index c62fb35..7c95674 100755
--- a/.private/pre-commit.sh
+++ b/.private/pre-commit.sh
@@ -26,14 +26,8 @@
BRANCH_OFFSET=10000
################################################################################
-type -P sed &>/dev/null || { echo "sed command not found. Aborting." >&2; exit 1; }
type -P git &>/dev/null || { echo "git command not found. Aborting." >&2; exit 1; }
-# The -b option of sed, which we use to prevent CRLF conversions on Windows
-# was only introduced recently, and Linux distros may not have it
-SED_CMD='sed -b'
-$SED_CMD --version > /dev/null 2>&1 || SED_CMD='sed'
-
NANO=`git log --oneline | wc -l`
NANO=`expr $NANO + $BRANCH_OFFSET`
# Amended commits need to have the nano corrected. Current versions of git hooks
@@ -44,7 +38,5 @@ if [ -f .amend ]; then
NANO=`expr $NANO - 1`
fi
echo "setting nano to $NANO"
-# -i option of sed is useless on Windows.
-$SED_CMD -e "s/^#define LIBUSB_NANO.*/#define LIBUSB_NANO $NANO/" libusb/version.h > libusb/version.h~
-mv libusb/version.h~ libusb/version.h
-git add libusb/version.h
+echo "#define LIBUSB_NANO $NANO" > libusb/version_nano.h
+git add libusb/version_nano.h