Split .SRCINFO parsing to its own function

This commit is contained in:
morganamilo 2018-02-15 06:17:27 +00:00
parent ad898b2d33
commit 83491069d3
No known key found for this signature in database
GPG key ID: 6FE9E7996B0B082E

View file

@ -110,6 +110,15 @@ func install(parser *arguments) error {
return err
}
err = parseSRCINFOs(dc.AurMake)
if err != nil {
return err
}
err = parseSRCINFOs(dc.Aur)
if err != nil {
return err
}
if _, ok := arguments.options["gendb"]; ok {
fmt.Println("GenDB finished. No packages were installed")
return nil
@ -270,8 +279,15 @@ func askEditPkgBuilds(pkgs []*rpc.Pkg) (error) {
if err != nil {
return err
}
}
}
}
return nil
}
func parseSRCINFOs(pkgs []*rpc.Pkg) error {
for _, pkg := range pkgs {
dir := config.BuildDir + pkg.PackageBase + "/"
pkgbuild, err := gopkg.ParseSRCINFO(dir + ".SRCINFO")
if err == nil {
@ -280,12 +296,11 @@ func askEditPkgBuilds(pkgs []*rpc.Pkg) (error) {
if owner != "" && repo != "" {
err = branchInfo(pkg.Name, owner, repo)
if err != nil {
fmt.Println(err)
return err
}
}
}
}
}
return nil