build: expose ABI version in .packageauxvars
authorJo-Philipp Wich <jo@mein.io>
Fri, 18 Jan 2019 11:43:06 +0000 (12:43 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sat, 19 Jan 2019 13:32:01 +0000 (14:32 +0100)
Subdequent commits need this information to resolve the ABI version when
computing binary ipk dependencies.

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

index 8a42be5bd186ec4ce8c8b925d853d09c05306804..ef98c482fbd3ba764e79e56c44a69e57554eba56 100644 (file)
@@ -24,7 +24,8 @@ $(if $(MENU),Menu: $(MENU)
 )$(if $(DEFAULT),Default: $(DEFAULT)
 )$(if $(findstring $(PREREQ_CHECK),1),Prereq-Check: 1
 )Version: $(VERSION)
-Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
+$(if $(ABI_VERSION),ABIVersion: $(ABI_VERSION)
+)Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
 Conflicts: $(CONFLICTS)
 Menu-Depends: $(MDEPENDS)
 Provides: $(PROVIDES)
index 4a5464edc0d9e401a0fa1cecc086b9e10dd11afa..5300e293e7bf9cdf737fc630f4b68fea9cf045e2 100644 (file)
@@ -238,6 +238,7 @@ sub parse_package_metadata($) {
                /^Build-Types:\s*(.+)\s*$/ and $src->{buildtypes} = [ split /\s+/, $1 ];
                next unless $pkg;
                /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1;
+               /^ABIVersion: \s*(.+)\s*$/ and $pkg->{abiversion} = $1;
                /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1;
                /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1;
                /^Submenu: \s*(.+)\s*$/ and $pkg->{submenu} = $1;
index b8c5de298a3ec1b0fac7227727f10b60a904d27f..b69ceb216a11e32f7bd8b26fba0b94c5a0cabd4c 100755 (executable)
@@ -516,6 +516,15 @@ sub gen_package_auxiliary() {
                if ($pkg->{name} && $pkg->{repository}) {
                        print "Package/$name/subdir = $pkg->{repository}\n";
                }
+               if ($pkg->{name} && defined($pkg->{abiversion})) {
+                       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";
+                       }
+                       elsif (length $pkg->{abiversion}) {
+                               print "Package/$name/abiversion = $pkg->{abiversion}\n";
+                       }
+               }
        }
 }