mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 09:07:21 +01:00
Split pkgbuild downloading and merging
This commit is contained in:
parent
73bd713217
commit
43d2a6601a
25
install.go
25
install.go
@ -166,6 +166,11 @@ func install(parser *arguments) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = mergePkgBuilds(do.Aur)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(toEdit) > 0 {
|
||||
if config.ShowDiffs {
|
||||
err = showPkgBuildDiffs(toEdit, do.Bases, oldHashes)
|
||||
@ -639,6 +644,20 @@ func getHashes(pkgs []*rpc.Pkg) (map[string]string, error) {
|
||||
return hashes, nil
|
||||
}
|
||||
|
||||
func mergePkgBuilds(pkgs []*rpc.Pkg) error {
|
||||
for _, pkg := range pkgs {
|
||||
if shouldUseGit(filepath.Join(config.BuildDir, pkg.PackageBase)) {
|
||||
err := gitMerge(baseURL + "/" + pkg.PackageBase + ".git", config.BuildDir, pkg.PackageBase)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
func downloadPkgBuilds(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg, toSkip stringSet) error {
|
||||
for k, pkg := range pkgs {
|
||||
if toSkip.get(pkg.PackageBase) {
|
||||
@ -656,12 +675,6 @@ func downloadPkgBuilds(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg, toSkip stri
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = gitMerge(baseURL + "/" + pkg.PackageBase + ".git", config.BuildDir, pkg.PackageBase)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
} else {
|
||||
err := downloadAndUnpack(baseURL+pkg.URLPath, config.BuildDir)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user