metadata: remove redundant fields from package hash
authorMatthias Schiffer <mschiffer@universe-factory.net>
Sat, 6 Jan 2018 18:44:52 +0000 (19:44 +0100)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Sat, 13 Jan 2018 18:54:44 +0000 (19:54 +0100)
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
scripts/feeds
scripts/metadata.pm
scripts/package-metadata.pl

index 4ac6685b4d6ef0a79a842009e310a36f72b8310b..4595c824a4b7c4836fdb1b67472dc476101e3d45 100755 (executable)
@@ -373,10 +373,14 @@ sub list {
        return 0;
 }
 
+# TODO: do_install_package etc. should deal with source packages rather
+# than binary packages
 sub do_install_package($$) {
        my $feed = shift;
        my $pkg = shift;
-       my $path = $pkg->{makefile};
+
+       my $path;
+       $pkg->{src} and $path = $pkg->{src}{makefile};
 
        if($path) {
                $path =~ s/\/Makefile$//;
index f3c84e80c3d8feebc4acd02cb3c7158644dada05..c0c967c01cc2fd0cbbdc36326448af46c5d6d834 100644 (file)
@@ -224,9 +224,7 @@ sub parse_package_metadata($) {
                /^Package:\s*(.+?)\s*$/ and do {
                        undef $feature;
                        $pkg = {};
-                       $pkg->{ignore} = $src->{ignore};
                        $pkg->{src} = $src;
-                       $pkg->{makefile} = $src->{makefile};
                        $pkg->{name} = $1;
                        $pkg->{title} = "";
                        $pkg->{depends} = [];
@@ -273,7 +271,6 @@ sub parse_package_metadata($) {
                                        name => $vpkg,
                                        vdepends => [],
                                        src => $src,
-                                       makefile => $src->{makefile},
                                };
                                push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
                        }
index dab960e677a6825cc2d448dff7a7f09706f4f26e..7bffb2374ca9b9dcc7b275f173394b563dd5aabf 100755 (executable)
@@ -290,7 +290,7 @@ sub print_package_config_category($) {
                        print "menu \"$menu\"\n";
                }
                foreach my $pkg (@pkgs) {
-                       next if $pkg->{ignore};
+                       next if $pkg->{src}{ignore};
                        my $title = $pkg->{name};
                        my $c = (72 - length($pkg->{name}) - length($pkg->{title}));
                        if ($c > 0) {
@@ -485,7 +485,7 @@ sub gen_package_mk() {
                                if (defined($pkg_dep) && defined($pkg_dep->{src})) {
                                        unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}{buildtypes}}) {
                                                warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
-                                                       $src->{makefile}, $type, $pkg_dep->{src}{name}, $deptype, $pkg_dep->{makefile}, $deptype;
+                                                       $src->{makefile}, $type, $pkg_dep->{src}{name}, $deptype, $pkg_dep->{src}{makefile}, $deptype;
                                                next;
                                        }
                                        $idx = $pkg_dep->{src}{path};
@@ -539,7 +539,7 @@ sub gen_package_mk() {
                                if (defined $pkg_dep->{src}) {
                                        unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{src}{buildtypes}}) {
                                                warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n",
-                                                       $src->{makefile}, $pkg_dep->{src}{name}, $deptype, $pkg_dep->{makefile}, $deptype;
+                                                       $src->{makefile}, $pkg_dep->{src}{name}, $deptype, $pkg_dep->{src}{makefile}, $deptype;
                                                next;
                                        }
                                        $idx = $pkg_dep->{src}{path};
@@ -640,7 +640,7 @@ sub gen_package_license($) {
                        } else {
                                if ($level == 1) {
                                        print "$pkg->{name}: Missing license! ";
-                                       print "Please fix $pkg->{makefile}\n";
+                                       print "Please fix $pkg->{src}{makefile}\n";
                                }
                        }
                }