[Buildroot] [PATCH 3/4] package/python-pyndiff: new package, drop nmap ndiff option

Arnout Vandecappelle arnout at mind.be
Thu Oct 21 20:48:19 UTC 2021



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 at 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))
> 


More information about the buildroot mailing list