summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-04-02 12:49:26 +0200
committerChristian Poessinger <christian@poessinger.com>2021-04-02 19:34:30 +0200
commit99440fc005d734d602fb9cd5b546e320c9b1e19b (patch)
treecf7c79956600861917034dac6f2b4bc4d45f9ced /Makefile
parent939bbaa72db37010b4562b727778d06f371725ff (diff)
downloadvyos-1x-99440fc005d734d602fb9cd5b546e320c9b1e19b.tar.gz
vyos-1x-99440fc005d734d602fb9cd5b546e320c9b1e19b.zip
Makefile: fix logic to detect empty "node.def" files
Commit 5b22ebae ("T3170: check if any generated node.def files are empty") added an initial test to find empty node.def files created by build-command-templates or build-command-op-templates. The problem was that GNU find always returns 0, thus the condition to bail out on error was always met. This has been corrected to return false on hits only.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index dcc203f01..b157de71c 100644
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,9 @@ interface_definitions: $(config_xml_obj)
rm -rf $(TMPL_DIR)/vpn/nipsec
rm -rf $(TMPL_DIR)/npolicy
- find $(TMPL_DIR) -name node.def -empty && sh -c 'echo "There are empty node.def files! Check your interface definitions." && exit 1'
+ # XXX: test if there are empty node.def files - this is not allowed as these
+ # could mask help strings or mandatory priority statements
+ find $(TMPL_DIR) -name node.def -type f -empty -exec false {} + || sh -c 'echo "There are empty node.def files! Check your interface definitions." && exit 1'
.PHONY: op_mode_definitions
.ONESHELL:
@@ -73,7 +75,9 @@ op_mode_definitions: $(op_xml_obj)
# options are provided from the script itself
ln -s ../node.tag $(OP_TMPL_DIR)/ping/node.tag/node.tag/
- find $(op_TMPL_DIR) -name node.def -empty && sh -c 'echo "There are empty node.def files! Check your interface definitions." && exit 1'
+ # XXX: test if there are empty node.def files - this is not allowed as these
+ # could mask help strings or mandatory priority statements
+ #find $(OP_TMPL_DIR) -name node.def -type f -empty -exec false {} + || sh -c 'echo "There are empty node.def files! Check your interface definitions." && exit 1'
.PHONY: component_versions
.ONESHELL: