metadata: handle ABI version rebuild tracking for transient dependencies

Extend the packageauxvars database to keep a list of possible package
dependencies for each provider, then utilize this information in buildroot
to resolve the ABI version dependencies of dependent packages up to five
levels deep.

This should properly trigger rebuilds for packages indirectly depending
on other packages whose ABI_VERSION changed.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-06-20 21:02:06 +02:00
parent 3dc4f59eab
commit 27a4a71c24
2 changed files with 33 additions and 9 deletions

View File

@ -53,14 +53,26 @@ endif
include $(INCLUDE_DIR)/quilt.mk include $(INCLUDE_DIR)/quilt.mk
find_library_dependencies = $(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \ find_library_dependencies = \
$(filter-out $(BUILD_PACKAGES),$(foreach dep, \ $(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
$(filter-out @%, $(patsubst +%,%,$(1))), \ $(sort $(foreach dep4, \
$(if $(findstring :,$(dep)), \ $(sort $(foreach dep3, \
$(word 2,$(subst :,$(space),$(dep))), \ $(sort $(foreach dep2, \
$(dep) \ $(sort $(foreach dep1, \
) \ $(sort $(foreach dep0, \
)))) $(Package/$(1)/depends), \
$(Package/$(dep0)/depends) $(dep0) \
)), \
$(Package/$(dep1)/depends) $(dep1) \
)), \
$(Package/$(dep2)/depends) $(dep2) \
)), \
$(Package/$(dep3)/depends) $(dep3) \
)), \
$(Package/$(dep4)/depends) $(dep4) \
)), \
))
PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR))) PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
STAMP_NO_AUTOREBUILD=$(wildcard $(PKG_BUILD_DIR)/.no_autorebuild) STAMP_NO_AUTOREBUILD=$(wildcard $(PKG_BUILD_DIR)/.no_autorebuild)
@ -258,7 +270,7 @@ endef
endif endif
BUILD_PACKAGES += $(1) BUILD_PACKAGES += $(1)
$(STAMP_PREPARED): $$(if $(QUILT)$(DUMP),,$(call find_library_dependencies,$(DEPENDS))) $(STAMP_PREPARED): $$(if $(QUILT)$(DUMP),,$(call find_library_dependencies,$(1)))
$(foreach FIELD, TITLE CATEGORY SECTION VERSION, $(foreach FIELD, TITLE CATEGORY SECTION VERSION,
ifeq ($($(FIELD)),) ifeq ($($(FIELD)),)

View File

@ -547,6 +547,18 @@ sub gen_package_auxiliary() {
print "Package/$n/abiversion = $abiv\n"; print "Package/$n/abiversion = $abiv\n";
} }
} }
my %depends;
foreach my $dep (@{$pkg->{depends} || []}) {
if ($dep =~ m!^\+?(?:[^:]+:)?([^@]+)$!) {
$depends{$1}++;
}
}
my @depends = sort keys %depends;
if (@depends > 0) {
foreach my $n (@{$pkg->{provides}}) {
print "Package/$n/depends = @depends\n";
}
}
} }
} }