mirror of
https://github.com/Jguer/yay.git
synced 2025-11-27 00:06:25 -05:00
Split pkgbuild downloading and up to date checks
This commit is contained in:
parent
5775e3c0b7
commit
1b8d9317e4
12
install.go
12
install.go
@ -155,7 +155,8 @@ func install(parser *arguments) error {
|
||||
|
||||
cleanBuilds(toClean)
|
||||
|
||||
oldHashes, err := downloadPkgBuilds(do.Aur, targets, do.Bases)
|
||||
toSkip := pkgBuildsToSkip(do.Aur, targets)
|
||||
oldHashes, err := downloadPkgBuilds(do.Aur, do.Bases, toSkip)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -593,9 +594,8 @@ func tryParsesrcinfosFile(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD,
|
||||
}
|
||||
}
|
||||
|
||||
func downloadPkgBuilds(pkgs []*rpc.Pkg, targets stringSet, bases map[string][]*rpc.Pkg) (map[string]string, error) {
|
||||
func pkgBuildsToSkip(pkgs []*rpc.Pkg, targets stringSet) stringSet {
|
||||
toSkip := make(stringSet)
|
||||
hashes := make(map[string]string)
|
||||
|
||||
for _, pkg := range pkgs {
|
||||
if config.ReDownload == "no" || (config.ReDownload == "yes" && !targets.get(pkg.Name)) {
|
||||
@ -614,6 +614,12 @@ func downloadPkgBuilds(pkgs []*rpc.Pkg, targets stringSet, bases map[string][]*r
|
||||
}
|
||||
}
|
||||
|
||||
return toSkip
|
||||
}
|
||||
|
||||
func downloadPkgBuilds(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg, toSkip stringSet) (map[string]string, error) {
|
||||
hashes := make(map[string]string)
|
||||
|
||||
for k, pkg := range pkgs {
|
||||
if shouldUseGit(filepath.Join(config.BuildDir, pkg.PackageBase)) {
|
||||
hash, err := gitGetHash(config.BuildDir, pkg.PackageBase)
|
||||
|
||||
3
vcs.go
3
vcs.go
@ -43,7 +43,8 @@ func createDevelDB() error {
|
||||
|
||||
bases := getBases(infoMap)
|
||||
|
||||
downloadPkgBuilds(info, sliceToStringSet(remoteNames), bases)
|
||||
toSkip := pkgBuildsToSkip(info, sliceToStringSet(remoteNames))
|
||||
downloadPkgBuilds(info, bases, toSkip)
|
||||
tryParsesrcinfosFile(info, srcinfosStale, bases)
|
||||
|
||||
for _, pkg := range info {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user