build: drop ABI version from metadata
authorFelix Fietkau <nbd@nbd.name>
Fri, 12 Feb 2021 10:16:35 +0000 (11:16 +0100)
committerFelix Fietkau <nbd@nbd.name>
Sun, 14 Feb 2021 18:41:52 +0000 (19:41 +0100)
Preparation for supporting dynamic ABI versions that depend on the runtime
configuration. Read the suffix from the staging dir pkginfo version files.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/feeds.mk
include/package-dumpinfo.mk
include/package-ipkg.mk
scripts/metadata.pm
scripts/package-metadata.pl

index ef5fef7f4ba84357a84754cbe5ffa06e8f204993..5676cc4a8f6b3f43d054f5e3d9aa06f036c645ed 100644 (file)
@@ -43,5 +43,5 @@ endef
 
 # 1: package name
 define GetABISuffix
-$(if $(filter-out kmod-%,$(1)),$(if $(Package/$(1)/abiversion),$(if $(filter %0 %1 %2 %3 %4 %5 %6 %7 %8 %9,$(1)),-)$(Package/$(1)/abiversion)))
+$(if $(filter-out kmod-%,$(1)),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v))))
 endef
index 30b0187f119e37ded3b21f7e6f42d88ee121db44..597452e4b930745f81636c50663e4bfde9687f18 100644 (file)
@@ -21,8 +21,7 @@ $(if $(MENU),Menu: $(MENU)
 )$(if $(DEFAULT),Default: $(DEFAULT)
 )$(if $(findstring $(PREREQ_CHECK),1),Prereq-Check: 1
 )Version: $(VERSION)
-$(if $(ABI_VERSION),ABIVersion: $(ABI_VERSION)
-)Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
+Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
 Conflicts: $(CONFLICTS)
 Menu-Depends: $(MDEPENDS)
 Provides: $(PROVIDES)
index fb1b7549fbf801319c0fb4fc5a6f4d41856a4fe5..e89276ed1a03f06bfce420b502d86fdb495c40fc 100644 (file)
@@ -99,7 +99,7 @@ _endef=endef
 
 ifeq ($(DUMP),)
   define BuildTarget/ipkg
-    ABIV_$(1):=$(call GetABISuffix,$(1))
+    ABIV_$(1):=$(if $(filter-out kmod-%,$(1)),$(ABI_VERSION))
     PDIR_$(1):=$(call FeedPackageDir,$(1))
     IPKG_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).ipk
     IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
@@ -157,7 +157,12 @@ ifeq ($(DUMP),)
 
     $(STAGING_DIR_ROOT)/stamp/.$(1)_installed: $(PKG_BUILD_DIR)/.pkgdir/$(1).installed
        mkdir -p $(STAGING_DIR_ROOT)/stamp
-       $(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version)
+       $(if $(ABI_VERSION),echo '$(ABI_VERSION)' | cmp -s - $(PKG_INFO_DIR)/$(1).version || \
+               echo '$(ABI_VERSION)' > $(PKG_INFO_DIR)/$(1).version \
+               $(foreach pkg,$(filter-out $(1),$(PROVIDES)),; \
+                       cp $(PKG_INFO_DIR)/$(1).version $(PKG_INFO_DIR)/$(pkg).version \
+               ) \
+       )
        $(call locked,$(CP) $(PKG_BUILD_DIR)/.pkgdir/$(1)/. $(STAGING_DIR_ROOT)/,root-copy)
        touch $$@
 
index f6dce39662d280942541303be5cd7de463a00ba0..5fbb77a36c4cb22059cee802fbf9eee4648de7e1 100644 (file)
@@ -249,7 +249,6 @@ 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 5abc1bdef3f70e1c4cbe3f97ecfd6ea925ad88ed..02102be8f39dbf755e9331f8a938dfc9147d1d83 100755 (executable)
@@ -532,21 +532,6 @@ sub gen_package_auxiliary() {
                if ($pkg->{name} && $pkg->{repository}) {
                        print "Package/$name/subdir = $pkg->{repository}\n";
                }
-               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";
-                               $abiv = "$1$2$3";
-                       }
-                       else {
-                               $abiv = $pkg->{abiversion};
-                       }
-
-                       foreach my $n (@{$pkg->{provides}}) {
-                               print "Package/$n/abiversion = $abiv\n";
-                       }
-               }
                my %depends;
                foreach my $dep (@{$pkg->{depends} || []}) {
                        if ($dep =~ m!^\+?(?:[^:]+:)?([^@]+)$!) {