diff options
-rwxr-xr-x | contrib/pacsearch.in | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/pacsearch.in b/contrib/pacsearch.in index a20df265..dd848a73 100755 --- a/contrib/pacsearch.in +++ b/contrib/pacsearch.in @@ -1,10 +1,10 @@ #!/usr/bin/perl # pacsearch - Adds color and install information to a 'pacman -Ss' search # -# Copyright (C) 2008, 2010 Dan McGee <dpmcgee@gmail.com> +# Copyright (C) 2008-2011 Dan McGee <dan@archlinux.org> # # Based off original shell script version: -# Copyright (C) 2006-2007 Dan McGee <dpmcgee@gmail.com> +# Copyright (C) 2006-2007 Dan McGee <dan@archlinux.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -39,7 +39,7 @@ if ($#ARGV lt 0 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") { if ($ARGV[0] eq "--version" || $ARGV[0] eq "-v") { print "$progname version $version\n"; - print "Copyright (C) 2006-2010 Dan McGee\n"; + print "Copyright (C) 2006-2011 Dan McGee\n"; exit 0; } @@ -65,6 +65,7 @@ sub to_color { $line =~ s/(^community\/.*)/$CLR3$1$BASE/; $line =~ s/(^testing\/.*)/$CLR4$1$BASE/; $line =~ s/(^community-testing\/.*)/$CLR5$1$BASE/; + $line =~ s/(^multilib\/.*)/$CLR6$1$BASE/; $line =~ s/(^local\/.*)/$CLR7$1$BASE/; # any other unknown repository $line =~ s/(^[\w-]*\/.*)/$CLR6$1$BASE/; @@ -86,6 +87,11 @@ my $cnt = 0; foreach $_ (@syncpkgs) { # we grab 4 fields here: repo, name/ver, installed, and desc my @pkgfields = /^(.*?)\/(.*?) ?(\[.*\])?\n(.*)$/s; + if(not @pkgfields) { + # skip any non-matching line and just print it for the user + print $_, "\n"; + next; + } # since installed is optional, we should fill it in if necessary $pkgfields[2] = "" if not defined $pkgfields[2]; # add a fifth field that indicates original order |