Install dependencies: added check for minimal version of x264
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 17 Nov 2012 17:58:15 +0000 (17:58 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 17 Nov 2012 17:58:15 +0000 (17:58 +0000)
Also fixed parsing of package version with epoch

build_files/build_environment/install_deps.sh

index fcf5fb227f9370066c5263d42cbfd32080ee7fe8..444bf8ea50b5461b97f6e7dc6eca504cce452df2 100755 (executable)
@@ -55,6 +55,7 @@ XVID_USE=false
 XVID_DEV=""
 X264_USE=false
 X264_DEV=""
+X264_VERSION_MIN=0.118
 VPX_USE=false
 VPX_VERSION_MIN=0.9.7
 VPX_DEV=""
@@ -605,7 +606,7 @@ check_package_DEB() {
 }
 
 check_package_version_match_DEB() {
-  v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*(([0-9]+\.?)+).*/\1/'`
+  v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*([0-9]+:)(([0-9]+\.?)+).*/\2/'`
 
   if [ -z "$v" ]; then
     return 1
@@ -616,7 +617,7 @@ check_package_version_match_DEB() {
 }
 
 check_package_version_ge_DEB() {
-  v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*(([0-9]+\.?)+).*/\1/'`
+  v=`apt-cache policy $1 | grep 'Candidate:' | sed -r 's/.*:\s*([0-9]+:)?(([0-9]+\.?)+).*/\2/'`
 
   if [ -z "$v" ]; then
     return 1
@@ -676,7 +677,7 @@ install_DEB() {
   fi
 
   X264_DEV="libx264-dev"
-  check_package_DEB $X264_DEV
+  check_package_version_ge_DEB $X264_DEV $X264_VERSION_MIN
   if [ $? -eq 0 ]; then
     sudo apt-get install -y $X264_DEV
     X264_USE=true