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
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
/* This file is parsed by m4 and windres and RC.EXE so please keep it simple. */
+#include "version_nano.h"
#ifndef LIBUSB_MAJOR
#define LIBUSB_MAJOR 1
#endif
#define LIBUSB_MICRO 11
#endif
#ifndef LIBUSB_NANO
-#define LIBUSB_NANO 10502
+#define LIBUSB_NANO 0
#endif
/* LIBUSB_RC is the release candidate suffix. Should normally be empty. */
#ifndef LIBUSB_RC