1 Star 0 Fork 0

mayeror/yay

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vcs.go 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
jguer 提交于 2020-08-22 00:39 . feat(vcs): refactor and test cover
package main
import (
"sync"
"github.com/leonelquinteros/gotext"
"github.com/Jguer/yay/v10/pkg/db"
"github.com/Jguer/yay/v10/pkg/dep"
"github.com/Jguer/yay/v10/pkg/query"
"github.com/Jguer/yay/v10/pkg/settings"
"github.com/Jguer/yay/v10/pkg/stringset"
"github.com/Jguer/yay/v10/pkg/text"
)
// createDevelDB forces yay to create a DB of the existing development packages
func createDevelDB(config *settings.Configuration, dbExecutor db.Executor) error {
var mux sync.Mutex
var wg sync.WaitGroup
_, remoteNames, err := query.GetPackageNamesBySource(dbExecutor)
if err != nil {
return err
}
info, err := query.AURInfoPrint(remoteNames, config.RequestSplitN)
if err != nil {
return err
}
bases := dep.GetBases(info)
toSkip := pkgbuildsToSkip(bases, stringset.FromSlice(remoteNames))
_, err = downloadPkgbuilds(bases, toSkip, config.BuildDir)
if err != nil {
return err
}
srcinfos, err := parseSrcinfoFiles(bases, false)
if err != nil {
return err
}
for i := range srcinfos {
for iP := range srcinfos[i].Packages {
wg.Add(1)
go config.Runtime.VCSStore.Update(srcinfos[i].Packages[iP].Pkgname, srcinfos[i].Source, &mux, &wg)
}
}
wg.Wait()
text.OperationInfoln(gotext.Get("GenDB finished. No packages were installed"))
return err
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mayeror/yay.git
git@gitee.com:mayeror/yay.git
mayeror
yay
yay
FuRuYa7-develop

搜索帮助