metadata: move 'builddepends' from binary to source packages
authorMatthias Schiffer <mschiffer@universe-factory.net>
Sat, 6 Jan 2018 13:49:08 +0000 (14:49 +0100)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Sat, 13 Jan 2018 18:54:43 +0000 (19:54 +0100)
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
scripts/feeds
scripts/metadata.pm
scripts/package-metadata.pl

index 0228c7ac079d3541ab0f1261b04bf6e95909345b..0a7e9317f8e2e519e9ef200c9f7ac8caad42caec 100755 (executable)
@@ -525,15 +525,17 @@ sub install_package {
        };
 
        # install all dependencies referenced from the source package
-       foreach my $vpkg (@{$feed_src->{$src}{packages}}) {
-               foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}, @{$vpkg->{"builddepends/host"}}) {
-                       next if $dep =~ /@/;
-                       $dep =~ s/^\+//;
-                       $dep =~ s/^.+://;
-                       $dep =~ s/\/.+$//;
-                       next unless $dep;
-                       install_package($feed, $dep, 0) == 0 or $ret = 1;
-               }
+       foreach my $dep (
+               @{$feed_src->{$src}{builddepends}},
+               @{$feed_src->{$src}{"builddepends/host"}},
+               map { @{$_->{depends}} } @{$feed_src->{$src}{packages}}
+       ) {
+               next if $dep =~ /@/;
+               $dep =~ s/^\+//;
+               $dep =~ s/^.+://;
+               $dep =~ s/\/.+$//;
+               next unless $dep;
+               install_package($feed, $dep, 0) == 0 or $ret = 1;
        }
 
        return $ret;
index d756c7242dcd4fcec2ccaccd117303284b777794..8cc7530a1d25b251c33a504028cda14241f527d1 100644 (file)
@@ -215,6 +215,7 @@ sub parse_package_metadata($) {
                        $srcpackage{$src} = {
                                packages => [],
                                buildtypes => [],
+                               builddepends => [],
                        };
                        $override = "";
                        undef $pkg;
@@ -234,7 +235,6 @@ sub parse_package_metadata($) {
                        $pkg->{title} = "";
                        $pkg->{depends} = [];
                        $pkg->{mdepends} = [];
-                       $pkg->{builddepends} = [];
                        $pkg->{subdir} = $subdir;
                        $pkg->{tristate} = 1;
                        $pkg->{override} = $override;
@@ -258,6 +258,8 @@ sub parse_package_metadata($) {
                        /^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t");
                        next;
                };
+               /^Build-Depends: \s*(.+)\s*$/ and $srcpackage{$src}{builddepends} = [ split /\s+/, $1 ];
+               /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $srcpackage{$src}{"builddepends/$1"} = [ split /\s+/, $2 ];
                /^Build-Types:\s*(.+)\s*$/ and $srcpackage{$src}{buildtypes} = [ split /\s+/, $1 ];
                next unless $pkg;
                /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1;
@@ -289,8 +291,6 @@ sub parse_package_metadata($) {
                /^Build-Variant: \s*([\w\-]+)\s*/ and $pkg->{variant} = $1;
                /^Default-Variant: .*/ and $pkg->{variant_default} = 1;
                /^Build-Only: \s*(.+)\s*$/ and $pkg->{buildonly} = 1;
-               /^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ];
-               /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ];
                /^Repository:\s*(.+?)\s*$/ and $pkg->{repository} = $1;
                /^Category: \s*(.+)\s*$/ and do {
                        $pkg->{category} = $1;
index 22de5b1ba0f33bda4f5315805d7e67ab4304f2c5..97b57c65eb8d5f7a556c3dc48ef7a685bb5d4d76 100755 (executable)
@@ -446,20 +446,18 @@ sub gen_package_mk() {
                        print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$src->{buildtypes}})."\n";
                }
 
-               foreach my $spkg (@{$src->{packages}}) {
-                       foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) {
-                               $dep =~ /@/ or do {
-                                       $dep =~ s/\+//g;
-                                       push @srcdeps, $dep;
-                               };
-                       }
+               foreach my $dep (@{$src->{builddepends}}, map { @{$_->{depends}} } @{$src->{packages}}) {
+                       $dep =~ /@/ or do {
+                               $dep =~ s/\+//g;
+                               push @srcdeps, $dep;
+                       };
                }
                foreach my $type (@{$src->{buildtypes}}) {
                        my @extra_deps;
                        my %deplines;
 
-                       next unless $pkg->{"builddepends/$type"};
-                       foreach my $dep (@{$pkg->{"builddepends/$type"}}) {
+                       next unless $src->{"builddepends/$type"};
+                       foreach my $dep (@{$src->{"builddepends/$type"}}) {
                                my $suffix = "";
                                my $deptype = "";
                                my $condition;