Skip to contentSkip to conversation

nmap: change shebang to python3

PATCH Superseded Changqing Li 2 participants 3 messages May 11, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nmap: change shebang to python3

From: Changqing Li <[email protected]>

upstream nmap is python2 compatiable now, but this recipe support python3.

---
 meta-oe/recipes-security/nmap/nmap_7.80.bb | 3 +++
 1 file changed, 3 insertions(+)
meta-oe/recipes-security/nmap/nmap_7.80.bb +3 -0
index c76d2324e..ad5e7248e 100644
@@ -53,6 +53,9 @@ do_install_append() {
     if [ -f "${D}${bindir}/ndiff" ]; then
        sed -i 's@^#!.*$@#!/usr/bin/env python3@g'   ${D}${bindir}/ndiff
     fi
+    if [ -f "${D}${bindir}/uninstall_ndiff" ]; then
+       sed -i 's@^#!.*$@#!/usr/bin/env python3@g'   ${D}${bindir}/uninstall_ndiff
+    fi
 }
 
 FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR} ${datadir}/ncat"
Signature · 1 line
2.17.1
#1 lore raw
Quoted 23 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Changqing Li
Sent: den 11 maj 2021 09:47
To: [email protected]
Subject: [oe] [PATCH] nmap: change shebang to python3

From: Changqing Li <[email protected]>

upstream nmap is python2 compatiable now, but this recipe support python3.

---
 meta-oe/recipes-security/nmap/nmap_7.80.bb | 3 +++
 1 file changed, 3 insertions(+)
meta-oe/recipes- renamed from meta-oe/recipes-security/nmap/nmap_7.80.bb +0 -0

security/nmap/nmap_7.80.bb
index c76d2324e..ad5e7248e 100644

meta-oe/recipes-security/nmap/nmap_7.80.bb do_install_append() { · line 58

Quoted 6 lines
meta-oe/recipes-security/nmap/nmap_7.80.bb +3 -0
@@ -53,6 +53,9 @@ do_install_append() {
     if [ -f "${D}${bindir}/ndiff" ]; then
        sed -i 's@^#!.*$@#!/usr/bin/env python3@g'   ${D}${bindir}/ndiff
     fi
+    if [ -f "${D}${bindir}/uninstall_ndiff" ]; then
+       sed -i 's@^#!.*$@#!/usr/bin/env python3@g' ${D}${bindir}/uninstall_ndiff
+    fi

This can be simplified to:

      for cmd in ndiff uninstall_ndiff; do
        if [ -f "${D}${bindir}/$cmd" ]; then
           sed -i 's@^#!.*$@#!/usr/bin/env python3@g' ${D}${bindir}/$cmd
        fi
      done
Quoted 5 lines
meta-oe/recipes-security/nmap/nmap_7.80.bb +0 -1
 }
 
 FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR} ${datadir}/ncat"
--

2.17.1

//Peter

#2 lore raw
Quoted 33 lines · Peter Kjellerstedt

[Please note: This e-mail is from an EXTERNAL e-mail address]

Quoted 23 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Changqing Li
Sent: den 11 maj 2021 09:47
To: [email protected]
Subject: [oe] [PATCH] nmap: change shebang to python3

From: Changqing Li <[email protected]>

upstream nmap is python2 compatiable now, but this recipe support python3.

---
  meta-oe/recipes-security/nmap/nmap_7.80.bb | 3 +++
  1 file changed, 3 insertions(+)
meta-oe/recipes- renamed from meta-oe/recipes-security/nmap/nmap_7.80.bb +0 -0

security/nmap/nmap_7.80.bb
index c76d2324e..ad5e7248e 100644

meta-oe/recipes-security/nmap/nmap_7.80.bb do_install_append() { · line 58

Quoted 6 lines
meta-oe/recipes-security/nmap/nmap_7.80.bb +3 -0
@@ -53,6 +53,9 @@ do_install_append() {
      if [ -f "${D}${bindir}/ndiff" ]; then
         sed -i 's@^#!.*$@#!/usr/bin/env python3@g'   ${D}${bindir}/ndiff
      fi
+    if [ -f "${D}${bindir}/uninstall_ndiff" ]; then
+       sed -i 's@^#!.*$@#!/usr/bin/env python3@g' ${D}${bindir}/uninstall_ndiff
+    fi

This can be simplified to:

Quoted 5 lines
       for cmd in ndiff uninstall_ndiff; do
         if [ -f "${D}${bindir}/$cmd" ]; then
            sed -i 's@^#!.*$@#!/usr/bin/env python3@g' ${D}${bindir}/$cmd
         fi
       done

Thanks.  Have sent a V2 patch

Quoted 8 lines
Quoted 6 lines
meta-oe/recipes-security/nmap/nmap_7.80.bb +0 -1
  }
 
  FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR} ${datadir}/ncat"
--

2.17.1

//Peter