diff options
author | Jate Sujjavanich <jatedev@gmail.com> | 2021-08-13 16:20:47 +0000 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2021-08-15 07:14:11 -0700 |
commit | a64eec177151a7076a2fd6937e4abdb8e2264a59 (patch) | |
tree | 951428717f29fa5b281cae3a3a6f2fdb243a90ee | |
parent | b472160c77dcfdf46e4d4eca69428b971238f4a9 (diff) | |
download | meta-openembedded-a64eec177151a7076a2fd6937e4abdb8e2264a59.tar.gz |
ufw: Fix interpreter for installed ufw and test ufw
Revert patch to setup-only-make-one-reference-to-env.patch and make
patch for python3 interpreter fix apply to runs of setup.py during
self test as well as installs.
Reported-by: Kenta Nakamura <Nakamura.Kenta@bp.MitsubishiElectric.co.jp>
Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
2 files changed, 6 insertions, 16 deletions
diff --git a/meta-networking/recipes-connectivity/ufw/ufw/Add-code-to-detect-openembedded-python-interpreter.patch b/meta-networking/recipes-connectivity/ufw/ufw/Add-code-to-detect-openembedded-python-interpreter.patch index 85d51ca21..e1fcf0ca5 100644 --- a/meta-networking/recipes-connectivity/ufw/ufw/Add-code-to-detect-openembedded-python-interpreter.patch +++ b/meta-networking/recipes-connectivity/ufw/ufw/Add-code-to-detect-openembedded-python-interpreter.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | Add code to detect openembedded python interpreter | 1 | Add code to detect openembedded python interpreter |
2 | 2 | ||
3 | OE does not use /usr/bin/env as part of the interpreter, so it does not | 3 | OE does not use /usr/bin/env as part of the interpreter, Instead, it's a |
4 | update ufw with the interpreter name. | 4 | full path in sys.executable. |
5 | 5 | ||
6 | Upstream-Status: Inappropriate (Embedded) | 6 | Upstream-Status: Inappropriate (Embedded) |
7 | Signed-off-by: Jate Sujjavanich <jatedev@gmail.com> | 7 | Signed-off-by: Jate Sujjavanich <jatedev@gmail.com> |
@@ -17,9 +17,9 @@ index 75c1105..3f9a5e0 100644 | |||
17 | "-i.jjm", | 17 | "-i.jjm", |
18 | "1s%^#.*python.*%#! " + sys.executable + "%g", | 18 | "1s%^#.*python.*%#! " + sys.executable + "%g", |
19 | 'staging/ufw']) | 19 | 'staging/ufw']) |
20 | + elif '-native/python' in sys.executable and \ | 20 | + elif '/python' in sys.executable and \ |
21 | + os.path.basename(sys.executable) in ['python', 'python3']: | 21 | + os.path.basename(sys.executable) in ['python', 'python3']: |
22 | + print("Detected oe native python " + os.path.basename(sys.executable)) | 22 | + print("Detected full path " + sys.executable + ". substituting " + os.path.basename(sys.executable)) |
23 | + subprocess.call(["sed", | 23 | + subprocess.call(["sed", |
24 | + "-i.jjm", | 24 | + "-i.jjm", |
25 | + "1s%python$%" | 25 | + "1s%python$%" |
diff --git a/meta-networking/recipes-connectivity/ufw/ufw/setup-only-make-one-reference-to-env.patch b/meta-networking/recipes-connectivity/ufw/ufw/setup-only-make-one-reference-to-env.patch index f487a6fd6..ff704b5a4 100644 --- a/meta-networking/recipes-connectivity/ufw/ufw/setup-only-make-one-reference-to-env.patch +++ b/meta-networking/recipes-connectivity/ufw/ufw/setup-only-make-one-reference-to-env.patch | |||
@@ -14,10 +14,6 @@ detected or specified on the build line. | |||
14 | Upstream-Status: Inappropriate [ embedded specific ] | 14 | Upstream-Status: Inappropriate [ embedded specific ] |
15 | 15 | ||
16 | Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> | 16 | Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> |
17 | |||
18 | Added conditional to handle sys.executable without env on python3 | ||
19 | |||
20 | Signed-off-by Jate Sujjavanich <jatedev@gmail.com> | ||
21 | --- | 17 | --- |
22 | setup.py | 34 ++++++++++++++++++++++++++++------ | 18 | setup.py | 34 ++++++++++++++++++++++++++++------ |
23 | 1 file changed, 28 insertions(+), 6 deletions(-) | 19 | 1 file changed, 28 insertions(+), 6 deletions(-) |
@@ -47,7 +43,7 @@ index b13d11c..73acdef 100644 | |||
47 | # Now byte-compile everything | 43 | # Now byte-compile everything |
48 | super(Install, self).run() | 44 | super(Install, self).run() |
49 | 45 | ||
50 | @@ -107,12 +112,29 @@ class Install(_install, object): | 46 | @@ -107,12 +112,23 @@ class Install(_install, object): |
51 | for f in [ script, manpage, manpage_f ]: | 47 | for f in [ script, manpage, manpage_f ]: |
52 | self.mkpath(os.path.dirname(f)) | 48 | self.mkpath(os.path.dirname(f)) |
53 | 49 | ||
@@ -66,13 +62,7 @@ index b13d11c..73acdef 100644 | |||
66 | - 'staging/ufw']) | 62 | - 'staging/ufw']) |
67 | + print("Updating staging/ufw to use (%s)" % (sys.executable)) | 63 | + print("Updating staging/ufw to use (%s)" % (sys.executable)) |
68 | + | 64 | + |
69 | + if not re.search("(/usr/bin/env)", sys.executable): | 65 | + if re.search("(/usr/bin/env)", sys.executable): |
70 | + print("Did not find 'env' in sys.executable (%s)" % (sys.executable)) | ||
71 | + subprocess.call(["sed", | ||
72 | + "-i", | ||
73 | + "1s%^#.*python.*%#! /usr/bin/env " + sys.executable + "%g", | ||
74 | + 'staging/ufw']) | ||
75 | + elif re.search("(/usr/bin/env)", sys.executable): | ||
76 | + print("found 'env' in sys.executable (%s)" % (sys.executable)) | 66 | + print("found 'env' in sys.executable (%s)" % (sys.executable)) |
77 | + subprocess.call(["sed", | 67 | + subprocess.call(["sed", |
78 | + "-i.jjm", | 68 | + "-i.jjm", |