From 06974ebf2f6674baf01da79be9658277cbf2650e Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 27 Jul 2011 12:44:17 -0500 Subject: 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 --- contrib/pacsearch.in | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib') diff --git a/contrib/pacsearch.in b/contrib/pacsearch.in index dd848a73..db9d6ad1 100755 --- a/contrib/pacsearch.in +++ b/contrib/pacsearch.in @@ -111,6 +111,8 @@ if ($#querypkgs >= 0) { foreach $_ (@querypkgs) { # we grab 4 fields here: repo, name/ver, installed, and desc 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 $pkgfields[2] = "" if not defined $pkgfields[2]; # check if the package was listed in the sync out -- cgit v1.2.3-70-g09d2