contrib/pacsearch: skip non-matching lines
This prevents some perl errors from popping up when pacman prints error or warning messages. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
98073afe55
commit
06974ebf2f
@ -111,6 +111,8 @@ if ($#querypkgs >= 0) {
|
|||||||
foreach $_ (@querypkgs) {
|
foreach $_ (@querypkgs) {
|
||||||
# we grab 4 fields here: repo, name/ver, installed, and desc
|
# we grab 4 fields here: repo, name/ver, installed, and desc
|
||||||
my @pkgfields = /^(.*?)\/(.*?) ?(\[.*\])?\n(.*)$/s;
|
my @pkgfields = /^(.*?)\/(.*?) ?(\[.*\])?\n(.*)$/s;
|
||||||
|
# skip any non-matching line
|
||||||
|
next if not defined $pkgfields[1];
|
||||||
# since installed is optional, we should fill it in if necessary
|
# since installed is optional, we should fill it in if necessary
|
||||||
$pkgfields[2] = "" if not defined $pkgfields[2];
|
$pkgfields[2] = "" if not defined $pkgfields[2];
|
||||||
# check if the package was listed in the sync out
|
# check if the package was listed in the sync out
|
||||||
|
Loading…
Reference in New Issue
Block a user