From 3bd5164682a21a9c056f29fc9ad586bd07160bc6 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Sun, 28 May 2023 13:08:01 +0200 Subject: [PATCH] added detection for error 404 dependency not found on mirror --- housekeeping.go | 7 ++++--- proto_package.go | 3 ++- utils.go | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/housekeeping.go b/housekeeping.go index 748a2b4..1cf8a60 100644 --- a/housekeeping.go +++ b/housekeeping.go @@ -234,9 +234,10 @@ func logHK() error { } sLogContent := string(logContent) - if rePortError.MatchString(sLogContent) || reSigError.MatchString(sLogContent) || reDownloadError.MatchString(sLogContent) { - rows, err := db.DBPackage.Update().Where(dbpackage.And(dbpackage.Pkgbase(pkg.Pkgbase), dbpackage.March(pkg.March), - dbpackage.StatusEQ(dbpackage.StatusFailed))).ClearTagRev().SetStatus(dbpackage.StatusQueued).Save(context.Background()) + if rePortError.MatchString(sLogContent) || reSigError.MatchString(sLogContent) || reDownloadError.MatchString(sLogContent) || + reDownloadError2.MatchString(sLogContent) { + rows, err := db.DBPackage.Update().Where(dbpackage.Pkgbase(pkg.Pkgbase), dbpackage.March(pkg.March), + dbpackage.StatusEQ(dbpackage.StatusFailed)).ClearTagRev().SetStatus(dbpackage.StatusQueued).Save(context.Background()) if err != nil { return err } diff --git a/proto_package.go b/proto_package.go index cd3b307..b02fe4f 100644 --- a/proto_package.go +++ b/proto_package.go @@ -223,7 +223,8 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) { return time.Since(start), fmt.Errorf("ld/lto-incomp error detected, LTO disabled") } - if reDownloadError.MatchString(out.String()) || rePortError.MatchString(out.String()) || reSigError.MatchString(out.String()) { + if reDownloadError.MatchString(out.String()) || reDownloadError2.MatchString(out.String()) || + rePortError.MatchString(out.String()) || reSigError.MatchString(out.String()) { p.DBPackage.Update().SetStatus(dbpackage.StatusQueued).ExecX(ctx) return time.Since(start), fmt.Errorf("known builderror detected") } diff --git a/utils.go b/utils.go index 3f03829..275b537 100644 --- a/utils.go +++ b/utils.go @@ -42,6 +42,7 @@ var ( rePkgFile = regexp.MustCompile(`^(.+)(?:-.+){2}-(?:x86_64|any)\.pkg\.tar\.zst(?:\.sig)*$`) reLdError = regexp.MustCompile(`(?mi).*collect2: error: ld returned (\d+) exit status.*`) reDownloadError = regexp.MustCompile(`(?m)^error: could not rename .+$`) + reDownloadError2 = regexp.MustCompile(`(?m)^error: failed retrieving file '.+' from .*: The requested URL returned error: .+$`) rePortError = regexp.MustCompile(`(?m)^OSError: \x5bErrno 98\x5d Address already in use$`) reSigError = regexp.MustCompile(`(?m)^error: .*: signature from .* is invalid$`) reRustLTOError = regexp.MustCompile(`(?m)^error: options \x60-C (.+)\x60 and \x60-C lto\x60 are incompatible$`)