mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 17:17:22 +01:00
Fix -G for non split packages and support multilib
A while ago the url to download a pkgbuild was using pkg.Name(), it was latter changed to pkg.Base() to support split packages. It seems that pkg.Base() does not work for non split packages for some reason. So instead try pkg.Base() and if it is empty default to pkg.Name(). Also add support for downloading from multilib
This commit is contained in:
parent
1232854fd4
commit
b58746d1ef
12
download.go
12
download.go
@ -91,12 +91,18 @@ nextPkg:
|
|||||||
pkg, err := db.PkgByName(pkgN)
|
pkg, err := db.PkgByName(pkgN)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
var url string
|
var url string
|
||||||
|
name := pkg.Base()
|
||||||
|
if name == "" {
|
||||||
|
name = pkg.Name()
|
||||||
|
}
|
||||||
|
|
||||||
if db.Name() == "core" || db.Name() == "extra" {
|
if db.Name() == "core" || db.Name() == "extra" {
|
||||||
url = "https://projects.archlinux.org/svntogit/packages.git/snapshot/packages/" + pkg.Base() + ".tar.gz"
|
url = "https://projects.archlinux.org/svntogit/packages.git/snapshot/packages/" + name + ".tar.gz"
|
||||||
} else if db.Name() == "community" {
|
} else if db.Name() == "community" || db.Name() == "multilib" {
|
||||||
url = "https://projects.archlinux.org/svntogit/community.git/snapshot/community-packages/" + pkg.Base() + ".tar.gz"
|
url = "https://projects.archlinux.org/svntogit/community.git/snapshot/community-packages/" + name + ".tar.gz"
|
||||||
} else {
|
} else {
|
||||||
fmt.Println(pkgN + " not in standard repositories")
|
fmt.Println(pkgN + " not in standard repositories")
|
||||||
|
continue nextPkg
|
||||||
}
|
}
|
||||||
|
|
||||||
errD := downloadAndUnpack(url, path, true)
|
errD := downloadAndUnpack(url, path, true)
|
||||||
|
Loading…
Reference in New Issue
Block a user