package-metadata.pl 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. #!/usr/bin/env perl
  2. use FindBin;
  3. use lib "$FindBin::Bin";
  4. use strict;
  5. use metadata;
  6. use Getopt::Long;
  7. my %board;
  8. sub version_to_num($) {
  9. my $str = shift;
  10. my $num = 0;
  11. if (defined($str) && $str =~ /^\d+(?:\.\d+)+$/)
  12. {
  13. my @n = (split(/\./, $str), 0, 0, 0, 0);
  14. $num = ($n[0] << 24) | ($n[1] << 16) | ($n[2] << 8) | $n[3];
  15. }
  16. return $num;
  17. }
  18. sub version_filter_list(@) {
  19. my $cmpver = version_to_num(shift @_);
  20. my @items;
  21. foreach my $item (@_)
  22. {
  23. if ($item =~ s/@(lt|le|gt|ge|eq|ne)(\d+(?:\.\d+)+)\b//)
  24. {
  25. my $op = $1;
  26. my $symver = version_to_num($2);
  27. if ($symver > 0 && $cmpver > 0)
  28. {
  29. next unless (($op eq 'lt' && $cmpver < $symver) ||
  30. ($op eq 'le' && $cmpver <= $symver) ||
  31. ($op eq 'gt' && $cmpver > $symver) ||
  32. ($op eq 'ge' && $cmpver >= $symver) ||
  33. ($op eq 'eq' && $cmpver == $symver) ||
  34. ($op eq 'ne' && $cmpver != $symver));
  35. }
  36. }
  37. push @items, $item;
  38. }
  39. return @items;
  40. }
  41. sub gen_kconfig_overrides() {
  42. my %config;
  43. my %kconfig;
  44. my $package;
  45. my $pkginfo = shift @ARGV;
  46. my $cfgfile = shift @ARGV;
  47. my $patchver = shift @ARGV;
  48. # parameter 2: build system config
  49. open FILE, "<$cfgfile" or return;
  50. while (<FILE>) {
  51. /^(CONFIG_.+?)=(.+)$/ and $config{$1} = 1;
  52. }
  53. close FILE;
  54. # parameter 1: package metadata
  55. open FILE, "<$pkginfo" or return;
  56. while (<FILE>) {
  57. /^Package:\s*(.+?)\s*$/ and $package = $1;
  58. /^Kernel-Config:\s*(.+?)\s*$/ and do {
  59. my @config = split /\s+/, $1;
  60. foreach my $config (version_filter_list($patchver, @config)) {
  61. my $val = 'm';
  62. my $override;
  63. if ($config =~ /^(.+?)=(.+)$/) {
  64. $config = $1;
  65. $override = 1;
  66. $val = $2;
  67. }
  68. if ($config{"CONFIG_PACKAGE_$package"} and ($config ne 'n')) {
  69. next if $kconfig{$config} eq 'y';
  70. $kconfig{$config} = $val;
  71. } elsif (!$override) {
  72. $kconfig{$config} or $kconfig{$config} = 'n';
  73. }
  74. }
  75. };
  76. };
  77. close FILE;
  78. foreach my $kconfig (sort keys %kconfig) {
  79. if ($kconfig{$kconfig} eq 'n') {
  80. print "# $kconfig is not set\n";
  81. } else {
  82. print "$kconfig=$kconfig{$kconfig}\n";
  83. }
  84. }
  85. }
  86. my %dep_check;
  87. sub __find_package_dep($$) {
  88. my $pkg = shift;
  89. my $name = shift;
  90. my $deps = ($pkg->{vdepends} or $pkg->{depends});
  91. return 0 unless defined $deps;
  92. foreach my $dep (@{$deps}) {
  93. next if $dep_check{$dep};
  94. $dep_check{$dep} = 1;
  95. return 1 if $dep eq $name;
  96. return 1 if ($package{$dep} and (__find_package_dep($package{$dep},$name) == 1));
  97. }
  98. return 0;
  99. }
  100. # wrapper to avoid infinite recursion
  101. sub find_package_dep($$) {
  102. my $pkg = shift;
  103. my $name = shift;
  104. %dep_check = ();
  105. return __find_package_dep($pkg, $name);
  106. }
  107. sub package_depends($$) {
  108. my $a = shift;
  109. my $b = shift;
  110. my $ret;
  111. return 0 if ($a->{submenu} ne $b->{submenu});
  112. if (find_package_dep($a, $b->{name}) == 1) {
  113. $ret = 1;
  114. } elsif (find_package_dep($b, $a->{name}) == 1) {
  115. $ret = -1;
  116. } else {
  117. return 0;
  118. }
  119. return $ret;
  120. }
  121. sub mconf_depends {
  122. my $pkgname = shift;
  123. my $depends = shift;
  124. my $only_dep = shift;
  125. my $res;
  126. my $dep = shift;
  127. my $seen = shift;
  128. my $parent_condition = shift;
  129. $dep or $dep = {};
  130. $seen or $seen = {};
  131. my @t_depends;
  132. $depends or return;
  133. my @depends = @$depends;
  134. foreach my $depend (@depends) {
  135. my $m = "depends on";
  136. my $flags = "";
  137. $depend =~ s/^([@\+]+)// and $flags = $1;
  138. my $vdep;
  139. my $condition = $parent_condition;
  140. next if $condition eq $depend;
  141. next if $seen->{"$parent_condition:$depend"};
  142. next if $seen->{":$depend"};
  143. $seen->{"$parent_condition:$depend"} = 1;
  144. if ($depend =~ /^(.+):(.+)$/) {
  145. if ($1 ne "PACKAGE_$pkgname") {
  146. if ($condition) {
  147. $condition = "$condition && $1";
  148. } else {
  149. $condition = $1;
  150. }
  151. }
  152. $depend = $2;
  153. }
  154. next if $package{$depend} and $package{$depend}->{buildonly};
  155. if ($flags =~ /\+/) {
  156. if ($vdep = $package{$depend}->{vdepends}) {
  157. my @vdeps;
  158. $depend = undef;
  159. foreach my $v (@$vdep) {
  160. if ($package{$v} && $package{$v}->{variant_default}) {
  161. $depend = $v;
  162. } else {
  163. push @vdeps, $v;
  164. }
  165. }
  166. if (!$depend) {
  167. $depend = shift @vdeps;
  168. }
  169. if (@vdeps > 1) {
  170. $condition = ($condition ? "$condition && " : '') . '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')';
  171. } elsif (@vdeps > 0) {
  172. $condition = ($condition ? "$condition && " : '') . '!PACKAGE_'.$vdeps[0];
  173. }
  174. }
  175. # Menuconfig will not treat 'select FOO' as a real dependency
  176. # thus if FOO depends on other config options, these dependencies
  177. # will not be checked. To fix this, we simply emit all of FOO's
  178. # depends here as well.
  179. $package{$depend} and push @t_depends, [ $package{$depend}->{depends}, $condition ];
  180. $m = "select";
  181. next if $only_dep;
  182. $flags =~ /@/ or $depend = "PACKAGE_$depend";
  183. } else {
  184. if ($vdep = $package{$depend}->{vdepends}) {
  185. $depend = join("||", map { "PACKAGE_".$_ } @$vdep);
  186. } else {
  187. $flags =~ /@/ or $depend = "PACKAGE_$depend";
  188. }
  189. }
  190. if ($condition) {
  191. if ($m =~ /select/) {
  192. next if $depend eq $condition;
  193. $depend = "$depend if $condition";
  194. } else {
  195. $depend = "!($condition) || $depend" unless $dep->{$condition} eq 'select';
  196. }
  197. }
  198. $dep->{$depend} =~ /select/ or $dep->{$depend} = $m;
  199. }
  200. foreach my $tdep (@t_depends) {
  201. mconf_depends($pkgname, $tdep->[0], 1, $dep, $seen, $tdep->[1]);
  202. }
  203. foreach my $depend (keys %$dep) {
  204. my $m = $dep->{$depend};
  205. $res .= "\t\t$m $depend\n";
  206. }
  207. return $res;
  208. }
  209. sub mconf_conflicts {
  210. my $pkgname = shift;
  211. my $depends = shift;
  212. my $res = "";
  213. foreach my $depend (@$depends) {
  214. next unless $package{$depend};
  215. $res .= "\t\tdepends on m || (PACKAGE_$depend != y)\n";
  216. }
  217. return $res;
  218. }
  219. sub print_package_config_category($) {
  220. my $cat = shift;
  221. my %menus;
  222. my %menu_dep;
  223. return unless $category{$cat};
  224. print "menu \"$cat\"\n\n";
  225. my %spkg = %{$category{$cat}};
  226. foreach my $spkg (sort {uc($a) cmp uc($b)} keys %spkg) {
  227. foreach my $pkg (@{$spkg{$spkg}}) {
  228. next if $pkg->{buildonly};
  229. my $menu = $pkg->{submenu};
  230. if ($menu) {
  231. $menu_dep{$menu} or $menu_dep{$menu} = $pkg->{submenudep};
  232. } else {
  233. $menu = 'undef';
  234. }
  235. $menus{$menu} or $menus{$menu} = [];
  236. push @{$menus{$menu}}, $pkg;
  237. }
  238. }
  239. my @menus = sort {
  240. ($a eq 'undef' ? 1 : 0) or
  241. ($b eq 'undef' ? -1 : 0) or
  242. ($a cmp $b)
  243. } keys %menus;
  244. foreach my $menu (@menus) {
  245. my @pkgs = sort {
  246. package_depends($a, $b) or
  247. ($a->{name} cmp $b->{name})
  248. } @{$menus{$menu}};
  249. if ($menu ne 'undef') {
  250. $menu_dep{$menu} and print "if $menu_dep{$menu}\n";
  251. print "menu \"$menu\"\n";
  252. }
  253. foreach my $pkg (@pkgs) {
  254. next if $pkg->{ignore};
  255. my $title = $pkg->{name};
  256. my $c = (72 - length($pkg->{name}) - length($pkg->{title}));
  257. if ($c > 0) {
  258. $title .= ("." x $c). " ". $pkg->{title};
  259. }
  260. $title = "\"$title\"";
  261. print "\t";
  262. $pkg->{menu} and print "menu";
  263. print "config PACKAGE_".$pkg->{name}."\n";
  264. $pkg->{hidden} and $title = "";
  265. print "\t\t".($pkg->{tristate} ? 'tristate' : 'bool')." $title\n";
  266. print "\t\tdefault y if DEFAULT_".$pkg->{name}."\n";
  267. unless ($pkg->{hidden}) {
  268. my @def = ("ALL");
  269. if (!exists($pkg->{repository})) {
  270. push @def, "ALL_NONSHARED";
  271. }
  272. if ($pkg->{name} =~ /^kmod-/) {
  273. push @def, "ALL_KMODS";
  274. }
  275. $pkg->{default} ||= "m if " . join("||", @def);
  276. }
  277. if ($pkg->{default}) {
  278. foreach my $default (split /\s*,\s*/, $pkg->{default}) {
  279. print "\t\tdefault $default\n";
  280. }
  281. }
  282. print mconf_depends($pkg->{name}, $pkg->{depends}, 0);
  283. print mconf_depends($pkg->{name}, $pkg->{mdepends}, 0);
  284. print mconf_conflicts($pkg->{name}, $pkg->{conflicts});
  285. print "\t\thelp\n";
  286. print $pkg->{description};
  287. print "\n";
  288. $pkg->{config} and print $pkg->{config}."\n";
  289. }
  290. if ($menu ne 'undef') {
  291. print "endmenu\n";
  292. $menu_dep{$menu} and print "endif\n";
  293. }
  294. }
  295. print "endmenu\n\n";
  296. undef $category{$cat};
  297. }
  298. sub print_package_features() {
  299. keys %features > 0 or return;
  300. print "menu \"Package features\"\n";
  301. foreach my $n (keys %features) {
  302. my @features = sort { $b->{priority} <=> $a->{priority} or $a->{title} cmp $b->{title} } @{$features{$n}};
  303. print <<EOF;
  304. choice
  305. prompt "$features[0]->{target_title}"
  306. default FEATURE_$features[0]->{name}
  307. EOF
  308. foreach my $feature (@features) {
  309. print <<EOF;
  310. config FEATURE_$feature->{name}
  311. bool "$feature->{title}"
  312. EOF
  313. $feature->{description} =~ /\w/ and do {
  314. print "\t\thelp\n".$feature->{description}."\n";
  315. };
  316. }
  317. print "endchoice\n"
  318. }
  319. print "endmenu\n\n";
  320. }
  321. sub print_package_overrides() {
  322. keys %overrides > 0 or return;
  323. print "\tconfig OVERRIDE_PKGS\n";
  324. print "\t\tstring\n";
  325. print "\t\tdefault \"".join(" ", sort keys %overrides)."\"\n\n";
  326. }
  327. sub gen_package_config() {
  328. parse_package_metadata($ARGV[0]) or exit 1;
  329. print "menuconfig IMAGEOPT\n\tbool \"Image configuration\"\n\tdefault n\n";
  330. foreach my $preconfig (keys %preconfig) {
  331. foreach my $cfg (keys %{$preconfig{$preconfig}}) {
  332. my $conf = $preconfig{$preconfig}->{$cfg}->{id};
  333. $conf =~ tr/\.-/__/;
  334. print <<EOF
  335. config UCI_PRECONFIG_$conf
  336. string "$preconfig{$preconfig}->{$cfg}->{label}" if IMAGEOPT
  337. depends on PACKAGE_$preconfig
  338. default "$preconfig{$preconfig}->{$cfg}->{default}"
  339. EOF
  340. }
  341. }
  342. print "source \"package/*/image-config.in\"\n";
  343. if (scalar glob "package/feeds/*/*/image-config.in") {
  344. print "source \"package/feeds/*/*/image-config.in\"\n";
  345. }
  346. print_package_features();
  347. print_package_config_category 'Base system';
  348. foreach my $cat (sort {uc($a) cmp uc($b)} keys %category) {
  349. print_package_config_category $cat;
  350. }
  351. print_package_overrides();
  352. }
  353. sub get_conditional_dep($$) {
  354. my $condition = shift;
  355. my $depstr = shift;
  356. if ($condition) {
  357. if ($condition =~ /^!(.+)/) {
  358. return "\$(if \$(CONFIG_$1),,$depstr)";
  359. } else {
  360. return "\$(if \$(CONFIG_$condition),$depstr)";
  361. }
  362. } else {
  363. return $depstr;
  364. }
  365. }
  366. sub gen_package_mk() {
  367. my %conf;
  368. my %dep;
  369. my %done;
  370. my $line;
  371. parse_package_metadata($ARGV[0]) or exit 1;
  372. foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
  373. my $config;
  374. my $pkg = $package{$name};
  375. my @srcdeps;
  376. next if defined $pkg->{vdepends};
  377. $config = "\$(CONFIG_PACKAGE_$name)";
  378. if ($config) {
  379. $pkg->{buildonly} and $config = "";
  380. print "package-$config += $pkg->{subdir}$pkg->{src}\n";
  381. if ($pkg->{variant}) {
  382. if (!defined($done{$pkg->{src}}) or $pkg->{variant_default}) {
  383. print "\$(curdir)/$pkg->{subdir}$pkg->{src}/default-variant := $pkg->{variant}\n";
  384. }
  385. print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n"
  386. }
  387. $pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n";
  388. }
  389. next if $done{$pkg->{src}};
  390. $done{$pkg->{src}} = 1;
  391. if (@{$pkg->{buildtypes}} > 0) {
  392. print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$pkg->{buildtypes}})."\n";
  393. }
  394. foreach my $spkg (@{$srcpackage{$pkg->{src}}}) {
  395. foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) {
  396. $dep =~ /@/ or do {
  397. $dep =~ s/\+//g;
  398. push @srcdeps, $dep;
  399. };
  400. }
  401. }
  402. foreach my $type (@{$pkg->{buildtypes}}) {
  403. my @extra_deps;
  404. my %deplines;
  405. next unless $pkg->{"builddepends/$type"};
  406. foreach my $dep (@{$pkg->{"builddepends/$type"}}) {
  407. my $suffix = "";
  408. my $condition;
  409. if ($dep =~ /^(.+):(.+)/) {
  410. $condition = $1;
  411. $dep = $2;
  412. }
  413. if ($dep =~ /^(.+)(\/.+)/) {
  414. $dep = $1;
  415. $suffix = $2;
  416. }
  417. my $idx = "";
  418. my $pkg_dep = $package{$dep};
  419. if (defined($pkg_dep) && defined($pkg_dep->{src})) {
  420. $idx = $pkg_dep->{subdir}.$pkg_dep->{src};
  421. } elsif (defined($srcpackage{$dep})) {
  422. $idx = $subdir{$dep}.$dep;
  423. } else {
  424. next;
  425. }
  426. my $depstr = "\$(curdir)/$idx$suffix/compile";
  427. my $depline = get_conditional_dep($condition, $depstr);
  428. if ($depline) {
  429. $deplines{$depline}++;
  430. }
  431. }
  432. my $depline = join(" ", sort keys %deplines);
  433. if ($depline) {
  434. $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/$type/compile += $depline\n";
  435. }
  436. }
  437. my $hasdeps = 0;
  438. my %deplines;
  439. foreach my $deps (@srcdeps) {
  440. my $idx;
  441. my $condition;
  442. my $prefix = "";
  443. my $suffix = "";
  444. if ($deps =~ /^(.+):(.+)/) {
  445. $condition = $1;
  446. $deps = $2;
  447. }
  448. if ($deps =~ /^(.+)(\/.+)/) {
  449. $deps = $1;
  450. $suffix = $2;
  451. }
  452. my $pkg_dep = $package{$deps};
  453. my @deps;
  454. if ($pkg_dep->{vdepends}) {
  455. @deps = @{$pkg_dep->{vdepends}};
  456. } else {
  457. @deps = ($deps);
  458. }
  459. foreach my $dep (@deps) {
  460. $pkg_dep = $package{$deps};
  461. if (defined $pkg_dep->{src}) {
  462. ($pkg->{src} ne $pkg_dep->{src}.$suffix) and $idx = $pkg_dep->{subdir}.$pkg_dep->{src};
  463. } elsif (defined($srcpackage{$dep})) {
  464. $idx = $subdir{$dep}.$dep;
  465. }
  466. undef $idx if $idx eq 'base-files';
  467. if ($idx) {
  468. $idx .= $suffix;
  469. my $depline;
  470. next if $pkg->{src} eq $pkg_dep->{src}.$suffix;
  471. next if $dep{$condition.":".$pkg->{src}."->".$idx};
  472. next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends};
  473. my $depstr;
  474. if ($pkg_dep->{vdepends}) {
  475. $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)";
  476. $dep{$pkg->{src}."->($dep)".$idx} = 1;
  477. } else {
  478. $depstr = "\$(curdir)/$idx/compile";
  479. $dep{$pkg->{src}."->".$idx} = 1;
  480. }
  481. $depline = get_conditional_dep($condition, $depstr);
  482. if ($depline) {
  483. $deplines{$depline}++;
  484. }
  485. }
  486. }
  487. }
  488. my $depline = join(" ", sort keys %deplines);
  489. if ($depline) {
  490. $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/compile += $depline\n";
  491. }
  492. }
  493. if ($line ne "") {
  494. print "\n$line";
  495. }
  496. foreach my $preconfig (keys %preconfig) {
  497. my $cmds;
  498. foreach my $cfg (keys %{$preconfig{$preconfig}}) {
  499. my $conf = $preconfig{$preconfig}->{$cfg}->{id};
  500. $conf =~ tr/\.-/__/;
  501. $cmds .= "\techo \"uci set '$preconfig{$preconfig}->{$cfg}->{id}=\$(subst \",,\$(CONFIG_UCI_PRECONFIG_$conf))'\"; \\\n";
  502. }
  503. next unless $cmds;
  504. print <<EOF
  505. ifndef DUMP_TARGET_DB
  506. \$(TARGET_DIR)/etc/uci-defaults/$preconfig: FORCE
  507. ( \\
  508. $cmds \\
  509. ) > \$@
  510. ifneq (\$(IMAGEOPT)\$(CONFIG_IMAGEOPT),)
  511. package/preconfig: \$(TARGET_DIR)/etc/uci-defaults/$preconfig
  512. endif
  513. endif
  514. EOF
  515. }
  516. }
  517. sub gen_package_source() {
  518. parse_package_metadata($ARGV[0]) or exit 1;
  519. foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
  520. my $pkg = $package{$name};
  521. if ($pkg->{name} && $pkg->{source}) {
  522. print "$pkg->{name}: ";
  523. print "$pkg->{source}\n";
  524. }
  525. }
  526. }
  527. sub gen_package_subdirs() {
  528. parse_package_metadata($ARGV[0]) or exit 1;
  529. foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
  530. my $pkg = $package{$name};
  531. if ($pkg->{name} && $pkg->{repository}) {
  532. print "Package/$name/subdir = $pkg->{repository}\n";
  533. }
  534. }
  535. }
  536. sub gen_package_license($) {
  537. my $level = shift;
  538. parse_package_metadata($ARGV[0]) or exit 1;
  539. foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
  540. my $pkg = $package{$name};
  541. if ($pkg->{name}) {
  542. if ($pkg->{license}) {
  543. print "$pkg->{name}: ";
  544. print "$pkg->{license}\n";
  545. if ($pkg->{licensefiles} && $level == 0) {
  546. print "\tFiles: $pkg->{licensefiles}\n";
  547. }
  548. } else {
  549. if ($level == 1) {
  550. print "$pkg->{name}: Missing license! ";
  551. print "Please fix $pkg->{makefile}\n";
  552. }
  553. }
  554. }
  555. }
  556. }
  557. sub gen_version_filtered_list() {
  558. foreach my $item (version_filter_list(@ARGV)) {
  559. print "$item\n";
  560. }
  561. }
  562. sub parse_command() {
  563. GetOptions("ignore=s", \@ignore);
  564. my $cmd = shift @ARGV;
  565. for ($cmd) {
  566. /^mk$/ and return gen_package_mk();
  567. /^config$/ and return gen_package_config();
  568. /^kconfig/ and return gen_kconfig_overrides();
  569. /^source$/ and return gen_package_source();
  570. /^subdirs$/ and return gen_package_subdirs();
  571. /^license$/ and return gen_package_license(0);
  572. /^licensefull$/ and return gen_package_license(1);
  573. /^version_filter$/ and return gen_version_filtered_list();
  574. }
  575. die <<EOF
  576. Available Commands:
  577. $0 mk [file] Package metadata in makefile format
  578. $0 config [file] Package metadata in Kconfig format
  579. $0 kconfig [file] [config] [patchver] Kernel config overrides
  580. $0 source [file] Package source file information
  581. $0 subdirs [file] Package subdir information in makefile format
  582. $0 license [file] Package license information
  583. $0 licensefull [file] Package license information (full list)
  584. $0 version_filter [patchver] [list...] Filter list of version tagged strings
  585. Options:
  586. --ignore <name> Ignore the source package <name>
  587. EOF
  588. }
  589. parse_command();