@@ -10,7 +10,7 @@ use std::process::{Command, Stdio};
10
10
use std:: result:: Result as StdResult ;
11
11
12
12
use alpm:: Version ;
13
- use alpm_utils:: { AsTarg , DbListExt , Targ } ;
13
+ use alpm_utils:: { AsTarg , DbListExt } ;
14
14
use ansi_term:: Style ;
15
15
use anyhow:: { bail, ensure, Context , Result } ;
16
16
use aur_depends:: AurBase ;
@@ -184,11 +184,10 @@ pub async fn getpkgbuilds(config: &mut Config) -> Result<i32> {
184
184
let mut ret = 0 ;
185
185
186
186
if !repo. is_empty ( ) {
187
- ret = repo_pkgbuilds ( config, & repo) ?;
187
+ ret = repo_pkgbuilds ( config, & repo[ .. ] ) ?;
188
188
}
189
189
190
190
if !aur. is_empty ( ) {
191
- let aur = aur. iter ( ) . map ( |t| t. pkg ) . collect :: < Vec < _ > > ( ) ;
192
191
let action = config. color . action ;
193
192
let bold = config. color . bold ;
194
193
println ! (
@@ -220,11 +219,11 @@ pub async fn getpkgbuilds(config: &mut Config) -> Result<i32> {
220
219
Ok ( ret)
221
220
}
222
221
223
- fn repo_pkgbuilds ( config : & Config , pkgs : & [ Targ < ' _ > ] ) -> Result < i32 > {
222
+ fn repo_pkgbuilds ( config : & Config , pkgs : & [ String ] ) -> Result < i32 > {
224
223
let pkgctl = & config. pkgctl_bin ;
225
224
226
225
for ( n, targ) in pkgs. iter ( ) . enumerate ( ) {
227
- print_download ( config, n + 1 , pkgs. len ( ) , targ. pkg ) ;
226
+ print_download ( config, n + 1 , pkgs. len ( ) , targ) ;
228
227
229
228
let ret = Command :: new ( pkgctl)
230
229
. arg ( "repo" )
@@ -447,17 +446,17 @@ pub async fn show_comments(config: &mut Config) -> Result<i32> {
447
446
fn split_repo_aur_pkgbuilds < ' a , T : AsTarg > (
448
447
config : & Config ,
449
448
targets : & ' a [ T ] ,
450
- ) -> ( Vec < Targ < ' a > > , Vec < Targ < ' a > > ) {
449
+ ) -> ( Vec < String > , Vec < String > ) {
451
450
let mut local = Vec :: new ( ) ;
452
451
let mut aur = Vec :: new ( ) ;
453
452
let db = config. alpm . syncdbs ( ) ;
454
453
455
454
for targ in targets {
456
455
let targ = targ. as_targ ( ) ;
457
456
if !config. mode . repo ( ) {
458
- aur. push ( targ) ;
457
+ aur. push ( targ. pkg . to_string ( ) ) ;
459
458
} else if !config. mode . aur ( ) && !config. mode . pkgbuild ( ) {
460
- local. push ( targ) ;
459
+ local. push ( targ. pkg . to_string ( ) ) ;
461
460
} else if let Some ( repo) = targ. repo {
462
461
if matches ! (
463
462
repo,
@@ -471,9 +470,9 @@ fn split_repo_aur_pkgbuilds<'a, T: AsTarg>(
471
470
| "extra-testing"
472
471
| "multilib-testing"
473
472
) {
474
- local. push ( targ) ;
473
+ local. push ( targ. pkg . to_string ( ) ) ;
475
474
} else {
476
- aur. push ( targ) ;
475
+ aur. push ( targ. pkg . to_string ( ) ) ;
477
476
}
478
477
} else if let Ok ( pkg) = db. pkg ( targ. pkg ) {
479
478
if matches ! (
@@ -488,12 +487,20 @@ fn split_repo_aur_pkgbuilds<'a, T: AsTarg>(
488
487
| "extra-testing"
489
488
| "multilib-testing"
490
489
) {
491
- local. push ( targ) ;
490
+ if let Some ( base) = pkg. base ( ) {
491
+ if base != pkg. name ( ) {
492
+ local. push ( base. to_string ( ) )
493
+ } else {
494
+ local. push ( targ. pkg . to_string ( ) ) ;
495
+ }
496
+ } else {
497
+ local. push ( targ. pkg . to_string ( ) ) ;
498
+ }
492
499
} else {
493
- aur. push ( targ) ;
500
+ aur. push ( targ. pkg . to_string ( ) ) ;
494
501
}
495
502
} else {
496
- aur. push ( targ) ;
503
+ aur. push ( targ. pkg . to_string ( ) ) ;
497
504
}
498
505
}
499
506
@@ -512,7 +519,7 @@ pub async fn show_pkgbuilds(config: &mut Config) -> Result<i32> {
512
519
for pkg in & repo {
513
520
let url = Url :: parse ( & format ! (
514
521
"https://gitlab.archlinux.org/archlinux/packaging/packages/{}/-/raw/HEAD/PKGBUILD" ,
515
- pkg. pkg
522
+ pkg
516
523
) ) ?;
517
524
518
525
let response = client
@@ -535,8 +542,6 @@ pub async fn show_pkgbuilds(config: &mut Config) -> Result<i32> {
535
542
}
536
543
537
544
if !aur. is_empty ( ) {
538
- let aur = aur. iter ( ) . map ( |t| t. pkg ) . collect :: < Vec < _ > > ( ) ;
539
-
540
545
let warnings = cache_info_with_warnings (
541
546
& config. raur ,
542
547
& mut config. cache ,
0 commit comments