refactor(filterlists): Improve index update logging
feat(updates): Add String method
This commit is contained in:
@@ -209,7 +209,7 @@ func updateListIndex() error {
|
|||||||
)
|
)
|
||||||
default:
|
default:
|
||||||
// List is in cache and current, there is nothing to do.
|
// List is in cache and current, there is nothing to do.
|
||||||
log.Debug("filterlists: index is up to date")
|
log.Debugf("filterlists: index is up to date (%s == %s)", index.Version, listIndexUpdate.Version)
|
||||||
|
|
||||||
// Update the unbreak filter list IDs on initial load.
|
// Update the unbreak filter list IDs on initial load.
|
||||||
updateUnbreakFilterListIDs()
|
updateUnbreakFilterListIDs()
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ func getUpgradableFiles() ([]*updates.Artifact, error) {
|
|||||||
func resolveUpdateOrder(updateOrder []*updates.Artifact) ([]*updates.Artifact, error) {
|
func resolveUpdateOrder(updateOrder []*updates.Artifact) ([]*updates.Artifact, error) {
|
||||||
// sort the update order by ascending version
|
// sort the update order by ascending version
|
||||||
sort.Sort(byAscVersion(updateOrder))
|
sort.Sort(byAscVersion(updateOrder))
|
||||||
log.Tracef("intel/filterlists: order of updates: %v", updateOrder)
|
log.Tracef("intel/filterlists: order of potential updates: %v", updateOrder)
|
||||||
|
|
||||||
var cacheDBVersion *version.Version
|
var cacheDBVersion *version.Version
|
||||||
if !isLoaded() {
|
if !isLoaded() {
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ func (a *Artifact) SemVer() *semver.Version {
|
|||||||
return a.versionNum
|
return a.versionNum
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *Artifact) String() string {
|
||||||
|
return fmt.Sprintf("%s(v%s)", a.Filename, a.Version)
|
||||||
|
}
|
||||||
|
|
||||||
// IsNewerThan returns whether the artifact is newer than the given artifact.
|
// IsNewerThan returns whether the artifact is newer than the given artifact.
|
||||||
// Returns true if the given artifact is nil.
|
// Returns true if the given artifact is nil.
|
||||||
// The second return value "ok" is false when version could not be compared.
|
// The second return value "ok" is false when version could not be compared.
|
||||||
|
|||||||
Reference in New Issue
Block a user