Compare commits
No commits in common. "555ead272e19a9c4f7d643c30fc7339b9637f21f" and "347b49d5ee05fc0863faab39a3247dfdcd4bf4ef" have entirely different histories.
555ead272e
...
347b49d5ee
31
pacundo.pl
31
pacundo.pl
@ -169,8 +169,7 @@ sub get_pkgmgr() {
|
||||
my %pkgmgr = (
|
||||
name => $mgr,
|
||||
bin => $mgr_bin,
|
||||
search => "$mgr_bin -Ss",
|
||||
info => "$mgr_bin -Si",
|
||||
search => "$sudo $mgr_bin -Ss",
|
||||
install_remote => "$sudo $mgr_bin -S",
|
||||
install_local => "$sudo $mgr_bin -U",
|
||||
remove => "$sudo $mgr_bin -R",
|
||||
@ -181,31 +180,23 @@ sub get_pkgmgr() {
|
||||
|
||||
sub find_local_pkg($pkgmgr, $pkg_name, $pkg_ver='') {
|
||||
my $pkg_file = '';
|
||||
my $pkg_pat;
|
||||
my $repo = `$pkgmgr->{info} $pkg_name | awk '{ if (\$1 == "Repository") print \$3; }'`;;
|
||||
my $aur_dir = "$ENV{'XDG_CACHE_HOME'}/yay/$pkg_name";
|
||||
|
||||
if ($pkg_ver ne '') {
|
||||
$pkg_pat = "$pkg_name-$pkg_ver-*.pkg.tar.zst";
|
||||
} else {
|
||||
$pkg_pat = "$pkg_name-*.pkg.tar.zst";
|
||||
}
|
||||
|
||||
if ($repo eq 'aur') {
|
||||
my $aur_dir;
|
||||
|
||||
if ($pkgmgr->{name} eq 'yay') {
|
||||
$aur_dir = "$ENV{'XDG_CACHE_HOME'}/yay/$pkg_name";
|
||||
if ($pkgmgr->{name} eq 'yay' && -d $aur_dir) {
|
||||
if ($pkg_ver ne '') {
|
||||
$pkg_file = `ls $aur_dir/$pkg_name-$pkg_ver-*.pkg.tar.zst | tail -n1`;
|
||||
} else {
|
||||
return '';
|
||||
$pkg_file = `ls $aur_dir/$pkg_name-*.pkg.tar.zst | tail -n1`;
|
||||
}
|
||||
|
||||
$pkg_file = `ls $aur_dir/$pkg_pat | tail -n1`;
|
||||
} else {
|
||||
$pkg_file = `ls /var/cache/pacman/pkg/$pkg_pat | tail -n1`;
|
||||
if ($pkg_ver ne '') {
|
||||
$pkg_file = `ls /var/cache/pacman/pkg/$pkg_name-$pkg_ver-*.pkg.tar.zst | tail -n1`;
|
||||
} else {
|
||||
$pkg_file = `ls /var/cache/pacman/pkg/$pkg_name-*.pkg.tar.zst | tail -n1`;
|
||||
}
|
||||
}
|
||||
|
||||
chomp($pkg_file);
|
||||
|
||||
return $pkg_file;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user