[PATCH 1/5] tools: ynl: move python code to separate sub-directory

From: Jan Stancek
Date: Tue Dec 03 2024 - 05:50:18 EST


Move python code to a separate directory so it can be
packaged as a python module.

Signed-off-by: Jan Stancek <jstancek@xxxxxxxxxx>
---
tools/net/ynl/Makefile | 1 +
tools/net/ynl/generated/Makefile | 2 +-
tools/net/ynl/lib/.gitignore | 1 -
tools/net/ynl/lib/Makefile | 1 -
tools/net/ynl/pyynl/__init__.py | 0
tools/net/ynl/{ => pyynl}/cli.py | 0
tools/net/ynl/{ => pyynl}/ethtool.py | 0
tools/net/ynl/pyynl/lib/.gitignore | 1 +
tools/net/ynl/{ => pyynl}/lib/__init__.py | 0
tools/net/ynl/{ => pyynl}/lib/nlspec.py | 0
tools/net/ynl/{ => pyynl}/lib/ynl.py | 0
tools/net/ynl/{ => pyynl}/ynl-gen-c.py | 0
tools/net/ynl/{ => pyynl}/ynl-gen-rst.py | 0
tools/net/ynl/ynl-regen.sh | 2 +-
14 files changed, 4 insertions(+), 4 deletions(-)
create mode 100644 tools/net/ynl/pyynl/__init__.py
rename tools/net/ynl/{ => pyynl}/cli.py (100%)
rename tools/net/ynl/{ => pyynl}/ethtool.py (100%)
create mode 100644 tools/net/ynl/pyynl/lib/.gitignore
rename tools/net/ynl/{ => pyynl}/lib/__init__.py (100%)
rename tools/net/ynl/{ => pyynl}/lib/nlspec.py (100%)
rename tools/net/ynl/{ => pyynl}/lib/ynl.py (100%)
rename tools/net/ynl/{ => pyynl}/ynl-gen-c.py (100%)
rename tools/net/ynl/{ => pyynl}/ynl-gen-rst.py (100%)

diff --git a/tools/net/ynl/Makefile b/tools/net/ynl/Makefile
index d1cdf2a8f826..617b405d9ef8 100644
--- a/tools/net/ynl/Makefile
+++ b/tools/net/ynl/Makefile
@@ -21,5 +21,6 @@ clean distclean:
fi \
done
rm -f libynl.a
+ rm -rf pyynl/lib/__pycache__

.PHONY: all clean distclean $(SUBDIRS)
diff --git a/tools/net/ynl/generated/Makefile b/tools/net/ynl/generated/Makefile
index 7db5240de58a..36519ea2792a 100644
--- a/tools/net/ynl/generated/Makefile
+++ b/tools/net/ynl/generated/Makefile
@@ -12,7 +12,7 @@ include ../Makefile.deps
YNL_GEN_ARG_ethtool:=--user-header linux/ethtool_netlink.h \
--exclude-op stats-get

-TOOL:=../ynl-gen-c.py
+TOOL:=../pyynl/ynl-gen-c.py

GENS_PATHS=$(shell grep -nrI --files-without-match \
'protocol: netlink' \
diff --git a/tools/net/ynl/lib/.gitignore b/tools/net/ynl/lib/.gitignore
index 296c4035dbf2..a4383358ec72 100644
--- a/tools/net/ynl/lib/.gitignore
+++ b/tools/net/ynl/lib/.gitignore
@@ -1,2 +1 @@
-__pycache__/
*.d
diff --git a/tools/net/ynl/lib/Makefile b/tools/net/ynl/lib/Makefile
index 94c49cca3dca..4b2b98704ff9 100644
--- a/tools/net/ynl/lib/Makefile
+++ b/tools/net/ynl/lib/Makefile
@@ -19,7 +19,6 @@ ynl.a: $(OBJS)

clean:
rm -f *.o *.d *~
- rm -rf __pycache__

distclean: clean
rm -f *.a
diff --git a/tools/net/ynl/pyynl/__init__.py b/tools/net/ynl/pyynl/__init__.py
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/tools/net/ynl/cli.py b/tools/net/ynl/pyynl/cli.py
similarity index 100%
rename from tools/net/ynl/cli.py
rename to tools/net/ynl/pyynl/cli.py
diff --git a/tools/net/ynl/ethtool.py b/tools/net/ynl/pyynl/ethtool.py
similarity index 100%
rename from tools/net/ynl/ethtool.py
rename to tools/net/ynl/pyynl/ethtool.py
diff --git a/tools/net/ynl/pyynl/lib/.gitignore b/tools/net/ynl/pyynl/lib/.gitignore
new file mode 100644
index 000000000000..c18dd8d83cee
--- /dev/null
+++ b/tools/net/ynl/pyynl/lib/.gitignore
@@ -0,0 +1 @@
+__pycache__/
diff --git a/tools/net/ynl/lib/__init__.py b/tools/net/ynl/pyynl/lib/__init__.py
similarity index 100%
rename from tools/net/ynl/lib/__init__.py
rename to tools/net/ynl/pyynl/lib/__init__.py
diff --git a/tools/net/ynl/lib/nlspec.py b/tools/net/ynl/pyynl/lib/nlspec.py
similarity index 100%
rename from tools/net/ynl/lib/nlspec.py
rename to tools/net/ynl/pyynl/lib/nlspec.py
diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py
similarity index 100%
rename from tools/net/ynl/lib/ynl.py
rename to tools/net/ynl/pyynl/lib/ynl.py
diff --git a/tools/net/ynl/ynl-gen-c.py b/tools/net/ynl/pyynl/ynl-gen-c.py
similarity index 100%
rename from tools/net/ynl/ynl-gen-c.py
rename to tools/net/ynl/pyynl/ynl-gen-c.py
diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/pyynl/ynl-gen-rst.py
similarity index 100%
rename from tools/net/ynl/ynl-gen-rst.py
rename to tools/net/ynl/pyynl/ynl-gen-rst.py
diff --git a/tools/net/ynl/ynl-regen.sh b/tools/net/ynl/ynl-regen.sh
index a37304dcc88e..3212dab1cc6e 100755
--- a/tools/net/ynl/ynl-regen.sh
+++ b/tools/net/ynl/ynl-regen.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause

-TOOL=$(dirname $(realpath $0))/ynl-gen-c.py
+TOOL=$(dirname $(realpath $0))/pyynl/ynl-gen-c.py

force=
search=
--
2.43.0