Commit e1dbe04e authored by Philippe Coval's avatar Philippe Coval Committed by Ziran Sun

extlibs: Use patch as fallback and trap errors

This will be helpful for Tizen and others OS.

If lib is bundled as "imported git patch"
then application of "duplicated ocf.patch as git patch",
is not needed anymore, and relies on scons.

To Tizen maintainers:
From now on let's maintain only one version in tree,
ealier versions of git patches can be reverted,
For reference check:

Change-Id: I0598ddd5c846a2286218879d57381ec2f20c17a4
Signed-off-by: default avatarPhilippe Coval <>
Reviewed-on: default avatarjenkins-iotivity <>
Reviewed-by: default avatarZiran Sun <>
parent 637cd5aa
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Import('env') Import('env')
import SCons.Errors
import os import os
import sys import sys
import subprocess import subprocess
...@@ -79,10 +79,13 @@ if not found: ...@@ -79,10 +79,13 @@ if not found:
if os.path.exists('.git/HEAD'): if os.path.exists('.git/HEAD'):
# Apply ocf patch on git revision # Apply ocf patch on git revision
cmd = 'git checkout development && git reset --hard ' + mbedtls_revision + ' && git clean -f && git apply --whitespace=fix ../ocf.patch' cmd = 'git checkout development && git reset --hard ' + mbedtls_revision + ' && git clean -f && git apply --whitespace=fix ../ocf.patch'
os.system(cmd) res = os.system(cmd)
else: else:
print "mbedtls: error: missing %s" % pattern # Fallback to regular patch command
Exit(1) cmd = 'patch -p1 -l -f < ../ocf.patch'
res = os.system(cmd)
if 0 != res:
raise SCons.Errors.StopError('mbedtls: issue on applying patch: %d' % res)
os.chdir(start_dir) os.chdir(start_dir)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment