build: extend ABI_VERSION suffixing to provides
authorJo-Philipp Wich <jo@mein.io>
Mon, 21 Jan 2019 16:29:57 +0000 (17:29 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 24 Jan 2019 09:39:29 +0000 (10:39 +0100)
When a library package specifies additional provides, e.g. libncurses
which provides libncursesw, we should also append the abi version
suffix to each provide, since there may be more than one package
providing the virtual library.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
include/package-ipkg.mk
scripts/package-metadata.pl

index dc05eefc7c2735ab9686bd82f35c615cace274d7..1cb4da8e3061d281a76d63405f10300db571d756 100644 (file)
@@ -162,7 +162,7 @@ Package: $(1)$$(ABIV_$(1))
 Version: $(VERSION)
 $$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
 )$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
-)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES)$$(if $$(ABIV_$(1)), $(1)))
+)$$(call addfield,Provides,$$(call mergelist,$(PROVIDES)$$(if $$(ABIV_$(1)), $(1) $(foreach provide,$(PROVIDES),$(provide)$$(ABIV_$(1)))))
 )$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
 )$$(call addfield,Source,$(SOURCE)
 )$$(call addfield,SourceName,$(1)
index b69ceb216a11e32f7bd8b26fba0b94c5a0cabd4c..e0cdff1e8174be5c09744049a0c34a61ca56e589 100755 (executable)
@@ -516,13 +516,19 @@ sub gen_package_auxiliary() {
                if ($pkg->{name} && $pkg->{repository}) {
                        print "Package/$name/subdir = $pkg->{repository}\n";
                }
-               if ($pkg->{name} && defined($pkg->{abiversion})) {
+               if ($pkg->{name} && defined($pkg->{abiversion}) && length($pkg->{abiversion})) {
+                       my $abiv;
+
                        if ($pkg->{abiversion} =~ m!^(\d{4})-(\d{2})-(\d{2})-[0-9a-f]{7,40}$!) {
                                print STDERR "WARNING: Reducing ABI version '$pkg->{abiversion}' of package '$name' to '$1$2$3'\n";
-                               print "Package/$name/abiversion = $1$2$3\n";
+                               $abiv = "$1$2$3";
+                       }
+                       else {
+                               $abiv = $pkg->{abiversion};
                        }
-                       elsif (length $pkg->{abiversion}) {
-                               print "Package/$name/abiversion = $pkg->{abiversion}\n";
+
+                       foreach my $n (@{$pkg->{provides}}) {
+                               print "Package/$n/abiversion = $abiv\n";
                        }
                }
        }