a7f939ff52d38e0cf13b7d8f4f6895bb956b39ea
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
}}) {
30 $depend =~ s/^([@\+])//;
32 $flags =~ /@/ or $depend = "PACKAGE_$depend";
33 $flags =~ /\+/ and $m = "select";
34 print "\t\t$m $depend\n";
37 print $pkg->{description
};
40 $pkg->{config
} and print $pkg->{config
}."\n";
45 undef $category{$cat};
51 $line =~ /^Source-Makefile: \s*(.+\/([^\
/]+)\/Makefile
)\s
*$/ and do {
56 $line =~ /^Package: \s*(.+)\s*$/ and do {
59 $pkg->{makefile
} = $makefile;
61 $pkg->{default} = "m if ALL";
63 $line =~ /^Version: \s*(.+)\s*$/ and $pkg->{version
} = $1;
64 $line =~ /^Title: \s*(.+)\s*$/ and $pkg->{title
} = $1;
65 $line =~ /^Menu: \s*(.+)\s*$/ and $pkg->{menu
} = $1;
66 $line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
67 $line =~ /^Depends: \s*(.+)\s*$/ and do {
68 my @dep = split /\s+/, $1;
69 $pkg->{depends
} = \
@dep;
71 $line =~ /^Category: \s*(.+)\s*$/ and do {
72 $pkg->{category
} = $1;
73 defined $category{$1} or $category{$1} = {};
74 defined $category{$1}->{$src} or $category{$1}->{$src} = [];
75 push @
{$category{$1}->{$src}}, $pkg;
77 $line =~ /^Description: \s*(.*)\s*$/ and do {
78 my $desc = "\t\t$1\n\n";
81 last if $line =~ /^@@/;
84 $pkg->{description
} = $desc;
86 $line =~ /^Config: \s*(.*)\s*$/ and do {
90 last if $line =~ /^@@/;
93 $pkg->{config
} = $conf;
97 print_category
'Base system';
98 foreach my $cat (keys %category) {