1
0
forked from ALHP/ALHP.GO

combined error cases and added more

This commit is contained in:
2021-12-20 00:44:32 +01:00
parent c2dd455892
commit 70d901b113
2 changed files with 11 additions and 21 deletions

15
main.go
View File

@@ -168,19 +168,8 @@ func (b *BuildManager) buildWorker(id int, march string) {
continue continue
} }
if reDepError.Match(out.Bytes()) { if reDownloadError.Match(out.Bytes()) || rePortError.Match(out.Bytes()) || reSigError.Match(out.Bytes()) {
log.Infof("[%s/%s/%s] dep. error detected, rebuilding later", pkg.FullRepo, pkg.Pkgbase, pkg.Version) log.Infof("[%s/%s/%s] detected fixable error, rebuilding later", pkg.FullRepo, pkg.Pkgbase, pkg.Version)
pkg.DbPackage.Update().SetStatus(dbpackage.StatusQueued).ExecX(context.Background())
err = cleanBuildDir(buildDir)
if err != nil {
log.Warningf("[%s/%s/%s] Error removing builddir: %v", pkg.FullRepo, pkg.Pkgbase, pkg.Version, err)
}
b.buildWG.Done()
continue
}
if rePortError.Match(out.Bytes()) {
log.Infof("[%s/%s/%s] port already used (firefox?) error detected, rebuilding later", pkg.FullRepo, pkg.Pkgbase, pkg.Version)
pkg.DbPackage.Update().SetStatus(dbpackage.StatusQueued).ExecX(context.Background()) pkg.DbPackage.Update().SetStatus(dbpackage.StatusQueued).ExecX(context.Background())
err = cleanBuildDir(buildDir) err = cleanBuildDir(buildDir)
if err != nil { if err != nil {

View File

@@ -46,8 +46,9 @@ var (
rePkgSum = regexp.MustCompile(`(?msU)^sha256sums.*=.*\((.+)\)$`) rePkgSum = regexp.MustCompile(`(?msU)^sha256sums.*=.*\((.+)\)$`)
rePkgFile = regexp.MustCompile(`^(.+)(?:-.+){2}-(?:x86_64|any)\.pkg\.tar\.zst(?:\.sig)*$`) rePkgFile = regexp.MustCompile(`^(.+)(?:-.+){2}-(?:x86_64|any)\.pkg\.tar\.zst(?:\.sig)*$`)
reLdError = regexp.MustCompile(`(?mi).*collect2: error: ld returned (\d+) exit status.*`) reLdError = regexp.MustCompile(`(?mi).*collect2: error: ld returned (\d+) exit status.*`)
reDepError = regexp.MustCompile(`(?m)^error: could not rename .+$`) reDownloadError = regexp.MustCompile(`(?m)^error: could not rename .+$`)
rePortError = regexp.MustCompile(`(?m)^OSError: \[Errno 98] Address already in use$`) rePortError = regexp.MustCompile(`(?m)^OSError: \[Errno 98] Address already in use$`)
reSigError = regexp.MustCompile(`(?m)^error: .*: signature from .* is invalid$`)
) )
type BuildPackage struct { type BuildPackage struct {