From de2d1a6d8ab61db7e6994c414a08f1a6ba7afb9b Mon Sep 17 00:00:00 2001 From: Andras Becsi Date: Wed, 10 Sep 2014 20:00:44 +0200 Subject: take_snapshot: check if dos2unix is in the path before using it Change-Id: If696de316dd7b3b801ba46d1a54c37eafa901bf1 Reviewed-by: Jocelyn Turcotte --- tools/scripts/take_snapshot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tools/scripts') diff --git a/tools/scripts/take_snapshot.py b/tools/scripts/take_snapshot.py index c08887e12..3696b9a7a 100755 --- a/tools/scripts/take_snapshot.py +++ b/tools/scripts/take_snapshot.py @@ -296,8 +296,12 @@ def exportChromium(): copyFile(f, os.path.join(third_party_chromium, f)) print("") -dos2unixVersion = StrictVersion(subprocess.Popen(['dos2unix', '-V'], stdout=subprocess.PIPE).communicate()[0].splitlines()[0].split()[1]) -if dos2unixVersion < StrictVersion('6.0.6'): +commandNotFound = subprocess.call(['which', 'dos2unix']) + +if not commandNotFound: + dos2unixVersion = StrictVersion(subprocess.Popen(['dos2unix', '-V', '| true'], stdout=subprocess.PIPE).communicate()[0].splitlines()[0].split()[1]) + +if commandNotFound or dos2unixVersion < StrictVersion('6.0.6'): raise Exception("You need dos2unix version 6.0.6 minimum.") clearDirectory(third_party) -- cgit v1.2.3