From d5abad337179826f55a56dcfb86a0b0144bd4d63 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Tue, 9 Sep 2025 19:05:57 +0300 Subject: [PATCH] Add 'ignored' status for package version checking --- src/bpm-repo/main.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/bpm-repo/main.go b/src/bpm-repo/main.go index 32be0d1..c313fa5 100644 --- a/src/bpm-repo/main.go +++ b/src/bpm-repo/main.go @@ -163,6 +163,7 @@ func checkVersionsFunc(repo string) { } pkgsWithoutScript := make([]string, 0) + pkgsIgnored := make([]string, 0) pkgsWithError := make(map[string]error) pkgsWithUpdates := make(map[string]struct { OldVersion string @@ -196,6 +197,16 @@ func checkVersionsFunc(repo string) { } latestVersion = strings.TrimSpace(string(output)) + // Check if package should be ignored + if latestVersion == "ignore" { + pkgsIgnored = append(pkgsIgnored, pkgInfo.Name) + + // Remove cached status + delete(cachedVersions, pkgInfo.Name) + + continue + } + // Ensure latest version is valid if latestVersion == "" || latestVersion == "null" { pkgsWithError[pkgInfo.Name] = fmt.Errorf("invalid version number \"%s\"", latestVersion) @@ -241,6 +252,11 @@ func checkVersionsFunc(repo string) { } if verbose { + // Print ignored packages + for _, pkg := range pkgsIgnored { + log.Printf("Warning: package (%s) was ignored\n", pkg) + } + // Print packages without check-version.sh script for _, pkg := range pkgsWithoutScript { log.Printf("Warning: package (%s) has no check-version.sh script\n", pkg) @@ -259,6 +275,7 @@ func checkVersionsFunc(repo string) { fmt.Println("Available updates:", len(pkgsWithUpdates)) fmt.Println("Up to date:", pkgsUpToDate) fmt.Println("Missing script:", len(pkgsWithoutScript)) + fmt.Println("Ignored: ", len(pkgsIgnored)) fmt.Println("Errors:", len(pkgsWithError)) }