reported motion version fix

This commit is contained in:
Calin Crisan 2016-11-13 12:48:27 +02:00
parent d28d16e5c8
commit ed5ba45067
2 changed files with 28 additions and 2 deletions

View File

@ -0,0 +1,16 @@
diff -uNr motion/version.sh motion.new/version.sh
--- motion/version.sh 2016-11-13 12:45:14.143548855 +0200
+++ motion.new/version.sh 2016-11-13 12:45:31.683635991 +0200
@@ -1,8 +1,9 @@
#!/bin/sh
BASE_VERSION="4.0.1"
if [ -d .git ]; then
- GIT_COMMIT=`git show -s --format=%h`
- printf "$BASE_VERSION+git$GIT_COMMIT"
+ GIT_COMMIT=`git show -s --format=%h`
+ printf "$BASE_VERSION+git$GIT_COMMIT"
else
- printf "$BASE_VERSION+gitUNKNOWN"
+ printf "$BASE_VERSION+git$(basename $(pwd) | cut -d '-' -f 2)"
fi
+

View File

@ -83,8 +83,18 @@ def get_all_versions():
def compare_versions(version1, version2):
version1 = [int(n) for n in version1.split('.')]
version2 = [int(n) for n in version2.split('.')]
version1 = re.sub('[^0-9.]', '', version1)
version2 = re.sub('[^0-9.]', '', version2)
def int_or_0(n):
try:
return int(n)
except:
return 0
version1 = [int_or_0(n) for n in version1.split('.')]
version2 = [int_or_0(n) for n in version2.split('.')]
len1 = len(version1)
len2 = len(version2)