9 sub print_category($) {
12 return unless $category{$cat};
14 print "menu \"$cat\"\n\n";
15 my %spkg = %{$category{$cat}};
16 foreach my $spkg (sort {uc($a) cmp uc($b)} keys %spkg) {
17 foreach my $pkg (@{$spkg{$spkg}}) {
18 my $title = $pkg->{name};
19 my $c = (72 - length($pkg->{name}) - length($pkg->{title}));
21 $title .= ("." x $c). " ". $pkg->{title};
24 $pkg->{menu} and print "menu";
25 print "config PACKAGE_".$pkg->{name}."\n";
26 print "\t\ttristate \"$title\"\n";
27 print "\t\tdefault ".$pkg->{default}."\n";
28 foreach my $depend (@{$pkg->{depends}}) {
29 print "\t\tdepends PACKAGE_$depend\n";
36 undef $category{$cat};
42 $line =~ /^Source-Makefile: \s*(.+\/([^\/]+)\/Makefile)\s*$/ and do {
47 $line =~ /^Package: \s*(.+)\s*$/ and do {
50 $pkg->{makefile} = $makefile;
52 $pkg->{default} = "m if ALL";
54 $line =~ /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1;
55 $line =~ /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1;
56 $line =~ /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1;
57 $line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
58 $line =~ /^Depends: \s*(.+)\s*$/ and do {
59 my @dep = split /,\s*/, $1;
60 $pkg->{depends} = \@dep;
62 $line =~ /^Category: \s*(.+)\s*$/ and do {
63 $pkg->{category} = $1;
64 defined $category{$1} or $category{$1} = {};
65 defined $category{$1}->{$src} or $category{$1}->{$src} = [];
66 push @{$category{$1}->{$src}}, $pkg;
68 $line =~ /^Description: \s*(.*)\s*$/ and do {
75 $pkg->{description} = $desc;
79 print_category 'Base system';
80 foreach my $cat (keys %category) {