binutils: break-out libbfd, libopcodes and ar
[openwrt/staging/chunkeey.git] / scripts / metadata.pl
index 4014613de60e3a42711d314971c1b6f0118f6445..f3d04dba2dd7e0d433bedc3ee4e8eda03557124d 100755 (executable)
@@ -522,6 +522,18 @@ sub mconf_depends {
        return $res;
 }
 
+sub mconf_conflicts {
+       my $pkgname = shift;
+       my $depends = shift;
+       my $res = "";
+
+       foreach my $depend (@$depends) {
+               next unless $package{$depend};
+               $res .= "\t\tdepends on m || (PACKAGE_$depend != y)\n";
+       }
+       return $res;
+}
+
 sub print_package_config_category($) {
        my $cat = shift;
        my %menus;
@@ -583,6 +595,7 @@ sub print_package_config_category($) {
                        }
                        print mconf_depends($pkg->{name}, $pkg->{depends}, 0);
                        print mconf_depends($pkg->{name}, $pkg->{mdepends}, 0);
+                       print mconf_conflicts($pkg->{name}, $pkg->{conflicts});
                        print "\t\thelp\n";
                        print $pkg->{description};
                        print "\n";
@@ -858,6 +871,28 @@ sub gen_package_feeds() {
        }
 }
 
+sub gen_package_license($) {
+       my $level = shift;
+       parse_package_metadata($ARGV[0]) or exit 1;
+       foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
+               my $pkg = $package{$name};
+               if ($pkg->{name}) {
+                       if ($pkg->{license}) {
+                               print "$pkg->{name}: ";
+                               print "$pkg->{license}\n";
+                               if ($pkg->{licensefiles} && $level == 0) {
+                                       print "\tFiles: $pkg->{licensefiles}\n";
+                               }
+                       } else {
+                               if ($level == 1) {
+                                       print "$pkg->{name}: Missing license! ";
+                                       print "Please fix $pkg->{makefile}\n";
+                               }
+                       }
+               }
+       }
+}
+
 sub parse_command() {
        my $cmd = shift @ARGV;
        for ($cmd) {
@@ -867,6 +902,8 @@ sub parse_command() {
                /^kconfig/ and return gen_kconfig_overrides();
                /^package_source$/ and return gen_package_source();
                /^package_feeds$/ and return gen_package_feeds();
+               /^package_license$/ and return gen_package_license(0);
+               /^package_licensefull$/ and return gen_package_license(1);
        }
        print <<EOF
 Available Commands:
@@ -876,6 +913,8 @@ Available Commands:
        $0 kconfig [file] [config]      Kernel config overrides
        $0 package_source [file]        Package source file information
        $0 package_feeds [file]         Package feed information in makefile format
+       $0 package_license [file]       Package license information
+       $0 package_licensefull [file]   Package license information (full list)
 
 EOF
 }