mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 13:46:32 +00:00
reported motion version fix
This commit is contained in:
parent
d28d16e5c8
commit
ed5ba45067
16
package/motion/0001-version.patch
Normal file
16
package/motion/0001-version.patch
Normal 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
|
||||
+
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user