Skip to content

Commit

Permalink
Merge pull request #104 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 3.3.3
  • Loading branch information
andyone authored Mar 17, 2024
2 parents 2a6489d + 19626d5 commit 433d786
Show file tree
Hide file tree
Showing 62 changed files with 150 additions and 133 deletions.
4 changes: 2 additions & 2 deletions .docker/alpine.docker
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG REGISTRY="docker.io"

## CREATEREPO_C BUILDER ########################################################

FROM ${REGISTRY}/essentialkaos/alpine:3.17 as cr-builder
FROM ${REGISTRY}/essentialkaos/alpine:3.18 as cr-builder

ARG VERSION=0.20.1

Expand Down Expand Up @@ -33,7 +33,7 @@ RUN apk add --no-cache git make gcc musl-dev && \

## FINAL IMAGE #################################################################

FROM ${REGISTRY}/essentialkaos/alpine:3.17
FROM ${REGISTRY}/essentialkaos/alpine:3.18

LABEL org.opencontainers.image.title="rep" \
org.opencontainers.image.description="DNF/YUM repository management utility" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:

strategy:
matrix:
go: [ '1.20.x', '1.21.x' ]
go: [ '1.21.x', '1.22.x' ]

steps:
- name: Download pre-built artifacts
Expand Down
4 changes: 2 additions & 2 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down Expand Up @@ -44,7 +44,7 @@ import (
// App info
const (
APP = "rep"
VER = "3.3.2"
VER = "3.3.3"
DESC = "DNF/YUM repository management utility"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_find.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_gen_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_purge_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_reindex.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd_resign.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down Expand Up @@ -61,7 +61,7 @@ func resignAllPackages(ctx *context, key *sign.Key) bool {
ctx.Logger.Get(data.REPO_TESTING).Print("Packages re-signing finished with error")
return false
} else {
isResigned = true
isResigned = true //nolint:ineffassign
fmtc.NewLine()
}

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_unrelease.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd_which_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package logger

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion cli/logger/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package logger

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
20 changes: 9 additions & 11 deletions cli/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package query

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down Expand Up @@ -199,7 +199,7 @@ func parseTerm(rawTerm string) (*search.Term, error) {

if name != "" {
if termType == search.TERM_UNKNOWN {
return nil, fmt.Errorf("Unknown query term \"%s\"", name)
return nil, fmt.Errorf("Unknown query term %q", name)
}
} else {
termType = 255 // term without name = name prefix search
Expand Down Expand Up @@ -285,7 +285,7 @@ func parseDateTermValue(termType uint8, value string, mod uint8) (*search.Term,
dur, err := timeutil.ParseDuration(value, 'd')

if err != nil {
return nil, fmt.Errorf("Can't parse \"%s\" as duration: %v", value, err)
return nil, fmt.Errorf("Can't parse %q as duration: %v", value, err)
}

now := time.Now()
Expand Down Expand Up @@ -331,14 +331,14 @@ func parseSizeTermValue(value string, mod uint8) (*search.Term, error) {
to = 1024 * 1024 * 1024

case strings.Contains(value, "-"):
from = fmtutil.ParseSize(strutil.ReadField(value, 0, false, "-"))
to = fmtutil.ParseSize(strutil.ReadField(value, 1, false, "-"))
from = fmtutil.ParseSize(strutil.ReadField(value, 0, false, '-'))
to = fmtutil.ParseSize(strutil.ReadField(value, 1, false, '-'))

default:
size := fmtutil.ParseSize(value)
diff := uint64(float64(size) * 0.2)
from = mathutil.BetweenU64(size-diff, 0, 1024*1024*1024)
to = mathutil.BetweenU64(size+diff, 0, 1024*1024*1024)
from = mathutil.Between(size-diff, 0, 1024*1024*1024)
to = mathutil.Between(size+diff, 0, 1024*1024*1024)
}

if from > to {
Expand All @@ -354,7 +354,7 @@ func parseDepTermValue(termType uint8, value string, mod uint8) (*search.Term, e

if dep.Flag != data.COMP_FLAG_ANY {
if dep.Epoch == "" && dep.Version == "" && dep.Release == "" {
return nil, fmt.Errorf("Can't use \"%v\" - condition without value", value)
return nil, fmt.Errorf("Can't use %q - condition without value", value)
}
}

Expand All @@ -380,9 +380,7 @@ func extractTermInfo(rawTerm string) (string, string, bool) {
return "", rawTerm, false
}

sepIndex := strings.Index(rawTerm, ":")
name := rawTerm[:sepIndex]
value := rawTerm[sepIndex+1:]
name, value, _ := strings.Cut(rawTerm, ":")
isNegative := false

if strings.HasPrefix(value, ":") {
Expand Down
4 changes: 3 additions & 1 deletion cli/query/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package query

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down Expand Up @@ -31,10 +31,12 @@ var _ = Suite(&QueryParserSuite{})
func (s *QueryParserSuite) TestParser(c *C) {
sr, err := Parse(nil)

c.Assert(err, IsNil)
c.Assert(sr, IsNil)

sr, err = Parse([]string{"", "", ""})

c.Assert(err, IsNil)
c.Assert(sr, IsNil)

sr, err = Parse([]string{"k:test"})
Expand Down
Loading

0 comments on commit 433d786

Please sign in to comment.