c0279d54520277c098cf2b4d5823422e801f68e1
3 # Copyright (C) 2006 OpenWrt.org
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
21 $cur_menu_dep and do {
23 $cur_menu_dep = undef;
29 sub print_category
($) {
32 return unless $category{$cat};
34 print "menu \"$cat\"\n\n";
35 my %spkg = %{$category{$cat}};
36 foreach my $spkg (sort {uc($a) cmp uc($b)} keys %spkg) {
38 $a->{submenu
}."->".$a->{name
} cmp $b->{submenu
}."->".$b->{name
}
40 foreach my $pkg (@pkgs) {
41 if ($cur_menu ne $pkg->{submenu
}) {
43 if ($pkg->{submenu
}) {
44 $cur_menu = $pkg->{submenu
};
45 $cur_menu_dep = $pkg->{submenudep
} and print "if $cur_menu_dep\n";
46 print "menu \"$cur_menu\"\n";
49 my $title = $pkg->{name
};
50 my $c = (72 - length($pkg->{name
}) - length($pkg->{title
}));
52 $title .= ("." x
$c). " ". $pkg->{title
};
55 $pkg->{menu
} and print "menu";
56 print "config PACKAGE_".$pkg->{name
}."\n";
57 print "\t\ttristate \"$title\"\n";
58 foreach my $default (split /\s*,\s*/, $pkg->{default}) {
59 print "\t\tdefault $default\n";
61 foreach my $depend (@
{$pkg->{depends
}}) {
63 $depend =~ s/^([@\+]+)//;
65 $flags =~ /@/ or $depend = "PACKAGE_$depend";
66 $flags =~ /\+/ and $m = "select";
67 print "\t\t$m $depend\n";
70 print $pkg->{description
};
73 $pkg->{config
} and print $pkg->{config
}."\n";
79 undef $category{$cat};
85 $line =~ /^Source-Makefile: \s*(.+\/([^\
/]+)\/Makefile
)\s
*$/ and do {
90 $line =~ /^Package: \s*(.+)\s*$/ and do {
93 $pkg->{makefile
} = $makefile;
95 $pkg->{default} = "m if ALL";
97 $line =~ /^Version: \s*(.+)\s*$/ and $pkg->{version
} = $1;
98 $line =~ /^Title: \s*(.+)\s*$/ and $pkg->{title
} = $1;
99 $line =~ /^Menu: \s*(.+)\s*$/ and $pkg->{menu
} = $1;
100 $line =~ /^Submenu: \s*(.+)\s*$/ and $pkg->{submenu
} = $1;
101 $line =~ /^Submenu-Depends: \s*(.+)\s*$/ and $pkg->{submenudep
} = $1;
102 $line =~ /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
103 $line =~ /^Depends: \s*(.+)\s*$/ and do {
104 my @dep = split /\s+/, $1;
105 $pkg->{depends
} = \
@dep;
107 $line =~ /^Category: \s*(.+)\s*$/ and do {
108 $pkg->{category
} = $1;
109 defined $category{$1} or $category{$1} = {};
110 defined $category{$1}->{$src} or $category{$1}->{$src} = [];
111 push @
{$category{$1}->{$src}}, $pkg;
113 $line =~ /^Description: \s*(.*)\s*$/ and do {
114 my $desc = "\t\t$1\n\n";
117 last if $line =~ /^@@/;
118 $desc .= "\t\t$line";
120 $pkg->{description
} = $desc;
122 $line =~ /^Config: \s*(.*)\s*$/ and do {
126 last if $line =~ /^@@/;
129 $pkg->{config
} = $conf;
133 print_category
'Base system';
134 foreach my $cat (keys %category) {
This page took 0.047838 seconds and 3 git commands to generate.