diff mbox series

[meta-networking] netcf: remove recipe

Message ID 20260401041539.112052-1-anuj.mittal@oss.qualcomm.com
State Under Review
Headers show
Series [meta-networking] netcf: remove recipe | expand

Commit Message

Anuj Mittal April 1, 2026, 4:15 a.m. UTC
From: Anuj Mittal <anuj.mittal@oss.qualcomm.com>

It isn't maintained anymore and requires workarounds when gnulib is
updated.

It was only used by libvirt and with the upstream [1] and meta-virt
changes to not require it anymore, this can be dropped.

[1] https://gitlab.com/libvirt/libvirt/-/commit/35d5b26aa433bd33f4b33be3dbb67313357f97f9

Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
---
 .../packagegroup-meta-networking.bb           |  1 -
 ...nulib-read_file-fread_file-signature.patch | 94 -------------------
 ...bootstrap-with-newer-gnulib-automake.patch | 61 ------------
 .../recipes-support/netcf/netcf_0.2.8.bb      | 73 --------------
 4 files changed, 229 deletions(-)
 delete mode 100644 meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch
 delete mode 100644 meta-networking/recipes-support/netcf/netcf/0001-netcf-fix-bootstrap-with-newer-gnulib-automake.patch
 delete mode 100644 meta-networking/recipes-support/netcf/netcf_0.2.8.bb
diff mbox series

Patch

diff --git a/meta-networking/recipes-core/packagegroups/packagegroup-meta-networking.bb b/meta-networking/recipes-core/packagegroups/packagegroup-meta-networking.bb
index cc0445aaed..21c9dce4e1 100644
--- a/meta-networking/recipes-core/packagegroups/packagegroup-meta-networking.bb
+++ b/meta-networking/recipes-core/packagegroups/packagegroup-meta-networking.bb
@@ -216,7 +216,6 @@  RDEPENDS:packagegroup-meta-networking-support = "\
     ndisc6 \
     tcpdump \
     tcpslice \
-    netcf \
     tnftp \
     traceroute \
     tunctl \
diff --git a/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch b/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch
deleted file mode 100644
index 83fdfded52..0000000000
--- a/meta-networking/recipes-support/netcf/netcf/0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch
+++ /dev/null
@@ -1,94 +0,0 @@ 
-From af256680926e166ac21bc0f11172ea6c077a9b55 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 9 Mar 2024 10:40:48 -0800
-Subject: [PATCH] Adopt to new gnulib read_file/fread_file signature
-
-It now expects a flag parameter in latest gnulib
-see [1]
-
-[1] https://public-inbox.org/bug-gnulib/87tv01c1z2.fsf-ueno@gnu.org/
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- src/dutil_linux.c  | 4 ++--
- src/dutil_posix.c  | 2 +-
- src/ncftool.c      | 2 +-
- src/ncftransform.c | 2 +-
- 4 files changed, 5 insertions(+), 5 deletions(-)
-
---- a/src/dutil_linux.c
-+++ b/src/dutil_linux.c
-@@ -1113,7 +1113,7 @@ static void add_link_info(struct netcf *
- 
-     xasprintf(&path, "/sys/class/net/%s/operstate", ifname);
-     ERR_NOMEM(!path, ncf);
--    state = read_file(path, &length);
-+    state = read_file(path, 0, &length);
-     if (!state) {
-         /* missing operstate is *not* an error. It could be due to an
-          * alias interface, which has no entry in /sys/class/net at
-@@ -1132,7 +1132,7 @@ static void add_link_info(struct netcf *
-         FREE(path);
-         xasprintf(&path, "/sys/class/net/%s/speed", ifname);
-         ERR_NOMEM(path == NULL, ncf);
--        speed = read_file(path, &length);
-+        speed = read_file(path, 0, &length);
-         if (!speed && errno == EINVAL) {
-             /* attempts to read $ifname/speed result in EINVAL if the
-              * interface is ifconfiged down (which isn't exactly the
---- a/src/dutil_posix.c
-+++ b/src/dutil_posix.c
-@@ -211,7 +211,7 @@ int run_program(struct netcf *ncf, const
-                        "Failed to create file stream for output while executing '%s': %s",
-                        argv_str, errbuf);
- 
--    *output = fread_file(outfile, &outlen);
-+    *output = fread_file(outfile, 0, &outlen);
-     ERR_THROW_STRERROR(*output == NULL, ncf, EEXEC,
-                        "Error while reading output from execution of '%s': %s",
-                        argv_str, errbuf);
---- a/src/ncftool.c
-+++ b/src/ncftool.c
-@@ -351,7 +351,7 @@ static int cmd_define(const struct comma
-     struct netcf_if *nif = NULL;
-     int result = CMD_RES_ERR;
- 
--    xml = read_file(fname, &length);
-+    xml = read_file(fname, 0, &length);
-     if (xml == NULL) {
-         fprintf(stderr, "Failed to read %s\n", fname);
-         goto done;
---- a/src/ncftransform.c
-+++ b/src/ncftransform.c
-@@ -54,7 +54,7 @@ int main(int argc, char **argv) {
-     if (argc != 3 || (STRNEQ(argv[1], "get") && STRNEQ(argv[1], "put")))
-         die("Usage: ncftransform (put|get) FILE\n");
- 
--    in_xml = read_file(argv[2], &length);
-+    in_xml = read_file(argv[2], 0, &length);
-     if (in_xml == NULL)
-         die("Failed to read %s\n", argv[2]);
- 
---- a/src/internal.h
-+++ b/src/internal.h
-@@ -30,6 +30,7 @@
- 
- #include <string.h>
- #include <stdarg.h>
-+#include <stdlib.h>
- 
- #include <libxslt/transform.h>
- #include <libxml/relaxng.h>
-@@ -85,6 +86,11 @@
- #define ATTRIBUTE_NOINLINE
- #endif                                   /* __GNUC__ */
- 
-+#ifndef REALLOC_N
-+# define REALLOC_N(ptr, count) \
-+    (((ptr) = realloc((ptr), sizeof(*(ptr)) * (count))) == NULL ? -1 : 0)
-+#endif
-+
- /* This needs ATTRIBUTE_RETURN_CHECK */
- #include "ref.h"
- 
diff --git a/meta-networking/recipes-support/netcf/netcf/0001-netcf-fix-bootstrap-with-newer-gnulib-automake.patch b/meta-networking/recipes-support/netcf/netcf/0001-netcf-fix-bootstrap-with-newer-gnulib-automake.patch
deleted file mode 100644
index 62daeff812..0000000000
--- a/meta-networking/recipes-support/netcf/netcf/0001-netcf-fix-bootstrap-with-newer-gnulib-automake.patch
+++ /dev/null
@@ -1,61 +0,0 @@ 
-From dded6e3321e304f50922e61c553d4e4eb0f80fd0 Mon Sep 17 00:00:00 2001
-From: Khem Raj <khem.raj@oss.qualcomm.com>
-Date: Sun, 22 Mar 2026 11:05:34 -0700
-Subject: [PATCH] netcf: fix bootstrap with newer gnulib/automake
-
-Upstream netcf is old enough that bootstrap/autoreconf now trips over:
-- gnulib-tool.py wrapper expectations in newer gnulib
-- stricter automake handling of AM_CFLAGS += from generated gnulib.mk
-- subdir source warnings
-- deprecated INCLUDES usage
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
----
- configure.ac             | 2 +-
- gnulib/lib/Makefile.am   | 2 +-
- gnulib/tests/Makefile.am | 2 ++
- tests/Makefile.am        | 2 +-
- 4 files changed, 5 insertions(+), 3 deletions(-)
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -3,7 +3,7 @@ AC_CONFIG_SRCDIR([src/netcf.c])
- AC_CONFIG_AUX_DIR([build-aux])
- AC_CONFIG_MACRO_DIR([gnulib/m4])
- AC_CONFIG_HEADERS([config.h])
--AM_INIT_AUTOMAKE([-Wno-portability 1.11 color-tests parallel-tests])
-+AM_INIT_AUTOMAKE([-Wno-portability 1.11 subdir-objects color-tests parallel-tests])
- AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.
- AC_CANONICAL_HOST
- 
---- a/gnulib/lib/Makefile.am
-+++ b/gnulib/lib/Makefile.am
-@@ -13,4 +13,4 @@ CLEANFILES=
- 
- include gnulib.mk
- 
--INCLUDES = $(GETTEXT_CPPFLAGS)
-+AM_CPPFLAGS = $(GETTEXT_CPPFLAGS)
---- a/gnulib/tests/Makefile.am
-+++ b/gnulib/tests/Makefile.am
-@@ -3,6 +3,6 @@
- ## Copyright (C) 2011 Red Hat, Inc.
- ## See COPYING.LIB for the License of this software
- 
--include gnulib.mk
-+AM_CFLAGS =
- 
--INCLUDES = $(GETTEXT_CPPFLAGS)
-+include gnulib.mk
---- a/tests/Makefile.am
-+++ b/tests/Makefile.am
-@@ -14,7 +14,7 @@ TESTS_ENVIRONMENT = \
-   abs_top_builddir='$(abs_top_builddir)' \
-   abs_top_srcdir='$(abs_top_srcdir)'
- 
--INCLUDES = -I$(top_srcdir)/src
-+AM_CPPFLAGS = -I$(top_srcdir)/src
- 
- TESTS=
- check_PROGRAMS=
diff --git a/meta-networking/recipes-support/netcf/netcf_0.2.8.bb b/meta-networking/recipes-support/netcf/netcf_0.2.8.bb
deleted file mode 100644
index a73531de82..0000000000
--- a/meta-networking/recipes-support/netcf/netcf_0.2.8.bb
+++ /dev/null
@@ -1,73 +0,0 @@ 
-SUMMARY = "netcf"
-DESCRIPTION = "netcf is a cross-platform network configuration library."
-HOMEPAGE = "https://pagure.io/netcf"
-SECTION = "libs"
-LICENSE = "LGPL-2.1-only"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=fb919cc88dbe06ec0b0bd50e001ccf1f"
-
-SRCREV = "2c5d4255857531bc09d91dcd02e86545f29004d4"
-PV .= "+git"
-
-SRC_URI = "git://pagure.io/netcf.git;protocol=https;branch=master \
-           file://0001-netcf-fix-bootstrap-with-newer-gnulib-automake.patch \
-           file://0001-Adopt-to-new-gnulib-read_file-fread_file-signature.patch"
-
-UPSTREAM_CHECK_GITTAGREGEX = "release-(?P<pver>(\d+(\.\d+)+))"
-
-DEPENDS += "augeas libnl libxslt libxml2"
-
-do_configure[depends] += "${MLPREFIX}gnulib:do_populate_sysroot"
-
-
-inherit gettext autotools perlnative pkgconfig systemd
-
-EXTRA_OECONF:append:class-target = " --with-driver=redhat"
-
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
-PACKAGECONFIG[systemd] = "--with-sysinit=systemd,--with-sysinit=initscripts,"
-
-do_configure:prepend() {
-    currdir=`pwd`
-    cd ${S}
-
-    # avoid bootstrap cloning gnulib on every configure
-    # the dir starts out empty from the pkg, but unconditionally blow it
-    # away so if we reconfigure due to gnulib sysroot sig changes, we will
-    # get the newer gnulib content into the build here.
-    rm -rf ${S}/.gnulib
-    cp -rf ${STAGING_DATADIR}/gnulib ${S}/.gnulib
-
-    # --force to avoid errors on reconfigure e.g if recipes changed we depend on
-    # | bootstrap: running: libtoolize --quiet
-    # | libtoolize:   error: 'libltdl/COPYING.LIB' exists: use '--force' to overwrite
-    # | ...
-    ./bootstrap --force --no-git --gnulib-srcdir=.gnulib
-
-    cd $currdir
-}
-
-do_install:append() {
-    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-       install -d ${D}${systemd_unitdir}/system
-       if [ -d "${D}${libdir}/systemd/system" ]; then
-           if [ "${systemd_unitdir}" != "${libdir}/systemd" ] ; then
-               mv ${D}${libdir}/systemd/system/* ${D}${systemd_unitdir}/system/
-               rm -rf ${D}${libdir}/systemd/
-	   fi
-       elif [ "${systemd_unitdir}" != "${nonarch_libdir}/systemd" ] ; then
-           mv ${D}${nonarch_libdir}/systemd/system/* ${D}${systemd_unitdir}/system/
-           rm -rf ${D}${nonarch_libdir}/systemd/
-       fi
-    else
-       mv ${D}${sysconfdir}/rc.d/init.d/ ${D}${sysconfdir}
-       rm -rf ${D}${sysconfdir}/rc.d/
-    fi
-}
-
-FILES:${PN} += " \
-        ${libdir} \
-        ${nonarch_libdir} \
-        "
-
-SYSTEMD_SERVICE:${PN} = "netcf-transaction.service"