f90446298af1841f741ed14caeacaa0078b45ded
5 our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig clear_packages parse_package_metadata get_multiline);
20 $str .= (($_ and $prefix) ? $prefix . $_ : $_);
23 return $str ? $str : "";
26 sub clear_packages() {
34 sub parse_package_metadata($) {
42 open FILE, "<$file" or do {
43 warn "Cannot open '$file': $!\n";
48 /^Source-Makefile: \s*((.+\/)([^\/]+)\/Makefile)\s*$/ and do {
52 $subdir =~ s/^package\///;
53 $subdir{$src} = $subdir;
54 $srcpackage{$src} = [];
57 /^Package:\s*(.+?)\s*$/ and do {
60 $pkg->{makefile} = $makefile;
62 $pkg->{default} = "m if ALL";
64 $pkg->{builddepends} = [];
65 $pkg->{subdir} = $subdir;
67 push @{$srcpackage{$src}}, $pkg;
69 /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1;
70 /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1;
71 /^Menu: \s*(.+)\s*$/ and $pkg->{menu} = $1;
72 /^Submenu: \s*(.+)\s*$/ and $pkg->{submenu} = $1;
73 /^Submenu-Depends: \s*(.+)\s*$/ and $pkg->{submenudep} = $1;
74 /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
75 /^Provides: \s*(.+)\s*$/ and do {
76 my @vpkg = split /\s+/, $1;
77 foreach my $vpkg (@vpkg) {
78 $package{$vpkg} or $package{$vpkg} = { vdepends => [] };
79 push @{$package{$vpkg}->{vdepends}}, $pkg->{name};
82 /^Depends: \s*(.+)\s*$/ and $pkg->{depends} = [ split /\s+/, $1 ];
83 /^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ];
84 /^Category: \s*(.+)\s*$/ and do {
85 $pkg->{category} = $1;
86 defined $category{$1} or $category{$1} = {};
87 defined $category{$1}->{$src} or $category{$1}->{$src} = [];
88 push @{$category{$1}->{$src}}, $pkg;
90 /^Description: \s*(.*)\s*$/ and $pkg->{description} = "\t\t $1\n". get_multiline(*FILE, "\t\t ");
91 /^Config: \s*(.*)\s*$/ and $pkg->{config} = "$1\n".get_multiline(*FILE);
92 /^Prereq-Check:/ and $pkg->{prereq} = 1;
93 /^Preconfig:\s*(.+)\s*$/ and do {
94 my $pkgname = $pkg->{name};
95 $preconfig{$pkgname} or $preconfig{$pkgname} = {};
96 if (exists $preconfig{$pkgname}->{$1}) {
97 $preconfig = $preconfig{$pkgname}->{$1};
102 $preconfig{$pkgname}->{$1} = $preconfig;
105 /^Preconfig-Type:\s*(.*?)\s*$/ and $preconfig->{type} = $1;
106 /^Preconfig-Label:\s*(.*?)\s*$/ and $preconfig->{label} = $1;
107 /^Preconfig-Default:\s*(.*?)\s*$/ and $preconfig->{default} = $1;
This page took 0.047107 seconds and 3 git commands to generate.