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