All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/4] package/nmap: bump to version 7.92
@ 2021-10-12 17:48 Adam Duskett
  2021-10-12 17:48 ` [Buildroot] [PATCH 2/4] package/python-xmljson: new package Adam Duskett
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Adam Duskett @ 2021-10-12 17:48 UTC (permalink / raw)
  To: buildroot
  Cc: Asaf Kahlon, Adam Duskett, Thomas Petazzoni, Ricardo Martincoski

In addition:
  - Remove upstream patch
  - Update license hash to reflect license version bump from 0.92 to 0.93

Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
 package/nmap/0002-ncat-unix-socket.patch | 30 ------------------------
 package/nmap/nmap.hash                   |  6 ++---
 package/nmap/nmap.mk                     |  2 +-
 3 files changed, 4 insertions(+), 34 deletions(-)
 delete mode 100644 package/nmap/0002-ncat-unix-socket.patch

diff --git a/package/nmap/0002-ncat-unix-socket.patch b/package/nmap/0002-ncat-unix-socket.patch
deleted file mode 100644
index b6484ebeea..0000000000
--- a/package/nmap/0002-ncat-unix-socket.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-ChangeLog:
-
-o [Ncat][GH#2154] Ncat no longer crashes when used with Unix domain sockets.
-
-Backported from: r38121
-
-Signed-off-by: Alexey Neyman <stilor@att.net>
-
-Index: ncat/ncat_main.c
-===================================================================
---- a/ncat/ncat_main.c	(revision 38120)
-+++ b/ncat/ncat_main.c	(revision 38121)
-@@ -846,7 +846,7 @@
-             targetaddrs->addr.un.sun_family = AF_UNIX;
-             strncpy(targetaddrs->addr.un.sun_path, argv[optind], sizeof(targetaddrs->addr.un.sun_path));
-             targetaddrs->addrlen = SUN_LEN(&targetaddrs->addr.un);
--            o.target = argv[optind];
-+            o.sslservername = o.target = argv[optind];
-             optind++;
-         } else
- #endif
-@@ -865,7 +865,7 @@
-                 targetaddrs->addr.vm.svm_cid = long_cid;
- 
-                 targetaddrs->addrlen = sizeof(targetaddrs->addr.vm);
--                o.target = argv[optind];
-+                o.sslservername = o.target = argv[optind];
-                 optind++;
-             }
-         } else
diff --git a/package/nmap/nmap.hash b/package/nmap/nmap.hash
index 8f69bbf613..dc379f30d4 100644
--- a/package/nmap/nmap.hash
+++ b/package/nmap/nmap.hash
@@ -1,5 +1,5 @@
-# From https://nmap.org/dist/sigs/nmap-7.91.tar.bz2.digest.txt (lowercase)
-sha256  18cc4b5070511c51eb243cdd2b0b30ff9b2c4dc4544c6312f75ce3a67a593300  nmap-7.91.tar.bz2
+# From https://nmap.org/dist/sigs/nmap-7.92.tar.bz2.digest.txt (lowercase)
+sha256  a5479f2f8a6b0b2516767d2f7189c386c1dc858d997167d7ec5cfc798c7571a1  nmap-7.92.tar.bz2
 
 # Locally calculated
-sha256  8254a9bc733f3312c6dcfe0d5a129c29e96ecb8b33408c652a8c7beb2e25b471  LICENSE
+sha256  133794301a764dfe8a60e38601e56657b7113e0337b452189725bbbed58baea0  LICENSE
diff --git a/package/nmap/nmap.mk b/package/nmap/nmap.mk
index 34cf61ff0b..f3994e9b38 100644
--- a/package/nmap/nmap.mk
+++ b/package/nmap/nmap.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-NMAP_VERSION = 7.91
+NMAP_VERSION = 7.92
 NMAP_SITE = https://nmap.org/dist
 NMAP_SOURCE = nmap-$(NMAP_VERSION).tar.bz2
 NMAP_DEPENDENCIES = liblinear libpcap
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 2/4] package/python-xmljson: new package
  2021-10-12 17:48 [Buildroot] [PATCH 1/4] package/nmap: bump to version 7.92 Adam Duskett
@ 2021-10-12 17:48 ` Adam Duskett
  2021-10-21 20:47   ` Arnout Vandecappelle
  2021-10-12 17:48 ` [Buildroot] [PATCH 3/4] package/python-pyndiff: new package, drop nmap ndiff option Adam Duskett
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Adam Duskett @ 2021-10-12 17:48 UTC (permalink / raw)
  To: buildroot
  Cc: Asaf Kahlon, Adam Duskett, Thomas Petazzoni, Ricardo Martincoski

This package is a dependency for pyndiff

Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
 package/Config.in                          |  1 +
 package/python-xmljson/Config.in           |  6 ++++++
 package/python-xmljson/python-xmljson.hash |  5 +++++
 package/python-xmljson/python-xmljson.mk   | 14 ++++++++++++++
 4 files changed, 26 insertions(+)
 create mode 100644 package/python-xmljson/Config.in
 create mode 100644 package/python-xmljson/python-xmljson.hash
 create mode 100644 package/python-xmljson/python-xmljson.mk

diff --git a/package/Config.in b/package/Config.in
index ba1ee4005c..09e9665f48 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1276,6 +1276,7 @@ menu "External python modules"
 	source "package/python-xlsxwriter/Config.in"
 	source "package/python-xlutils/Config.in"
 	source "package/python-xlwt/Config.in"
+	source "package/python-xmljson/Config.in"
 	source "package/python-xmltodict/Config.in"
 	source "package/python-xmodem/Config.in"
 	source "package/python-yarl/Config.in"
diff --git a/package/python-xmljson/Config.in b/package/python-xmljson/Config.in
new file mode 100644
index 0000000000..486f344361
--- /dev/null
+++ b/package/python-xmljson/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PYTHON_XMLJSON
+	bool "python-xmljson"
+	help
+	  Converts XML into JSON/Python dicts/arrays and vice-versa.
+
+	  https://github.com/sanand0/xmljson
diff --git a/package/python-xmljson/python-xmljson.hash b/package/python-xmljson/python-xmljson.hash
new file mode 100644
index 0000000000..245a74a33e
--- /dev/null
+++ b/package/python-xmljson/python-xmljson.hash
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/xmljson/json
+md5  fc4df2390ad209928ee4311a3540cb17  xmljson-0.2.1.tar.gz
+sha256  b4158e66aa1e62ee39f7f80eb2fe4f767670ba3c0d5de9804420dc53427fdec8  xmljson-0.2.1.tar.gz
+# Locally computed sha256 checksums
+sha256  5ce42ba7d76e81428bdacef83658eb6213dbd1ad4a3b6d380bb6e0e8c73f0fb7  LICENSE
diff --git a/package/python-xmljson/python-xmljson.mk b/package/python-xmljson/python-xmljson.mk
new file mode 100644
index 0000000000..913dce2670
--- /dev/null
+++ b/package/python-xmljson/python-xmljson.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-xmljson
+#
+################################################################################
+
+PYTHON_XMLJSON_VERSION = 0.2.1
+PYTHON_XMLJSON_SOURCE = xmljson-$(PYTHON_XMLJSON_VERSION).tar.gz
+PYTHON_XMLJSON_SITE = https://files.pythonhosted.org/packages/e8/6f/d9f109ba19be510fd3098bcb72143c67ca6743cedb48ac75aef05ddfe960
+PYTHON_XMLJSON_SETUP_TYPE = setuptools
+PYTHON_XMLJSON_LICENSE = MIT
+PYTHON_XMLJSON_LICENSE_FILES = LICENSE
+
+$(eval $(python-package))
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 3/4] package/python-pyndiff: new package, drop nmap ndiff option
  2021-10-12 17:48 [Buildroot] [PATCH 1/4] package/nmap: bump to version 7.92 Adam Duskett
  2021-10-12 17:48 ` [Buildroot] [PATCH 2/4] package/python-xmljson: new package Adam Duskett
@ 2021-10-12 17:48 ` Adam Duskett
  2021-10-21 20:48   ` Arnout Vandecappelle
  2021-10-12 17:48 ` [Buildroot] [PATCH 4/4] support/testing/tests/package/test_python_pyndiff: new test Adam Duskett
  2021-10-21 20:34 ` [Buildroot] [PATCH 1/4] package/nmap: bump to version 7.92 Arnout Vandecappelle
  3 siblings, 1 reply; 8+ messages in thread
From: Adam Duskett @ 2021-10-12 17:48 UTC (permalink / raw)
  To: buildroot
  Cc: Asaf Kahlon, Adam Duskett, Thomas Petazzoni, Ricardo Martincoski

The ndiff package provided by Nmap relies on python2; moreover, there have been
pending pull requests to move ndiff to python3 for over two years with very
little engagement by the maintainers (https://github.com/nmap/nmap/pull/1807).

Remove the option to select ndiff altogether, and introduce a new package:
python-pyndiff, which provides the same functionality (and more) as the
ndiff provided by nmap, and is compatible with python3.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
 Config.in.legacy                           |  8 ++++++++
 package/Config.in                          |  1 +
 package/nmap/Config.in                     | 12 +-----------
 package/nmap/nmap.mk                       |  9 ---------
 package/python-pyndiff/Config.in           |  9 +++++++++
 package/python-pyndiff/python-pyndiff.hash |  5 +++++
 package/python-pyndiff/python-pyndiff.mk   | 14 ++++++++++++++
 7 files changed, 38 insertions(+), 20 deletions(-)
 create mode 100644 package/python-pyndiff/Config.in
 create mode 100644 package/python-pyndiff/python-pyndiff.hash
 create mode 100644 package/python-pyndiff/python-pyndiff.mk

diff --git a/Config.in.legacy b/Config.in.legacy
index 3ec48edb87..a4b5c88dea 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -146,6 +146,14 @@ endif
 
 comment "Legacy options removed in 2021.11"
 
+config BR2_PACKAGE_NMAP_NDIFF
+	bool "The ndiff utility has been removed."
+	select BR2_LEGACY
+	help
+	  The ndiff utility provided by nmap requires python2 which is
+	  deprecated. The same functionality is provided by the python
+	  package pyndiff.
+
 config BR2_GDB_VERSION_8_3
 	bool "gdb version 8.3.x removed"
 	select BR2_LEGACY
diff --git a/package/Config.in b/package/Config.in
index 09e9665f48..fe5c8d43b5 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1150,6 +1150,7 @@ menu "External python modules"
 	source "package/python-pymupdf/Config.in"
 	source "package/python-pymysql/Config.in"
 	source "package/python-pynacl/Config.in"
+	source "package/python-pyndiff/Config.in"
 	source "package/python-pyopenssl/Config.in"
 	source "package/python-pyparsing/Config.in"
 	source "package/python-pyparted/Config.in"
diff --git a/package/nmap/Config.in b/package/nmap/Config.in
index 51dd3423ea..fc6312d0fc 100644
--- a/package/nmap/Config.in
+++ b/package/nmap/Config.in
@@ -6,7 +6,7 @@ config BR2_PACKAGE_NMAP
 	select BR2_PACKAGE_LIBLINEAR
 	select BR2_PACKAGE_LIBPCAP
 	select BR2_PACKAGE_NMAP_NMAP \
-	       if !BR2_PACKAGE_NMAP_NCAT && !BR2_PACKAGE_NMAP_NPING && !BR2_PACKAGE_NMAP_NDIFF
+	       if !BR2_PACKAGE_NMAP_NCAT && !BR2_PACKAGE_NMAP_NPING
 	help
 	  Nmap ("Network Mapper") is a free and open source (license)
 	  utility for network discovery and security auditing.
@@ -32,16 +32,6 @@ comment "a symlink from ncat to 'nc' will be installed"
 	depends on !BR2_PACKAGE_NETCAT
 	depends on !BR2_PACKAGE_NETCAT_OPENBSD
 
-config BR2_PACKAGE_NMAP_NDIFF
-	bool "install ndiff"
-	# ndiff only works with python2.x
-	depends on BR2_PACKAGE_PYTHON
-	help
-	  This option installs the 'ndiff' tool.
-
-comment "ndiff needs Python 2.x"
-	depends on !BR2_PACKAGE_PYTHON
-
 config BR2_PACKAGE_NMAP_NMAP
 	bool "install nmap"
 	select BR2_PACKAGE_PCRE
diff --git a/package/nmap/nmap.mk b/package/nmap/nmap.mk
index f3994e9b38..f22a2295b1 100644
--- a/package/nmap/nmap.mk
+++ b/package/nmap/nmap.mk
@@ -61,15 +61,6 @@ else
 NMAP_CONF_OPTS += --without-ncat
 endif
 
-ifeq ($(BR2_PACKAGE_NMAP_NDIFF),y)
-NMAP_DEPENDENCIES += python
-NMAP_CONF_OPTS += --with-ndiff
-NMAP_MAKE_OPTS += build-ndiff
-NMAP_INSTALL_TARGET_OPTS += install-ndiff
-else
-NMAP_CONF_OPTS += --without-ndiff
-endif
-
 ifeq ($(BR2_PACKAGE_NMAP_NMAP),y)
 NMAP_DEPENDENCIES += pcre
 NMAP_CONF_OPTS += --with-libpcre="$(STAGING_DIR)/usr"
diff --git a/package/python-pyndiff/Config.in b/package/python-pyndiff/Config.in
new file mode 100644
index 0000000000..58ca35ba97
--- /dev/null
+++ b/package/python-pyndiff/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_PYNDIFF
+	bool "python-pyndiff"
+	select BR2_PACKAGE_PYTHON_XMLJSON # runtime
+	select BR2_PACKAGE_PYTHON_SETUPTOOLS # runtime
+	help
+	  Generate human-readable ndiff output when comparing 2 Nmap
+	  XML scan files.
+
+	  https://github.com/rackerlabs/pyndiff
diff --git a/package/python-pyndiff/python-pyndiff.hash b/package/python-pyndiff/python-pyndiff.hash
new file mode 100644
index 0000000000..0afecfb6e2
--- /dev/null
+++ b/package/python-pyndiff/python-pyndiff.hash
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/pyndiff/json
+md5  32a9f994509cb883bbfeb563171f2668  pyndiff-1.0.2.tar.gz
+sha256  8a519b18a7bbb315c043d4543719ce9fb6db8098bfcdd04cb8054b276cc91368  pyndiff-1.0.2.tar.gz
+# Locally computed sha256 checksums
+sha256  cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE
diff --git a/package/python-pyndiff/python-pyndiff.mk b/package/python-pyndiff/python-pyndiff.mk
new file mode 100644
index 0000000000..e25374956c
--- /dev/null
+++ b/package/python-pyndiff/python-pyndiff.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-pyndiff
+#
+################################################################################
+
+PYTHON_PYNDIFF_VERSION = 1.0.2
+PYTHON_PYNDIFF_SOURCE = pyndiff-$(PYTHON_PYNDIFF_VERSION).tar.gz
+PYTHON_PYNDIFF_SITE = https://files.pythonhosted.org/packages/83/3b/fb13918710c4fba40367140f22e3449998f4f66869a7564d0e547ad99ef8
+PYTHON_PYNDIFF_SETUP_TYPE = setuptools
+PYTHON_PYNDIFF_LICENSE = Apache-2.0
+PYTHON_PYNDIFF_LICENSE_FILES = LICENSE
+
+$(eval $(python-package))
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 4/4] support/testing/tests/package/test_python_pyndiff: new test
  2021-10-12 17:48 [Buildroot] [PATCH 1/4] package/nmap: bump to version 7.92 Adam Duskett
  2021-10-12 17:48 ` [Buildroot] [PATCH 2/4] package/python-xmljson: new package Adam Duskett
  2021-10-12 17:48 ` [Buildroot] [PATCH 3/4] package/python-pyndiff: new package, drop nmap ndiff option Adam Duskett
@ 2021-10-12 17:48 ` Adam Duskett
  2021-10-21 20:53   ` Arnout Vandecappelle
  2021-10-21 20:34 ` [Buildroot] [PATCH 1/4] package/nmap: bump to version 7.92 Arnout Vandecappelle
  3 siblings, 1 reply; 8+ messages in thread
From: Adam Duskett @ 2021-10-12 17:48 UTC (permalink / raw)
  To: buildroot
  Cc: Asaf Kahlon, Adam Duskett, Thomas Petazzoni, Ricardo Martincoski

A simple test that runs nmap twice to create the files scanme-1.xml and
scanme2.xml, then runs pyndiff on both files.

Signed-off-by: Adam Duskett <aduskett@gmail.com>
---
 .../tests/package/test_python_pyndiff.py      | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 support/testing/tests/package/test_python_pyndiff.py

diff --git a/support/testing/tests/package/test_python_pyndiff.py b/support/testing/tests/package/test_python_pyndiff.py
new file mode 100644
index 0000000000..86d6c38f8f
--- /dev/null
+++ b/support/testing/tests/package/test_python_pyndiff.py
@@ -0,0 +1,29 @@
+import os
+import infra.basetest
+
+
+class TestPyNdiff(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_PACKAGE_NMAP=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_PYNDIFF=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv5",
+                           kernel="builtin",
+                           options=["-initrd", cpio_file])
+        self.emulator.login()
+
+        cmd = "nmap -F 127.0.0.1 -oX scanme-1.xml"
+        self.assertRunOk(cmd)
+
+        cmd = "nmap -F 127.0.0.1 -oX scanme-2.xml"
+        self.assertRunOk(cmd)
+
+        cmd = "pyndiff -f1 scanme-1.xml -f2 scanme-2.xml -t txt"
+        self.assertRunOk(cmd)
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH 1/4] package/nmap: bump to version 7.92
  2021-10-12 17:48 [Buildroot] [PATCH 1/4] package/nmap: bump to version 7.92 Adam Duskett
                   ` (2 preceding siblings ...)
  2021-10-12 17:48 ` [Buildroot] [PATCH 4/4] support/testing/tests/package/test_python_pyndiff: new test Adam Duskett
@ 2021-10-21 20:34 ` Arnout Vandecappelle
  3 siblings, 0 replies; 8+ messages in thread
From: Arnout Vandecappelle @ 2021-10-21 20:34 UTC (permalink / raw)
  To: Adam Duskett, buildroot
  Cc: Thomas Petazzoni, Asaf Kahlon, Ricardo Martincoski



On 12/10/2021 19:48, Adam Duskett wrote:
> In addition:
>    - Remove upstream patch
>    - Update license hash to reflect license version bump from 0.92 to 0.93
> 
> Signed-off-by: Adam Duskett <aduskett@gmail.com>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   package/nmap/0002-ncat-unix-socket.patch | 30 ------------------------
>   package/nmap/nmap.hash                   |  6 ++---
>   package/nmap/nmap.mk                     |  2 +-
>   3 files changed, 4 insertions(+), 34 deletions(-)
>   delete mode 100644 package/nmap/0002-ncat-unix-socket.patch
> 
> diff --git a/package/nmap/0002-ncat-unix-socket.patch b/package/nmap/0002-ncat-unix-socket.patch
> deleted file mode 100644
> index b6484ebeea..0000000000
> --- a/package/nmap/0002-ncat-unix-socket.patch
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -ChangeLog:
> -
> -o [Ncat][GH#2154] Ncat no longer crashes when used with Unix domain sockets.
> -
> -Backported from: r38121
> -
> -Signed-off-by: Alexey Neyman <stilor@att.net>
> -
> -Index: ncat/ncat_main.c
> -===================================================================
> ---- a/ncat/ncat_main.c	(revision 38120)
> -+++ b/ncat/ncat_main.c	(revision 38121)
> -@@ -846,7 +846,7 @@
> -             targetaddrs->addr.un.sun_family = AF_UNIX;
> -             strncpy(targetaddrs->addr.un.sun_path, argv[optind], sizeof(targetaddrs->addr.un.sun_path));
> -             targetaddrs->addrlen = SUN_LEN(&targetaddrs->addr.un);
> --            o.target = argv[optind];
> -+            o.sslservername = o.target = argv[optind];
> -             optind++;
> -         } else
> - #endif
> -@@ -865,7 +865,7 @@
> -                 targetaddrs->addr.vm.svm_cid = long_cid;
> -
> -                 targetaddrs->addrlen = sizeof(targetaddrs->addr.vm);
> --                o.target = argv[optind];
> -+                o.sslservername = o.target = argv[optind];
> -                 optind++;
> -             }
> -         } else
> diff --git a/package/nmap/nmap.hash b/package/nmap/nmap.hash
> index 8f69bbf613..dc379f30d4 100644
> --- a/package/nmap/nmap.hash
> +++ b/package/nmap/nmap.hash
> @@ -1,5 +1,5 @@
> -# From https://nmap.org/dist/sigs/nmap-7.91.tar.bz2.digest.txt (lowercase)
> -sha256  18cc4b5070511c51eb243cdd2b0b30ff9b2c4dc4544c6312f75ce3a67a593300  nmap-7.91.tar.bz2
> +# From https://nmap.org/dist/sigs/nmap-7.92.tar.bz2.digest.txt (lowercase)
> +sha256  a5479f2f8a6b0b2516767d2f7189c386c1dc858d997167d7ec5cfc798c7571a1  nmap-7.92.tar.bz2
>   
>   # Locally calculated
> -sha256  8254a9bc733f3312c6dcfe0d5a129c29e96ecb8b33408c652a8c7beb2e25b471  LICENSE
> +sha256  133794301a764dfe8a60e38601e56657b7113e0337b452189725bbbed58baea0  LICENSE
> diff --git a/package/nmap/nmap.mk b/package/nmap/nmap.mk
> index 34cf61ff0b..f3994e9b38 100644
> --- a/package/nmap/nmap.mk
> +++ b/package/nmap/nmap.mk
> @@ -4,7 +4,7 @@
>   #
>   ################################################################################
>   
> -NMAP_VERSION = 7.91
> +NMAP_VERSION = 7.92
>   NMAP_SITE = https://nmap.org/dist
>   NMAP_SOURCE = nmap-$(NMAP_VERSION).tar.bz2
>   NMAP_DEPENDENCIES = liblinear libpcap
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH 2/4] package/python-xmljson: new package
  2021-10-12 17:48 ` [Buildroot] [PATCH 2/4] package/python-xmljson: new package Adam Duskett
@ 2021-10-21 20:47   ` Arnout Vandecappelle
  0 siblings, 0 replies; 8+ messages in thread
From: Arnout Vandecappelle @ 2021-10-21 20:47 UTC (permalink / raw)
  To: Adam Duskett, buildroot
  Cc: Thomas Petazzoni, Asaf Kahlon, Ricardo Martincoski



On 12/10/2021 19:48, Adam Duskett wrote:
> This package is a dependency for pyndiff
> 
> Signed-off-by: Adam Duskett <aduskett@gmail.com>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   package/Config.in                          |  1 +
>   package/python-xmljson/Config.in           |  6 ++++++
>   package/python-xmljson/python-xmljson.hash |  5 +++++
>   package/python-xmljson/python-xmljson.mk   | 14 ++++++++++++++
>   4 files changed, 26 insertions(+)
>   create mode 100644 package/python-xmljson/Config.in
>   create mode 100644 package/python-xmljson/python-xmljson.hash
>   create mode 100644 package/python-xmljson/python-xmljson.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index ba1ee4005c..09e9665f48 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1276,6 +1276,7 @@ menu "External python modules"
>   	source "package/python-xlsxwriter/Config.in"
>   	source "package/python-xlutils/Config.in"
>   	source "package/python-xlwt/Config.in"
> +	source "package/python-xmljson/Config.in"
>   	source "package/python-xmltodict/Config.in"
>   	source "package/python-xmodem/Config.in"
>   	source "package/python-yarl/Config.in"
> diff --git a/package/python-xmljson/Config.in b/package/python-xmljson/Config.in
> new file mode 100644
> index 0000000000..486f344361
> --- /dev/null
> +++ b/package/python-xmljson/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_PYTHON_XMLJSON
> +	bool "python-xmljson"
> +	help
> +	  Converts XML into JSON/Python dicts/arrays and vice-versa.
> +
> +	  https://github.com/sanand0/xmljson
> diff --git a/package/python-xmljson/python-xmljson.hash b/package/python-xmljson/python-xmljson.hash
> new file mode 100644
> index 0000000000..245a74a33e
> --- /dev/null
> +++ b/package/python-xmljson/python-xmljson.hash
> @@ -0,0 +1,5 @@
> +# md5, sha256 from https://pypi.org/pypi/xmljson/json
> +md5  fc4df2390ad209928ee4311a3540cb17  xmljson-0.2.1.tar.gz
> +sha256  b4158e66aa1e62ee39f7f80eb2fe4f767670ba3c0d5de9804420dc53427fdec8  xmljson-0.2.1.tar.gz
> +# Locally computed sha256 checksums
> +sha256  5ce42ba7d76e81428bdacef83658eb6213dbd1ad4a3b6d380bb6e0e8c73f0fb7  LICENSE
> diff --git a/package/python-xmljson/python-xmljson.mk b/package/python-xmljson/python-xmljson.mk
> new file mode 100644
> index 0000000000..913dce2670
> --- /dev/null
> +++ b/package/python-xmljson/python-xmljson.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# python-xmljson
> +#
> +################################################################################
> +
> +PYTHON_XMLJSON_VERSION = 0.2.1
> +PYTHON_XMLJSON_SOURCE = xmljson-$(PYTHON_XMLJSON_VERSION).tar.gz
> +PYTHON_XMLJSON_SITE = https://files.pythonhosted.org/packages/e8/6f/d9f109ba19be510fd3098bcb72143c67ca6743cedb48ac75aef05ddfe960
> +PYTHON_XMLJSON_SETUP_TYPE = setuptools
> +PYTHON_XMLJSON_LICENSE = MIT
> +PYTHON_XMLJSON_LICENSE_FILES = LICENSE
> +
> +$(eval $(python-package))
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH 3/4] package/python-pyndiff: new package, drop nmap ndiff option
  2021-10-12 17:48 ` [Buildroot] [PATCH 3/4] package/python-pyndiff: new package, drop nmap ndiff option Adam Duskett
@ 2021-10-21 20:48   ` Arnout Vandecappelle
  0 siblings, 0 replies; 8+ messages in thread
From: Arnout Vandecappelle @ 2021-10-21 20:48 UTC (permalink / raw)
  To: Adam Duskett, buildroot
  Cc: Thomas Petazzoni, Asaf Kahlon, Ricardo Martincoski



On 12/10/2021 19:48, Adam Duskett wrote:
> The ndiff package provided by Nmap relies on python2; moreover, there have been
> pending pull requests to move ndiff to python3 for over two years with very
> little engagement by the maintainers (https://github.com/nmap/nmap/pull/1807).
> 
> Remove the option to select ndiff altogether, and introduce a new package:
> python-pyndiff, which provides the same functionality (and more) as the
> ndiff provided by nmap, and is compatible with python3.
> 
> Signed-off-by: Adam Duskett <aduskett@gmail.com>

  I split this into two separate patches.

> ---
>   Config.in.legacy                           |  8 ++++++++
>   package/Config.in                          |  1 +
>   package/nmap/Config.in                     | 12 +-----------
>   package/nmap/nmap.mk                       |  9 ---------
>   package/python-pyndiff/Config.in           |  9 +++++++++
>   package/python-pyndiff/python-pyndiff.hash |  5 +++++
>   package/python-pyndiff/python-pyndiff.mk   | 14 ++++++++++++++
>   7 files changed, 38 insertions(+), 20 deletions(-)
>   create mode 100644 package/python-pyndiff/Config.in
>   create mode 100644 package/python-pyndiff/python-pyndiff.hash
>   create mode 100644 package/python-pyndiff/python-pyndiff.mk
> 
> diff --git a/Config.in.legacy b/Config.in.legacy
> index 3ec48edb87..a4b5c88dea 100644
> --- a/Config.in.legacy
> +++ b/Config.in.legacy
> @@ -146,6 +146,14 @@ endif
>   
>   comment "Legacy options removed in 2021.11"
>   
> +config BR2_PACKAGE_NMAP_NDIFF
> +	bool "The ndiff utility has been removed."
> +	select BR2_LEGACY

  I also added a select of python-pyndiff here.


  Applied to master, thanks.

  Regards,
  Arnout


> +	help
> +	  The ndiff utility provided by nmap requires python2 which is
> +	  deprecated. The same functionality is provided by the python
> +	  package pyndiff.
> +
>   config BR2_GDB_VERSION_8_3
>   	bool "gdb version 8.3.x removed"
>   	select BR2_LEGACY
> diff --git a/package/Config.in b/package/Config.in
> index 09e9665f48..fe5c8d43b5 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1150,6 +1150,7 @@ menu "External python modules"
>   	source "package/python-pymupdf/Config.in"
>   	source "package/python-pymysql/Config.in"
>   	source "package/python-pynacl/Config.in"
> +	source "package/python-pyndiff/Config.in"
>   	source "package/python-pyopenssl/Config.in"
>   	source "package/python-pyparsing/Config.in"
>   	source "package/python-pyparted/Config.in"
> diff --git a/package/nmap/Config.in b/package/nmap/Config.in
> index 51dd3423ea..fc6312d0fc 100644
> --- a/package/nmap/Config.in
> +++ b/package/nmap/Config.in
> @@ -6,7 +6,7 @@ config BR2_PACKAGE_NMAP
>   	select BR2_PACKAGE_LIBLINEAR
>   	select BR2_PACKAGE_LIBPCAP
>   	select BR2_PACKAGE_NMAP_NMAP \
> -	       if !BR2_PACKAGE_NMAP_NCAT && !BR2_PACKAGE_NMAP_NPING && !BR2_PACKAGE_NMAP_NDIFF
> +	       if !BR2_PACKAGE_NMAP_NCAT && !BR2_PACKAGE_NMAP_NPING
>   	help
>   	  Nmap ("Network Mapper") is a free and open source (license)
>   	  utility for network discovery and security auditing.
> @@ -32,16 +32,6 @@ comment "a symlink from ncat to 'nc' will be installed"
>   	depends on !BR2_PACKAGE_NETCAT
>   	depends on !BR2_PACKAGE_NETCAT_OPENBSD
>   
> -config BR2_PACKAGE_NMAP_NDIFF
> -	bool "install ndiff"
> -	# ndiff only works with python2.x
> -	depends on BR2_PACKAGE_PYTHON
> -	help
> -	  This option installs the 'ndiff' tool.
> -
> -comment "ndiff needs Python 2.x"
> -	depends on !BR2_PACKAGE_PYTHON
> -
>   config BR2_PACKAGE_NMAP_NMAP
>   	bool "install nmap"
>   	select BR2_PACKAGE_PCRE
> diff --git a/package/nmap/nmap.mk b/package/nmap/nmap.mk
> index f3994e9b38..f22a2295b1 100644
> --- a/package/nmap/nmap.mk
> +++ b/package/nmap/nmap.mk
> @@ -61,15 +61,6 @@ else
>   NMAP_CONF_OPTS += --without-ncat
>   endif
>   
> -ifeq ($(BR2_PACKAGE_NMAP_NDIFF),y)
> -NMAP_DEPENDENCIES += python
> -NMAP_CONF_OPTS += --with-ndiff
> -NMAP_MAKE_OPTS += build-ndiff
> -NMAP_INSTALL_TARGET_OPTS += install-ndiff
> -else
> -NMAP_CONF_OPTS += --without-ndiff
> -endif
> -
>   ifeq ($(BR2_PACKAGE_NMAP_NMAP),y)
>   NMAP_DEPENDENCIES += pcre
>   NMAP_CONF_OPTS += --with-libpcre="$(STAGING_DIR)/usr"
> diff --git a/package/python-pyndiff/Config.in b/package/python-pyndiff/Config.in
> new file mode 100644
> index 0000000000..58ca35ba97
> --- /dev/null
> +++ b/package/python-pyndiff/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_PACKAGE_PYTHON_PYNDIFF
> +	bool "python-pyndiff"
> +	select BR2_PACKAGE_PYTHON_XMLJSON # runtime
> +	select BR2_PACKAGE_PYTHON_SETUPTOOLS # runtime
> +	help
> +	  Generate human-readable ndiff output when comparing 2 Nmap
> +	  XML scan files.
> +
> +	  https://github.com/rackerlabs/pyndiff
> diff --git a/package/python-pyndiff/python-pyndiff.hash b/package/python-pyndiff/python-pyndiff.hash
> new file mode 100644
> index 0000000000..0afecfb6e2
> --- /dev/null
> +++ b/package/python-pyndiff/python-pyndiff.hash
> @@ -0,0 +1,5 @@
> +# md5, sha256 from https://pypi.org/pypi/pyndiff/json
> +md5  32a9f994509cb883bbfeb563171f2668  pyndiff-1.0.2.tar.gz
> +sha256  8a519b18a7bbb315c043d4543719ce9fb6db8098bfcdd04cb8054b276cc91368  pyndiff-1.0.2.tar.gz
> +# Locally computed sha256 checksums
> +sha256  cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  LICENSE
> diff --git a/package/python-pyndiff/python-pyndiff.mk b/package/python-pyndiff/python-pyndiff.mk
> new file mode 100644
> index 0000000000..e25374956c
> --- /dev/null
> +++ b/package/python-pyndiff/python-pyndiff.mk
> @@ -0,0 +1,14 @@
> +################################################################################
> +#
> +# python-pyndiff
> +#
> +################################################################################
> +
> +PYTHON_PYNDIFF_VERSION = 1.0.2
> +PYTHON_PYNDIFF_SOURCE = pyndiff-$(PYTHON_PYNDIFF_VERSION).tar.gz
> +PYTHON_PYNDIFF_SITE = https://files.pythonhosted.org/packages/83/3b/fb13918710c4fba40367140f22e3449998f4f66869a7564d0e547ad99ef8
> +PYTHON_PYNDIFF_SETUP_TYPE = setuptools
> +PYTHON_PYNDIFF_LICENSE = Apache-2.0
> +PYTHON_PYNDIFF_LICENSE_FILES = LICENSE
> +
> +$(eval $(python-package))
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH 4/4] support/testing/tests/package/test_python_pyndiff: new test
  2021-10-12 17:48 ` [Buildroot] [PATCH 4/4] support/testing/tests/package/test_python_pyndiff: new test Adam Duskett
@ 2021-10-21 20:53   ` Arnout Vandecappelle
  0 siblings, 0 replies; 8+ messages in thread
From: Arnout Vandecappelle @ 2021-10-21 20:53 UTC (permalink / raw)
  To: Adam Duskett, buildroot
  Cc: Thomas Petazzoni, Asaf Kahlon, Ricardo Martincoski



On 12/10/2021 19:48, Adam Duskett wrote:
> A simple test that runs nmap twice to create the files scanme-1.xml and
> scanme2.xml, then runs pyndiff on both files.

  Nice approach!

  Applied to master, thanks.

  Regards,
  Arnout

> 
> Signed-off-by: Adam Duskett <aduskett@gmail.com>
> ---
>   .../tests/package/test_python_pyndiff.py      | 29 +++++++++++++++++++
>   1 file changed, 29 insertions(+)
>   create mode 100644 support/testing/tests/package/test_python_pyndiff.py
> 
> diff --git a/support/testing/tests/package/test_python_pyndiff.py b/support/testing/tests/package/test_python_pyndiff.py
> new file mode 100644
> index 0000000000..86d6c38f8f
> --- /dev/null
> +++ b/support/testing/tests/package/test_python_pyndiff.py
> @@ -0,0 +1,29 @@
> +import os
> +import infra.basetest
> +
> +
> +class TestPyNdiff(infra.basetest.BRTest):
> +    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
> +        """
> +        BR2_PACKAGE_NMAP=y
> +        BR2_PACKAGE_PYTHON3=y
> +        BR2_PACKAGE_PYTHON_PYNDIFF=y
> +        BR2_TARGET_ROOTFS_CPIO=y
> +        # BR2_TARGET_ROOTFS_TAR is not set
> +        """
> +
> +    def test_run(self):
> +        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
> +        self.emulator.boot(arch="armv5",
> +                           kernel="builtin",
> +                           options=["-initrd", cpio_file])
> +        self.emulator.login()
> +
> +        cmd = "nmap -F 127.0.0.1 -oX scanme-1.xml"
> +        self.assertRunOk(cmd)
> +
> +        cmd = "nmap -F 127.0.0.1 -oX scanme-2.xml"
> +        self.assertRunOk(cmd)
> +
> +        cmd = "pyndiff -f1 scanme-1.xml -f2 scanme-2.xml -t txt"
> +        self.assertRunOk(cmd)
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-21 20:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12 17:48 [Buildroot] [PATCH 1/4] package/nmap: bump to version 7.92 Adam Duskett
2021-10-12 17:48 ` [Buildroot] [PATCH 2/4] package/python-xmljson: new package Adam Duskett
2021-10-21 20:47   ` Arnout Vandecappelle
2021-10-12 17:48 ` [Buildroot] [PATCH 3/4] package/python-pyndiff: new package, drop nmap ndiff option Adam Duskett
2021-10-21 20:48   ` Arnout Vandecappelle
2021-10-12 17:48 ` [Buildroot] [PATCH 4/4] support/testing/tests/package/test_python_pyndiff: new test Adam Duskett
2021-10-21 20:53   ` Arnout Vandecappelle
2021-10-21 20:34 ` [Buildroot] [PATCH 1/4] package/nmap: bump to version 7.92 Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.