Codebase list debian-goodies / 8956a37
Do not get field names from grep-aptavail Avoids needing to parse the output. Paul Wise 6 years ago
1 changed file(s) with 2 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
129129
130130 my $output;
131131 eval {
132 $output = capturex(qw(grep-aptavail --show-field Package --field Build-IDs --pattern), $id);
132 $output = capturex(qw(grep-aptavail --no-field-names --show-field Package --field Build-IDs --pattern), $id);
133133 };
134134 if ($@) {
135135 return;
136136 }
137137
138 my %pkgs;
139 foreach my $line (split(/\n/, $output)) {
140 chomp $line;
141 if ($line =~ /^Package:\s*(\S+)$/) {
142 $pkgs{$1} = 1;
143 } else {
144 warn "Cannot parse grep-aptavail output: '$line'\n";
145 }
146 }
138 my %pkgs = map { $_ => 1 } split(/\n/, $output);
147139 return sort keys %pkgs;
148140 }
149141