[meta-security] scapy: Fix shebang for python3

Submitted by Scott Ellis on Jan. 19, 2019, 7:58 p.m. | Patch ID: 158122

Details

Message ID 1547927932-4718-1-git-send-email-scott@jumpnowtek.com
State New
Headers show

Commit Message

Scott Ellis Jan. 19, 2019, 7:58 p.m.
Both scapy and UTscapy have python in the shebang line
regardless of whether python3-scapy or python-scapy
was built.

Signed-off-by: Scott Ellis <scott@jumpnowtek.com>
---
 recipes-security/scapy/python-scapy.inc | 7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/recipes-security/scapy/python-scapy.inc b/recipes-security/scapy/python-scapy.inc
index f90b93d..43ef959 100644
--- a/recipes-security/scapy/python-scapy.inc
+++ b/recipes-security/scapy/python-scapy.inc
@@ -10,6 +10,13 @@  SRC_URI[sha256sum] = "1baa048936207ceb1a4281a0e1e3b4317667c754872a0bb4734c5213c4
 
 inherit pypi
 
+do_install_append() {
+    if [ "${PYTHON_PN}" = "python3" ]; then
+        sed -i -e 's/python/python3/' ${D}${bindir}/scapy
+        sed -i -e 's/python/python3/' ${D}${bindir}/UTscapy
+    fi
+}
+
 RDEPENDS_${PN} = "tcpdump ${PYTHON_PN}-compression ${PYTHON_PN}-cryptography ${PYTHON_PN}-netclient  \
                   ${PYTHON_PN}-netserver ${PYTHON_PN}-pydoc ${PYTHON_PN}-pkgutil ${PYTHON_PN}-shell \
                   ${PYTHON_PN}-threading ${PYTHON_PN}-numbers ${PYTHON_PN}-pycrypto"