3 # Copyright 2014 Thadeu Lima de Souza Cascardo <cascardo@cascardo.info>
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 open(PACKAGES, "<Packages");
23 open(SOURCES, "<Sources");
31 my ($package, $depends) = @_;
33 my @vdeps = split(",", $depends);
35 $i =~ qr,([0-9a-z-+.]+),;
38 $depends{$package} = $deps;
43 if (/^Package: ([0-9a-z-+.]+)/) {
45 push @packages, $package;
47 if (/^Depends: (.*)/) {
48 add_depends($package, $1);
50 if (/^Priority: (.*)/) {
51 $priority{$package} = $1;
53 if (/^Essential: yes/) {
54 $essential{$package} = "yes";
65 for my $i (keys %essential) {
68 push @visit, "build-essential";
72 next if grep /^$n$/, @pp;
76 if (!grep /^$d$/, @pp && !grep /^$d$/, @visit) {