diff options
author | Joe MacDonald <joe_macdonald@mentor.com> | 2016-04-18 17:00:53 -0400 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2016-04-20 08:55:27 -0400 |
commit | 70bde9accebb072b42ec5b9557411caef7e9ee54 (patch) | |
tree | 17cb72358a4547ef1f2594967d1e68014a7bcfad /meta-networking/recipes-connectivity/samba/samba-4.4.2/20-do-not-import-target-module-while-cross-compile.patch | |
parent | ab62c7437ff28d045ecff3f82621990ff94662e6 (diff) | |
download | meta-openembedded-70bde9accebb072b42ec5b9557411caef7e9ee54.tar.gz |
samba: Update to latest stable
The previous version of Samba had many critical security updates that
would've required significant backporting effort. Update to the latest
stable release instead.
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-networking/recipes-connectivity/samba/samba-4.4.2/20-do-not-import-target-module-while-cross-compile.patch')
-rw-r--r-- | meta-networking/recipes-connectivity/samba/samba-4.4.2/20-do-not-import-target-module-while-cross-compile.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/samba/samba-4.4.2/20-do-not-import-target-module-while-cross-compile.patch b/meta-networking/recipes-connectivity/samba/samba-4.4.2/20-do-not-import-target-module-while-cross-compile.patch new file mode 100644 index 0000000000..e112b3b40b --- /dev/null +++ b/meta-networking/recipes-connectivity/samba/samba-4.4.2/20-do-not-import-target-module-while-cross-compile.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | Some modules such as dynamic library maybe cann't be imported while cross compile, | ||
2 | we just check whether does the module exist. | ||
3 | |||
4 | Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com> | ||
5 | |||
6 | Index: samba-4.4.2/buildtools/wafsamba/samba_bundled.py | ||
7 | =================================================================== | ||
8 | --- samba-4.4.2.orig/buildtools/wafsamba/samba_bundled.py | ||
9 | +++ samba-4.4.2/buildtools/wafsamba/samba_bundled.py | ||
10 | @@ -2,6 +2,7 @@ | ||
11 | |||
12 | import sys | ||
13 | import Build, Options, Logs | ||
14 | +import imp, os | ||
15 | from Configure import conf | ||
16 | from samba_utils import TO_LIST | ||
17 | |||
18 | @@ -230,17 +231,32 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, li | ||
19 | # versions | ||
20 | minversion = minimum_library_version(conf, libname, minversion) | ||
21 | |||
22 | - try: | ||
23 | - m = __import__(modulename) | ||
24 | - except ImportError: | ||
25 | - found = False | ||
26 | - else: | ||
27 | + # Find module in PYTHONPATH | ||
28 | + stuff = imp.find_module(modulename, [os.environ["PYTHONPATH"]]) | ||
29 | + if stuff: | ||
30 | try: | ||
31 | - version = m.__version__ | ||
32 | - except AttributeError: | ||
33 | + m = imp.load_module(modulename, stuff[0], stuff[1], stuff[2]) | ||
34 | + except ImportError: | ||
35 | found = False | ||
36 | + | ||
37 | + if conf.env.CROSS_COMPILE: | ||
38 | + # Some modules such as dynamic library maybe cann't be imported | ||
39 | + # while cross compile, we just check whether the module exist | ||
40 | + Logs.warn('Cross module[%s] has been found, but can not be loaded.' % (stuff[1])) | ||
41 | + found = True | ||
42 | else: | ||
43 | - found = tuplize_version(version) >= tuplize_version(minversion) | ||
44 | + try: | ||
45 | + version = m.__version__ | ||
46 | + except AttributeError: | ||
47 | + found = False | ||
48 | + else: | ||
49 | + found = tuplize_version(version) >= tuplize_version(minversion) | ||
50 | + finally: | ||
51 | + if stuff[0]: | ||
52 | + stuff[0].close() | ||
53 | + else: | ||
54 | + found = False | ||
55 | + | ||
56 | if not found and not conf.LIB_MAY_BE_BUNDLED(libname): | ||
57 | Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion)) | ||
58 | sys.exit(1) | ||