diff options
author | Pete Batard <pete@akeo.ie> | 2011-09-09 12:40:45 +0100 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2011-09-09 12:40:45 +0100 |
commit | 6cc15eda2ccf61ec9cbb01185d1a37dd05ab488a (patch) | |
tree | a5a6e196e5d16e5b4605537a6efe42f266810864 | |
parent | da6ec3ea429d49c55a49c6b10ceaad26d3fe4b25 (diff) | |
download | libusb-6cc15eda2ccf61ec9cbb01185d1a37dd05ab488a.tar.gz |
yet another stupid CRLF issue with git
-rw-r--r-- | _bump.sh | 72 |
1 files changed, 36 insertions, 36 deletions
@@ -1,36 +1,36 @@ -#!/bin/sh
-# bump the version and update the git tree accordingly
-# !!!THIS SCRIPT IS FOR INTERNAL DEVELOPER USE ONLY!!!
-
-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; }
-
-if [ ! -n "$1" ]; then
- TAG=$(git describe --tags --abbrev=0 2>/dev/null)
- if [ ! -n "$TAG" ]; then
- echo Unable to read tag - aborting.
- exit 1
- fi
-else
- TAG=$1
-fi
-if [ ! ${TAG:0:3} = 'pbh' ]; then
- echo Tag "$TAG" does not start with 'pbh' - aborting
- exit 1
-fi
-TAGVER=${TAG:3}
-case $TAGVER in *[!0-9]*)
- echo "$TAGVER is not a number"
- exit 1
-esac
-OFFSET=9000
-TAGVER=`expr $TAGVER + 1`
-TAGVER_OFF=`expr $TAGVER + $OFFSET`
-echo "Bumping version to pbh$TAGVER (nano: $TAGVER_OFF)"
-sed -e "s/\(^m4_define(LIBUSB_NANO.*\)/m4_define(LIBUSB_NANO, [$TAGVER_OFF])/" configure.ac >> configure.ac~
-mv configure.ac~ configure.ac
-# we're duplicating libusb_version.h generation here, but that avoids having to run configure
-sed -e "s/\(^#define LIBUSB_VERSION_NANO.*\)/#define LIBUSB_VERSION_NANO $TAGVER_OFF/" libusb/libusb_version.h > libusb/libusb_version.h~
-mv libusb/libusb_version.h~ libusb/libusb_version.h
-git commit -a -m "bumped internal version" -e
-git tag "pbh$TAGVER"
+#!/bin/sh +# bump the version and update the git tree accordingly +# !!!THIS SCRIPT IS FOR INTERNAL DEVELOPER USE ONLY!!! + +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; } + +if [ ! -n "$1" ]; then + TAG=$(git describe --tags --abbrev=0 2>/dev/null) + if [ ! -n "$TAG" ]; then + echo Unable to read tag - aborting. + exit 1 + fi +else + TAG=$1 +fi +if [ ! ${TAG:0:3} = 'pbh' ]; then + echo Tag "$TAG" does not start with 'pbh' - aborting + exit 1 +fi +TAGVER=${TAG:3} +case $TAGVER in *[!0-9]*) + echo "$TAGVER is not a number" + exit 1 +esac +OFFSET=9000 +TAGVER=`expr $TAGVER + 1` +TAGVER_OFF=`expr $TAGVER + $OFFSET` +echo "Bumping version to pbh$TAGVER (nano: $TAGVER_OFF)" +sed -e "s/\(^m4_define(LIBUSB_NANO.*\)/m4_define(LIBUSB_NANO, [$TAGVER_OFF])/" configure.ac >> configure.ac~ +mv configure.ac~ configure.ac +# we're duplicating libusb_version.h generation here, but that avoids having to run configure +sed -e "s/\(^#define LIBUSB_VERSION_NANO.*\)/#define LIBUSB_VERSION_NANO $TAGVER_OFF/" libusb/libusb_version.h > libusb/libusb_version.h~ +mv libusb/libusb_version.h~ libusb/libusb_version.h +git commit -a -m "bumped internal version" -e +git tag "pbh$TAGVER" |