mirror of
https://github.com/Jguer/yay
synced 2024-10-31 04:12:51 +00:00
Give error when failing to parse .SRCINFO
Instead of panicking later on.
This commit is contained in:
parent
0f3ccbce93
commit
4350752e32
1 changed files with 11 additions and 10 deletions
21
install.go
21
install.go
|
@ -280,7 +280,6 @@ func askEditPkgBuilds(pkgs []*rpc.Pkg, bases map[string][]*rpc.Pkg) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func parsesrcinfos(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD) error {
|
func parsesrcinfos(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD) error {
|
||||||
|
|
||||||
for _, pkg := range pkgs {
|
for _, pkg := range pkgs {
|
||||||
dir := config.BuildDir + pkg.PackageBase + "/"
|
dir := config.BuildDir + pkg.PackageBase + "/"
|
||||||
|
|
||||||
|
@ -294,16 +293,18 @@ func parsesrcinfos(pkgs []*rpc.Pkg, srcinfos map[string]*gopkg.PKGBUILD) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgbuild, err := gopkg.ParseSRCINFOContent(srcinfo)
|
pkgbuild, err := gopkg.ParseSRCINFOContent(srcinfo)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
srcinfos[pkg.PackageBase] = pkgbuild
|
return fmt.Errorf("%s: %s", pkg.Name, err)
|
||||||
|
}
|
||||||
|
|
||||||
for _, pkgsource := range pkgbuild.Source {
|
srcinfos[pkg.PackageBase] = pkgbuild
|
||||||
owner, repo := parseSource(pkgsource)
|
|
||||||
if owner != "" && repo != "" {
|
for _, pkgsource := range pkgbuild.Source {
|
||||||
err = branchInfo(pkg.Name, owner, repo)
|
owner, repo := parseSource(pkgsource)
|
||||||
if err != nil {
|
if owner != "" && repo != "" {
|
||||||
return err
|
err = branchInfo(pkg.Name, owner, repo)
|
||||||
}
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue