summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2022-01-20 10:06:54 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2022-01-20 14:57:49 +0100
commit17ec55c48082254e1f55bcfa00808e45a50a9801 (patch)
treea7bf1992682a4c6e7b2cf84711dee44056d14406 /solenv
parentb39bdb65b39e86996c704cdfe14360ad317f3a1f (diff)
Fail on non-optional, but filtered component names
If any of the optional component lists contain a non-optional component implementation, fail the component file generation and show a diff of the offending component implementation name. Change-Id: Ieac876e613f6945362186d4586dd2aacc5669920 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128645 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/ComponentTarget.mk26
-rw-r--r--solenv/gbuild/UnpackedTarball.mk2
2 files changed, 22 insertions, 6 deletions
diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk
index d317f1b05ae7..ce0224433661 100644
--- a/solenv/gbuild/ComponentTarget.mk
+++ b/solenv/gbuild/ComponentTarget.mk
@@ -49,6 +49,7 @@ endef
$(call gb_ComponentTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),CMP,1)
rm -f $(call gb_ComponentTarget_get_target,$*) \
+ $(call gb_ComponentTarget_get_target,$*).allfiltered \
$(call gb_ComponentTarget_get_target,$*).filtered \
$(call gb_ComponentTarget_get_target,$*).optionals \
@@ -61,12 +62,21 @@ $(call gb_ComponentTarget_get_target,%).optionals : \
| $(call gb_ComponentTarget_get_target,%).dir \
$(call gb_ExternalExecutable_get_dependencies,xsltproc)
$(call gb_ExternalExecutable_get_command,xsltproc) --nonet \
- $(gb_ComponentTarget_XSLT_DUMP_OPTIONALS) $(COMPONENTSOURCE) > $@ 2>&1
+ $(gb_ComponentTarget_XSLT_DUMP_OPTIONALS) $(COMPONENTSOURCE) 2>&1 | sort > $@
# %.filtered : list of all optional implementations we don't build
.PRECIOUS: $(call gb_ComponentTarget_get_target,%).filtered
$(call gb_ComponentTarget_get_target,%).filtered : $(call gb_ComponentTarget_get_target,%).optionals
- cat $< $(COMPONENTIMPL) | sed -e '/^#\|^\s*$$/d' | sort | uniq -u > $@
+ cat $< $(COMPONENTIMPL) | sed -e '/^#/d' -e '/^[ ]*$$/d' | sort | uniq -u > $@
+
+# %.allfiltered : contains all possible filtered components, which must match %.optionals
+.PRECIOUS: $(call gb_ComponentTarget_get_target,%).allfiltered
+$(call gb_ComponentTarget_get_target,%).allfiltered : $(call gb_ComponentTarget_get_target,%).optionals
+ $(if $(ALLFILTEREDIMPL), \
+ cat $(ALLFILTEREDIMPL) | sed -e '/^#/d' -e '/^[ ]*$$/d' | sort | uniq > $@.tmp, \
+ touch $@.tmp)
+ $(DIFF) -u $< $@.tmp
+ mv $@.tmp $@
# when a library is renamed, the component file needs to be rebuilt to match.
# hence simply depend on Repository{,Fixes}.mk since the command runs quickly.
@@ -74,6 +84,7 @@ $(call gb_ComponentTarget_get_target,%) : \
$(SRCDIR)/Repository.mk \
$(SRCDIR)/RepositoryFixes.mk \
$(gb_ComponentTarget_XSLT_CREATE_COMPONENT) \
+ $(call gb_ComponentTarget_get_target,%).allfiltered \
$(call gb_ComponentTarget_get_target,%).filtered \
| $(call gb_ExternalExecutable_get_dependencies,xsltproc)
$(call gb_Output_announce,$*,$(true),CMP,1)
@@ -81,14 +92,19 @@ $(call gb_ComponentTarget_get_target,%) : \
$(call gb_ComponentTarget__command,$@)
$(call gb_Trace_EndRange,$*,CMP)
+gb_ComponentTarget__init_source = $(call gb_ComponentTarget_get_source,$(patsubst CppunitTest/%,%,$(1)))
+gb_ComponentTarget__init_allfiltered = $(wildcard $(call gb_ComponentTarget__init_source,$(1)).*)
+
define gb_ComponentTarget_ComponentTarget
$(call gb_ComponentTarget_get_target,$(1)) : COMPONENTPREFIX := $(2)
$(call gb_ComponentTarget_get_target,$(1)) : LIBFILENAME := $(3)
-$(call gb_ComponentTarget_get_target,$(1)) : COMPONENTSOURCE := $(call gb_ComponentTarget_get_source,$(patsubst CppunitTest/%,%,$(1)))
+$(call gb_ComponentTarget_get_target,$(1)) : COMPONENTSOURCE := $(call gb_ComponentTarget__init_source,$(1))
$(call gb_ComponentTarget_get_target,$(1)) : COMPONENTIMPL :=
+$(call gb_ComponentTarget_get_target,$(1)) : ALLFILTEREDIMPL := $(call gb_ComponentTarget__init_allfiltered,$(1))
-$(call gb_ComponentTarget_get_target,$(1)) : $(call gb_ComponentTarget_get_source,$(patsubst CppunitTest/%,%,$(1)))
-$(call gb_ComponentTarget_get_target,$(1)).optionals : $(call gb_ComponentTarget_get_source,$(patsubst CppunitTest/%,%,$(1)))
+$(call gb_ComponentTarget_get_target,$(1)) : $(call gb_ComponentTarget__source,$(1))
+$(call gb_ComponentTarget_get_target,$(1)).optionals : $(call gb_ComponentTarget__init_source,$(1))
+$(call gb_ComponentTarget_get_target,$(1)).allfiltered : $(call gb_ComponentTarget__init_allfiltered,$(1))
$(call gb_Helper_make_userfriendly_targets,$(1),ComponentTarget,$(call gb_ComponentTarget_get_target,$(1)))
diff --git a/solenv/gbuild/UnpackedTarball.mk b/solenv/gbuild/UnpackedTarball.mk
index fb574f6a95f1..7355f010de98 100644
--- a/solenv/gbuild/UnpackedTarball.mk
+++ b/solenv/gbuild/UnpackedTarball.mk
@@ -444,7 +444,7 @@ endef
( \
patch_file=$$(pwd)/$*.new.patch.1; \
cd $(call gb_UnpackedTarball_get_dir,) ; \
- diff -ur $*.org $* > $$patch_file; \
+ $(DIFF) -ur $*.org $* > $$patch_file; \
echo "Patch $$patch_file generated" ; \
); \
else \