Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/tools/.gitattributes b/tools/.gitattributes
- new file mode 100644
- index 0000000..0196216
- --- /dev/null
- +++ b/tools/.gitattributes
- @@ -0,0 +1 @@
- +create_version_h.sh export-subst
- diff --git a/tools/create_version_h.sh b/tools/create_version_h.sh
- index 83b33d6..548715e 100755
- --- a/tools/create_version_h.sh
- +++ b/tools/create_version_h.sh
- @@ -6,7 +6,12 @@ H_FILE=$1
- VERSION_H_NEEDS_UPDATE=1
- -NEW_VERSION=`git describe --tags HEAD | sed 's,^release-,,;s,-,+,;s,-,~,;'`
- +NEW_VERSION=`git describe --tags --dirty | sed 's,^release-,,;s,-,+,;s,-,~,;'`
- +
- +# if we are not in a git checkout, NEW_VERSION is empty
- +if [ -z "${NEW_VERSION}" ]; then
- + NEW_VERSION="a $NEW_VERSION a archive-$Format:%H"
- +fi
- # version.h exists => check if it containts the up-to-date version
- if [ -f ${H_FILE} ]; then
- @@ -17,5 +22,5 @@ if [ -f ${H_FILE} ]; then
- fi
- if [ $VERSION_H_NEEDS_UPDATE -eq 1 ]; then
- - echo "#define PACKAGE_VERSION \"${NEW_VERSION}\"" > ${H_FILE}
- + echo "#define PACKAGE_VERSION \"${NEW_VERSION}\"" >> ${H_FILE}
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement