[meta-networking,dunfell] ufw: Fix interpreter for installed ufw and test ufw

Submitted by Jate S on Aug. 13, 2021, 4:20 p.m. | Patch ID: 180071

Details

Message ID 20210813162047.20015-1-jatedev@gmail.com
State New
Headers show

Commit Message

Jate S Aug. 13, 2021, 4:20 p.m.
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>
---
 ...to-detect-openembedded-python-interpreter.patch |  8 ++++----
 .../ufw/setup-only-make-one-reference-to-env.patch | 14 ++------------
 2 files changed, 6 insertions(+), 16 deletions(-)

Patch hide | download patch | download mbox

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 @@ 
 Add code to detect openembedded python interpreter
 
-OE does not use /usr/bin/env as part of the interpreter, so it does not
-update ufw with the interpreter name.
+OE does not use /usr/bin/env as part of the interpreter, Instead, it's a
+full path in sys.executable.
 
 Upstream-Status: Inappropriate (Embedded)
 Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
@@ -17,9 +17,9 @@  index 75c1105..3f9a5e0 100644
                               "-i.jjm",
                               "1s%^#.*python.*%#! " + sys.executable + "%g",
                               'staging/ufw'])
-+        elif '-native/python' in sys.executable and \
++        elif '/python' in sys.executable and \
 +            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",
 +                             "-i.jjm",
 +                            "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.
 Upstream-Status: Inappropriate [ embedded specific ]
 
 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 ++++++++++++++++++++++++++++------
  1 file changed, 28 insertions(+), 6 deletions(-)
@@ -47,7 +43,7 @@  index b13d11c..73acdef 100644
          # Now byte-compile everything
          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 ]:
              self.mkpath(os.path.dirname(f))
  
@@ -66,13 +62,7 @@  index b13d11c..73acdef 100644
 -                         'staging/ufw'])
 +        print("Updating staging/ufw to use (%s)" % (sys.executable))
 +
-+        if not 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):
++        if re.search("(/usr/bin/env)", sys.executable):
 +            print("found 'env' in sys.executable (%s)" % (sys.executable))
 +            subprocess.call(["sed",
 +                             "-i.jjm",