From 3f0b370a399340089d28b2b4c712a920b63f6af5 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 26 Mar 2025 12:40:34 -0500 Subject: T7289: add libvyosconfig as git submodule --- .gitmodules | 4 ++++ libvyosconfig | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 libvyosconfig diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..eb4a75100 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "libvyosconfig"] + path = libvyosconfig + url = git@github.com:vyos/libvyosconfig.git + branch = current diff --git a/libvyosconfig b/libvyosconfig new file mode 160000 index 000000000..27e4b0a5e --- /dev/null +++ b/libvyosconfig @@ -0,0 +1 @@ +Subproject commit 27e4b0a5eaf77d9a1f5e1f6dcaa109e5d73c51d1 -- cgit v1.2.3 From e5cc2004b4d2ea8c3d5b7a9cf75e0ba11a7f8b34 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 26 Mar 2025 13:03:54 -0500 Subject: T7289: update Makefile for libvyosconfig as git submodule --- Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 6b8827c84..b78bedebd 100644 --- a/Makefile +++ b/Makefile @@ -23,12 +23,10 @@ op_xml_obj = $(op_xml_src:.xml.in=.xml) .PHONY: libvyosconfig .ONESHELL: libvyosconfig: - if ! [ -f $(LIBVYOSCONFIG_BUILD_PATH) ]; then - rm -rf /tmp/libvyosconfig && \ - git clone https://github.com/vyos/libvyosconfig.git /tmp/libvyosconfig || exit 1 - cd /tmp/libvyosconfig && \ - git checkout 27e4b0a5eaf77d9a1f5e1f6dcaa109e5d73c51d1 || exit 1 - eval $$(opam env --root=/opt/opam --set-root) && ./build.sh + if test ! -f $(LIBVYOSCONFIG_BUILD_PATH); then + rm -rf /tmp/libvyosconfig && mkdir /tmp/libvyosconfig + cp -r libvyosconfig /tmp && cd /tmp/libvyosconfig && \ + eval $$(opam env --root=/opt/opam --set-root) && ./build.sh || exit 1 fi .PHONY: interface_definitions -- cgit v1.2.3 From e4d0f284ff3f65f296fb74bf7b30105401d3e4b2 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 27 Mar 2025 10:45:19 -0500 Subject: T7289: set url as relative path --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index eb4a75100..4e9a691c0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "libvyosconfig"] path = libvyosconfig - url = git@github.com:vyos/libvyosconfig.git + url = ../libvyosconfig.git branch = current -- cgit v1.2.3 From 856ab11067957b34a98133075eaff5da3c19b9bd Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 27 Mar 2025 13:32:33 -0500 Subject: T7289: attempt to update submodule if status inconsistent --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index b78bedebd..aa113d9ce 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ BUILD_ARCH := $(shell dpkg-architecture -q DEB_BUILD_ARCH) J2LINT := $(shell command -v j2lint 2> /dev/null) PYLINT_FILES := $(shell git ls-files *.py src/migration-scripts) LIBVYOSCONFIG_BUILD_PATH := /tmp/libvyosconfig/_build/libvyosconfig.so +LIBVYOSCONFIG_STATUS := $(shell git submodule status) config_xml_src = $(wildcard interface-definitions/*.xml.in) config_xml_obj = $(config_xml_src:.xml.in=.xml) @@ -24,6 +25,9 @@ op_xml_obj = $(op_xml_src:.xml.in=.xml) .ONESHELL: libvyosconfig: if test ! -f $(LIBVYOSCONFIG_BUILD_PATH); then + if ! echo $(firstword $(LIBVYOSCONFIG_STATUS))|grep -Eq '^[0-9]'; then + git submodule sync; git submodule update --init --remote + fi rm -rf /tmp/libvyosconfig && mkdir /tmp/libvyosconfig cp -r libvyosconfig /tmp && cd /tmp/libvyosconfig && \ eval $$(opam env --root=/opt/opam --set-root) && ./build.sh || exit 1 -- cgit v1.2.3