pacsearch: indexing by 'name version' instead of 'name'
In the old pacsearch, packages were identified uniquely by pkgfields[1], which contained pkgname+pkgver. Since commit 4d13558 pkgver is stored in pkgfields[2], and packages have been identified with pkgfields[1] only. Because of that packages with a different version would appear once only. This fixes the regression by identifying packages with both pkgfields[1] and pkgfields[2]. Signed-off-by: Pierre Neidhardt <ambrevar@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
08cddb4b4b
commit
fe961e6590
|
@ -124,7 +124,7 @@ foreach $_ (@syncpkgs) {
|
||||||
# add a last field that indicates original order
|
# add a last field that indicates original order
|
||||||
push (@pkgfields, $cnt++);
|
push (@pkgfields, $cnt++);
|
||||||
# add each sync pkg by name/ver to a hash table for quick lookup
|
# add each sync pkg by name/ver to a hash table for quick lookup
|
||||||
$allpkgs{$pkgfields[1]} = [ @pkgfields ];
|
$allpkgs{$pkgfields[1] . $pkgfields[2]} = [ @pkgfields ];
|
||||||
}
|
}
|
||||||
|
|
||||||
my $queryout = `pacman -Qs '@ARGV'`;
|
my $queryout = `pacman -Qs '@ARGV'`;
|
||||||
|
@ -141,14 +141,14 @@ foreach $_ (@querypkgs) {
|
||||||
# skip any non-matching line
|
# skip any non-matching line
|
||||||
next if not defined $pkgfields[1];
|
next if not defined $pkgfields[1];
|
||||||
# check if the package was listed in the sync out
|
# check if the package was listed in the sync out
|
||||||
if (not exists $allpkgs{$pkgfields[1]}) {
|
if (not exists $allpkgs{$pkgfields[1] . $pkgfields[2]}) {
|
||||||
# since 'group' is optional, we should fill it in if necessary
|
# since 'group' is optional, we should fill it in if necessary
|
||||||
$pkgfields[3] = "" if not defined $pkgfields[3];
|
$pkgfields[3] = "" if not defined $pkgfields[3];
|
||||||
$pkgfields[4] = "[$LC_INSTALLED]";
|
$pkgfields[4] = "[$LC_INSTALLED]";
|
||||||
# add a last field that indicates original order (after sync)
|
# add a last field that indicates original order (after sync)
|
||||||
push (@pkgfields, $cnt++);
|
push (@pkgfields, $cnt++);
|
||||||
# add our local-only package to the hash
|
# add our local-only package to the hash
|
||||||
$allpkgs{$pkgfields[1]} = [ @pkgfields ];
|
$allpkgs{$pkgfields[1] . $pkgfields[2]} = [ @pkgfields ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue