mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-16 04:17:25 +00:00
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>
This commit is contained in:
committed by
Armin Kuster
parent
b472160c77
commit
a64eec1771
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
Add code to detect openembedded python interpreter
|
Add code to detect openembedded python interpreter
|
||||||
|
|
||||||
OE does not use /usr/bin/env as part of the interpreter, so it does not
|
OE does not use /usr/bin/env as part of the interpreter, Instead, it's a
|
||||||
update ufw with the interpreter name.
|
full path in sys.executable.
|
||||||
|
|
||||||
Upstream-Status: Inappropriate (Embedded)
|
Upstream-Status: Inappropriate (Embedded)
|
||||||
Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
|
Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
|
||||||
@@ -17,9 +17,9 @@ index 75c1105..3f9a5e0 100644
|
|||||||
"-i.jjm",
|
"-i.jjm",
|
||||||
"1s%^#.*python.*%#! " + sys.executable + "%g",
|
"1s%^#.*python.*%#! " + sys.executable + "%g",
|
||||||
'staging/ufw'])
|
'staging/ufw'])
|
||||||
+ elif '-native/python' in sys.executable and \
|
+ elif '/python' in sys.executable and \
|
||||||
+ os.path.basename(sys.executable) in ['python', 'python3']:
|
+ os.path.basename(sys.executable) in ['python', 'python3']:
|
||||||
+ print("Detected oe native python " + os.path.basename(sys.executable))
|
+ print("Detected full path " + sys.executable + ". substituting " + os.path.basename(sys.executable))
|
||||||
+ subprocess.call(["sed",
|
+ subprocess.call(["sed",
|
||||||
+ "-i.jjm",
|
+ "-i.jjm",
|
||||||
+ "1s%python$%"
|
+ "1s%python$%"
|
||||||
|
|||||||
+2
-12
@@ -14,10 +14,6 @@ detected or specified on the build line.
|
|||||||
Upstream-Status: Inappropriate [ embedded specific ]
|
Upstream-Status: Inappropriate [ embedded specific ]
|
||||||
|
|
||||||
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
|
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
|
||||||
|
|
||||||
Added conditional to handle sys.executable without env on python3
|
|
||||||
|
|
||||||
Signed-off-by Jate Sujjavanich <jatedev@gmail.com>
|
|
||||||
---
|
---
|
||||||
setup.py | 34 ++++++++++++++++++++++++++++------
|
setup.py | 34 ++++++++++++++++++++++++++++------
|
||||||
1 file changed, 28 insertions(+), 6 deletions(-)
|
1 file changed, 28 insertions(+), 6 deletions(-)
|
||||||
@@ -47,7 +43,7 @@ index b13d11c..73acdef 100644
|
|||||||
# Now byte-compile everything
|
# Now byte-compile everything
|
||||||
super(Install, self).run()
|
super(Install, self).run()
|
||||||
|
|
||||||
@@ -107,12 +112,29 @@ class Install(_install, object):
|
@@ -107,12 +112,23 @@ class Install(_install, object):
|
||||||
for f in [ script, manpage, manpage_f ]:
|
for f in [ script, manpage, manpage_f ]:
|
||||||
self.mkpath(os.path.dirname(f))
|
self.mkpath(os.path.dirname(f))
|
||||||
|
|
||||||
@@ -66,13 +62,7 @@ index b13d11c..73acdef 100644
|
|||||||
- 'staging/ufw'])
|
- 'staging/ufw'])
|
||||||
+ print("Updating staging/ufw to use (%s)" % (sys.executable))
|
+ print("Updating staging/ufw to use (%s)" % (sys.executable))
|
||||||
+
|
+
|
||||||
+ if not re.search("(/usr/bin/env)", sys.executable):
|
+ if re.search("(/usr/bin/env)", sys.executable):
|
||||||
+ print("Did not find 'env' in sys.executable (%s)" % (sys.executable))
|
|
||||||
+ subprocess.call(["sed",
|
|
||||||
+ "-i",
|
|
||||||
+ "1s%^#.*python.*%#! /usr/bin/env " + sys.executable + "%g",
|
|
||||||
+ 'staging/ufw'])
|
|
||||||
+ elif re.search("(/usr/bin/env)", sys.executable):
|
|
||||||
+ print("found 'env' in sys.executable (%s)" % (sys.executable))
|
+ print("found 'env' in sys.executable (%s)" % (sys.executable))
|
||||||
+ subprocess.call(["sed",
|
+ subprocess.call(["sed",
|
||||||
+ "-i.jjm",
|
+ "-i.jjm",
|
||||||
|
|||||||
Reference in New Issue
Block a user