metadata: make srcpackage extensible
authorMatthias Schiffer <mschiffer@universe-factory.net>
Thu, 4 Jan 2018 18:52:18 +0000 (19:52 +0100)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Sat, 13 Jan 2018 18:54:43 +0000 (19:54 +0100)
Turn the srcpackage values into hashes to allow storing more information
than just binary package names.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
scripts/feeds
scripts/metadata.pm
scripts/package-metadata.pl

index 55c294ad0a4ec2f0419d12deddeda7324c349e04..0228c7ac079d3541ab0f1261b04bf6e95909345b 100755 (executable)
@@ -525,7 +525,7 @@ sub install_package {
        };
 
        # install all dependencies referenced from the source package
-       foreach my $vpkg (@{$feed_src->{$src}}) {
+       foreach my $vpkg (@{$feed_src->{$src}{packages}}) {
                foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}, @{$vpkg->{"builddepends/host"}}) {
                        next if $dep =~ /@/;
                        $dep =~ s/^\+//;
index d446892e2bc15b00e89fa04b98c9aeaae1d1343b..fdb1fbb433646f95a2c87b8d6739ab1d1021b4f4 100644 (file)
@@ -212,7 +212,9 @@ sub parse_package_metadata($) {
                        $src = $3;
                        $subdir =~ s/^package\///;
                        $subdir{$src} = $subdir;
-                       $srcpackage{$src} = [];
+                       $srcpackage{$src} = {
+                               packages => [],
+                       };
                        $override = "";
                        undef $pkg;
                };
@@ -237,7 +239,7 @@ sub parse_package_metadata($) {
                        $pkg->{tristate} = 1;
                        $pkg->{override} = $override;
                        $package{$1} = $pkg;
-                       push @{$srcpackage{$src}}, $pkg;
+                       push @{$srcpackage{$src}{packages}}, $pkg;
                };
                /^Feature:\s*(.+?)\s*$/ and do {
                        undef $pkg;
index 46446e994bada8fb88bfca735a1c3d907d5ce6ba..f03547a0d4478ee56be8bc3d0d848bd31fe853e7 100755 (executable)
@@ -445,7 +445,7 @@ sub gen_package_mk() {
                        print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$pkg->{buildtypes}})."\n";
                }
 
-               foreach my $spkg (@{$srcpackage{$pkg->{src}}}) {
+               foreach my $spkg (@{$srcpackage{$pkg->{src}}{packages}}) {
                        foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) {
                                $dep =~ /@/ or do {
                                        $dep =~ s/\+//g;