diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 616f2802..f2461913 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: - go: [ '1.20.x', '1.21.x' ] + go: [ '1.21.x', '1.22.x' ] steps: - name: Checkout @@ -80,7 +80,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.20.x' + go-version: '1.21.x' - name: Download dependencies run: make deps diff --git a/action/auxi.go b/action/auxi.go index cbf3ce12..218b6b88 100644 --- a/action/auxi.go +++ b/action/auxi.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/action/backup.go b/action/backup.go index 1e73d8c5..1d0e4136 100644 --- a/action/backup.go +++ b/action/backup.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/action/basic.go b/action/basic.go index b599a95f..a000f8d5 100644 --- a/action/basic.go +++ b/action/basic.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/action/fs.go b/action/fs.go index ce116e44..bf72326f 100644 --- a/action/fs.go +++ b/action/fs.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // @@ -84,8 +84,8 @@ func Owner(action *recipe.Action) error { return err } - userName := strutil.ReadField(userAndGroup, 0, false, ":") - groupName := strutil.ReadField(userAndGroup, 1, false, ":") + userName := strutil.ReadField(userAndGroup, 0, false, ':') + groupName := strutil.ReadField(userAndGroup, 1, false, ':') uid, gid, err := fsutil.GetOwner(target) diff --git a/action/http.go b/action/http.go index dc48b84c..187aa552 100644 --- a/action/http.go +++ b/action/http.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/action/io.go b/action/io.go index e22e350a..8bac3418 100644 --- a/action/io.go +++ b/action/io.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/action/libs.go b/action/libs.go index 0fb5eebd..f291204f 100644 --- a/action/libs.go +++ b/action/libs.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // @@ -323,7 +323,7 @@ func isLibLoaded(glob string) (bool, error) { } line = strings.TrimSpace(line) - line = strutil.ReadField(line, 0, false, " ") + line = strutil.ReadField(line, 0, false, ' ') match, _ := filepath.Match(glob, line) @@ -403,9 +403,9 @@ func extractSOExports(file string) ([]string, error) { } for _, line := range strings.Split(string(output), "\n") { - switch strutil.ReadField(line, 1, false, " ") { + switch strutil.ReadField(line, 1, false, ' ') { case "T", "R", "D": - result = append(result, strutil.ReadField(line, 2, false, " ")) + result = append(result, strutil.ReadField(line, 2, false, ' ')) } } diff --git a/action/python.go b/action/python.go index 336f7ee8..0da7ad2a 100644 --- a/action/python.go +++ b/action/python.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/action/service.go b/action/service.go index 377fd9b8..f5641083 100644 --- a/action/service.go +++ b/action/service.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/action/system.go b/action/system.go index f5370e7e..b4811381 100644 --- a/action/system.go +++ b/action/system.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/action/template.go b/action/template.go index 8cd6a72f..74085fa9 100644 --- a/action/template.go +++ b/action/template.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/action/users.go b/action/users.go index 1351d6b3..4e2f3ccc 100644 --- a/action/users.go +++ b/action/users.go @@ -2,7 +2,7 @@ package action // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/bibop.go b/bibop.go index 695f550d..513cab30 100644 --- a/bibop.go +++ b/bibop.go @@ -5,7 +5,7 @@ package main // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/cli/barcode.go b/cli/barcode.go index ce2f092f..58b0f020 100644 --- a/cli/barcode.go +++ b/cli/barcode.go @@ -2,7 +2,7 @@ package cli // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/cli/cli.go b/cli/cli.go index 576e5d17..8b16dc89 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -2,7 +2,7 @@ package cli // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // @@ -21,6 +21,9 @@ import ( "github.com/essentialkaos/ek/v12/options" "github.com/essentialkaos/ek/v12/req" "github.com/essentialkaos/ek/v12/strutil" + "github.com/essentialkaos/ek/v12/support" + "github.com/essentialkaos/ek/v12/support/deps" + "github.com/essentialkaos/ek/v12/support/pkgs" "github.com/essentialkaos/ek/v12/terminal/tty" "github.com/essentialkaos/ek/v12/usage" "github.com/essentialkaos/ek/v12/usage/completion/bash" @@ -30,7 +33,6 @@ import ( "github.com/essentialkaos/ek/v12/usage/update" "github.com/essentialkaos/bibop/cli/executor" - "github.com/essentialkaos/bibop/cli/support" "github.com/essentialkaos/bibop/parser" "github.com/essentialkaos/bibop/recipe" "github.com/essentialkaos/bibop/render" @@ -41,7 +43,7 @@ import ( // Application info const ( APP = "bibop" - VER = "8.0.2" + VER = "8.0.3" DESC = "Utility for testing command-line tools" ) @@ -129,7 +131,15 @@ func Run(gitRev string, gomod []byte) { genAbout(gitRev).Print(options.GetS(OPT_VER)) os.Exit(0) case options.GetB(OPT_VERB_VER): - support.Print(APP, VER, gitRev, gomod) + support.Collect(APP, VER). + WithRevision(gitRev). + WithDeps(deps.Extract(gomod)). + WithPackages(pkgs.Collect( + "ca-certificates", "systemd", "systemd-sysv", + "initscripts", "libc-bin", "dpkg", + "gcc", "python2", "python3", "binutils", + )). + Print() os.Exit(0) case options.GetB(OPT_HELP) || len(args) == 0: genUsage().Print() @@ -495,13 +505,13 @@ func genAbout(gitRev string) *usage.About { VersionColorTag: colorTagVer, DescSeparator: "{s}—{!}", - License: "Apache License, Version 2.0 ", - BugTracker: "https://github.com/essentialkaos/bibop/issues", - UpdateChecker: usage.UpdateChecker{"essentialkaos/bibop", update.GitHubChecker}, + License: "Apache License, Version 2.0 ", + BugTracker: "https://github.com/essentialkaos/bibop/issues", } if gitRev != "" { about.Build = "git:" + gitRev + about.UpdateChecker = usage.UpdateChecker{"essentialkaos/bibop", update.GitHubChecker} } return about diff --git a/cli/executor/executor.go b/cli/executor/executor.go index 99d4c3c1..98e63949 100644 --- a/cli/executor/executor.go +++ b/cli/executor/executor.go @@ -2,7 +2,7 @@ package executor // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/cli/executor/validators.go b/cli/executor/validators.go index b14a9f83..540d9c1f 100644 --- a/cli/executor/validators.go +++ b/cli/executor/validators.go @@ -2,7 +2,7 @@ package executor // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/cli/support/support.go b/cli/support/support.go deleted file mode 100644 index cfdd9493..00000000 --- a/cli/support/support.go +++ /dev/null @@ -1,168 +0,0 @@ -package support - -// ////////////////////////////////////////////////////////////////////////////////// // -// // -// Copyright (c) 2023 ESSENTIAL KAOS // -// Apache License, Version 2.0 // -// // -// ////////////////////////////////////////////////////////////////////////////////// // - -import ( - "fmt" - "os" - "runtime" - "runtime/debug" - "strings" - - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/hash" - "github.com/essentialkaos/ek/v12/strutil" - - "github.com/essentialkaos/depsy" -) - -// ////////////////////////////////////////////////////////////////////////////////// // - -// Pkg contains basic package info -type Pkg struct { - Name string - Version string -} - -// Pkgs is slice with packages -type Pkgs []Pkg - -// ////////////////////////////////////////////////////////////////////////////////// // - -// Print prints verbose info about application, system, dependencies and -// important environment -func Print(app, ver, gitRev string, gomod []byte) { - pkgs := collectEnvInfo() - - fmtutil.SeparatorTitleColorTag = "{s-}" - fmtutil.SeparatorFullscreen = false - fmtutil.SeparatorColorTag = "{s-}" - fmtutil.SeparatorSize = 80 - - showApplicationInfo(app, ver, gitRev) - showOSInfo() - showEnvInfo(pkgs) - showDepsInfo(gomod) - - fmtutil.Separator(false) -} - -// ////////////////////////////////////////////////////////////////////////////////// // - -// showApplicationInfo shows verbose information about application -func showApplicationInfo(app, ver, gitRev string) { - fmtutil.Separator(false, "APPLICATION INFO") - - printInfo(7, "Name", app) - printInfo(7, "Version", ver) - - printInfo(7, "Go", fmtc.Sprintf( - "%s {s}(%s/%s){!}", - strings.TrimLeft(runtime.Version(), "go"), - runtime.GOOS, runtime.GOARCH, - )) - - if gitRev == "" { - gitRev = extractGitRevFromBuildInfo() - } - - if gitRev != "" { - if !fmtc.DisableColors && fmtc.IsTrueColorSupported() { - printInfo(7, "Git SHA", gitRev+getHashColorBullet(gitRev)) - } else { - printInfo(7, "Git SHA", gitRev) - } - } - - bin, _ := os.Executable() - binSHA := hash.FileHash(bin) - - if binSHA != "" { - binSHA = strutil.Head(binSHA, 7) - if !fmtc.DisableColors && fmtc.IsTrueColorSupported() { - printInfo(7, "Bin SHA", binSHA+getHashColorBullet(binSHA)) - } else { - printInfo(7, "Bin SHA", binSHA) - } - } -} - -// showDepsInfo shows information about all dependencies -func showDepsInfo(gomod []byte) { - deps := depsy.Extract(gomod, false) - - if len(deps) == 0 { - return - } - - fmtutil.Separator(false, "DEPENDENCIES") - - for _, dep := range deps { - if dep.Extra == "" { - fmtc.Printf(" {s}%8s{!} %s\n", dep.Version, dep.Path) - } else { - fmtc.Printf(" {s}%8s{!} %s {s-}(%s){!}\n", dep.Version, dep.Path, dep.Extra) - } - } -} - -// extractGitRevFromBuildInfo extracts git SHA from embedded build info -func extractGitRevFromBuildInfo() string { - info, ok := debug.ReadBuildInfo() - - if !ok { - return "" - } - - for _, s := range info.Settings { - if s.Key == "vcs.revision" && len(s.Value) > 7 { - return s.Value[:7] - } - } - - return "" -} - -// getHashColorBullet return bullet with color from hash -func getHashColorBullet(v string) string { - if len(v) > 6 { - v = strutil.Head(v, 6) - } - - return fmtc.Sprintf(" {#" + strutil.Head(v, 6) + "}● {!}") -} - -// printInfo formats and prints info record -func printInfo(size int, name, value string) { - name += ":" - size++ - - if value == "" { - fm := fmt.Sprintf(" {*}%%-%ds{!} {s-}—{!}\n", size) - fmtc.Printf(fm, name) - } else { - fm := fmt.Sprintf(" {*}%%-%ds{!} %%s\n", size) - fmtc.Printf(fm, name, value) - } -} - -// ////////////////////////////////////////////////////////////////////////////////// // - -// getMaxSize returns max package name size -func (p Pkgs) getMaxSize() int { - size := 0 - - for _, pkg := range p { - if len(pkg.Name) > size { - size = len(pkg.Name) - } - } - - return size -} diff --git a/cli/support/support_darwin.go b/cli/support/support_darwin.go deleted file mode 100644 index 8d1c69b6..00000000 --- a/cli/support/support_darwin.go +++ /dev/null @@ -1,50 +0,0 @@ -package support - -// ////////////////////////////////////////////////////////////////////////////////// // -// // -// Copyright (c) 2023 ESSENTIAL KAOS // -// Apache License, Version 2.0 // -// // -// ////////////////////////////////////////////////////////////////////////////////// // - -import ( - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/system" -) - -// ////////////////////////////////////////////////////////////////////////////////// // - -// showOSInfo shows verbose information about system -func showOSInfo() { - systemInfo, err := system.GetSystemInfo() - - if err != nil { - return - } - - osInfo, err := system.GetOSInfo() - - if err == nil { - fmtutil.Separator(false, "OS INFO") - - printInfo(12, "Name", osInfo.Name) - printInfo(12, "Version", osInfo.VersionID) - printInfo(12, "Build", osInfo.Build) - } - - fmtutil.Separator(false, "SYSTEM INFO") - - printInfo(7, "Name", systemInfo.OS) - printInfo(7, "Arch", systemInfo.Arch) - printInfo(7, "Kernel", systemInfo.Kernel) -} - -// collectEnvInfo collects info about environment -func collectEnvInfo() Pkgs { - return nil -} - -// showEnvInfo shows info about environment -func showEnvInfo(pkgs Pkgs) { - return -} diff --git a/cli/support/support_linux.go b/cli/support/support_linux.go deleted file mode 100644 index ef1c5671..00000000 --- a/cli/support/support_linux.go +++ /dev/null @@ -1,165 +0,0 @@ -package support - -// ////////////////////////////////////////////////////////////////////////////////// // -// // -// Copyright (c) 2023 ESSENTIAL KAOS // -// Apache License, Version 2.0 // -// // -// ////////////////////////////////////////////////////////////////////////////////// // - -import ( - "os/exec" - "strings" - - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/system" - "github.com/essentialkaos/ek/v12/system/container" -) - -// ////////////////////////////////////////////////////////////////////////////////// // - -// showOSInfo shows verbose information about system -func showOSInfo() { - osInfo, err := system.GetOSInfo() - - if err == nil { - fmtutil.Separator(false, "OS INFO") - - printInfo(12, "Name", osInfo.ColoredName()) - printInfo(12, "Pretty Name", osInfo.ColoredPrettyName()) - printInfo(12, "Version", osInfo.Version) - printInfo(12, "ID", osInfo.ID) - printInfo(12, "ID Like", osInfo.IDLike) - printInfo(12, "Version ID", osInfo.VersionID) - printInfo(12, "Version Code", osInfo.VersionCodename) - printInfo(12, "Platform ID", osInfo.PlatformID) - printInfo(12, "CPE", osInfo.CPEName) - } - - systemInfo, err := system.GetSystemInfo() - - if err != nil { - return - } else if osInfo == nil { - fmtutil.Separator(false, "SYSTEM INFO") - printInfo(12, "Name", systemInfo.OS) - } - - printInfo(12, "Arch", systemInfo.Arch) - printInfo(12, "Kernel", systemInfo.Kernel) - - containerEngine := "No" - - switch container.GetEngine() { - case container.DOCKER: - containerEngine = "Yes (Docker)" - case container.PODMAN: - containerEngine = "Yes (Podman)" - case container.LXC: - containerEngine = "Yes (LXC)" - } - - fmtc.NewLine() - - printInfo(12, "Container", containerEngine) -} - -// showEnvInfo shows info about environment -func showEnvInfo(pkgs Pkgs) { - fmtutil.Separator(false, "ENVIRONMENT") - - size := pkgs.getMaxSize() - - for _, pkg := range pkgs { - printInfo(size, pkg.Name, pkg.Version) - } -} - -// collectEnvInfo collects info about packages -func collectEnvInfo() Pkgs { - if isDEBBased() { - return Pkgs{ - getPackageInfo("ca-certificates"), - getPackageInfo("systemd"), - getPackageInfo("systemd-sysv"), - getPackageInfo("initscripts"), - getPackageInfo("libc-bin"), - getPackageInfo("dpkg"), - getPackageInfo("python2"), - getPackageInfo("python3"), - getPackageInfo("binutils"), - } - } - - return Pkgs{ - getPackageInfo("ca-certificates"), - getPackageInfo("systemd"), - getPackageInfo("systemd-sysv"), - getPackageInfo("initscripts"), - getPackageInfo("glibc"), - getPackageInfo("rpm"), - getPackageInfo("python2"), - getPackageInfo("python3"), - getPackageInfo("binutils"), - } -} - -// getPackageVersion returns package name and version from package manager database -func getPackageInfo(names ...string) Pkg { - var info Pkg - - if len(names) == 0 { - return Pkg{} - } - - for _, name := range names { - switch { - case isDEBBased(): - info = getDEBPackageInfo(name) - case isRPMBased(): - info = getRPMPackageInfo(name) - } - - if info.Version != "" { - return info - } - } - - return Pkg{names[0], ""} -} - -// isDEBBased returns true if is DEB-based distro -func isRPMBased() bool { - return fsutil.IsExist("/usr/bin/rpm") -} - -// isDEBBased returns true if is DEB-based distro -func isDEBBased() bool { - return fsutil.IsExist("/usr/bin/dpkg-query") -} - -// getRPMPackageInfo returns info about RPM package -func getRPMPackageInfo(name string) Pkg { - cmd := exec.Command("rpm", "-q", name) - out, err := cmd.Output() - - if err != nil || len(out) == 0 { - return Pkg{name, ""} - } - - return Pkg{name, strings.TrimRight(string(out), "\n\r")} -} - -// getDEBPackageInfo returns info about DEB package -func getDEBPackageInfo(name string) Pkg { - cmd := exec.Command("dpkg-query", "--showformat=${Version}", "--show", name) - out, err := cmd.Output() - - if err != nil || len(out) == 0 { - return Pkg{name, ""} - } - - return Pkg{name, string(out)} -} diff --git a/go.mod b/go.mod index 6bc739f6..967ebee0 100644 --- a/go.mod +++ b/go.mod @@ -6,13 +6,13 @@ require ( github.com/buger/jsonparser v1.1.1 github.com/creack/pty v1.1.21 github.com/essentialkaos/check v1.4.0 - github.com/essentialkaos/depsy v1.1.0 - github.com/essentialkaos/ek/v12 v12.92.0 + github.com/essentialkaos/ek/v12 v12.113.1 ) require ( + github.com/essentialkaos/depsy v1.1.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/sys v0.18.0 // indirect ) diff --git a/go.sum b/go.sum index ce0a5b47..577508ad 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,8 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1n github.com/essentialkaos/check v1.4.0/go.mod h1:LMKPZ2H+9PXe7Y2gEoKyVAwUqXVgx7KtgibfsHJPus0= github.com/essentialkaos/depsy v1.1.0 h1:U6dp687UkQwXlZU17Hg2KMxbp3nfZAoZ8duaeUFYvJI= github.com/essentialkaos/depsy v1.1.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v12 v12.92.0 h1:3JIkHWNA6MNkJOfqzMWJ8jN9sRM7nRi7URoFRVFHZzI= -github.com/essentialkaos/ek/v12 v12.92.0/go.mod h1:9efMqo1S8EtYhmeelOSTmMQDGC2vRgPkjkKKfvUD2eU= +github.com/essentialkaos/ek/v12 v12.113.1 h1:3opV9dwRpIQq1fqg5mkaSEt6ogECL4VLzrH/829qeYg= +github.com/essentialkaos/ek/v12 v12.113.1/go.mod h1:SslW97Se34YQKc08Ume2V/8h/HPTgLS1+Iok64cNF/U= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -17,5 +17,5 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/parser/fuzz.go b/parser/fuzz.go index 373ba300..2bcdef94 100644 --- a/parser/fuzz.go +++ b/parser/fuzz.go @@ -5,7 +5,7 @@ package parser // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/parser/parser.go b/parser/parser.go index 79b7c9a3..8b699d2f 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -2,7 +2,7 @@ package parser // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/parser/parser_test.go b/parser/parser_test.go index f7ac12d5..3181f1aa 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -2,7 +2,7 @@ package parser // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/recipe/recipe.go b/recipe/recipe.go index 6b09833c..19bab2ba 100644 --- a/recipe/recipe.go +++ b/recipe/recipe.go @@ -2,7 +2,7 @@ package recipe // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // @@ -505,7 +505,7 @@ func extractEnvVariables(cmdline string) (string, []string) { var envs []string for { - variable := strutil.ReadField(cmdline, 0, false, " ") + variable := strutil.ReadField(cmdline, 0, false, ' ') if !strings.Contains(variable, "=") { break diff --git a/recipe/recipe_test.go b/recipe/recipe_test.go index ff471bfa..1b9d834d 100644 --- a/recipe/recipe_test.go +++ b/recipe/recipe_test.go @@ -2,7 +2,7 @@ package recipe // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/recipe/runtime_variables.go b/recipe/runtime_variables.go index e8b9e538..3ba378af 100644 --- a/recipe/runtime_variables.go +++ b/recipe/runtime_variables.go @@ -2,7 +2,7 @@ package recipe // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/recipe/tokens.go b/recipe/tokens.go index 58e55db0..c4d45956 100644 --- a/recipe/tokens.go +++ b/recipe/tokens.go @@ -2,7 +2,7 @@ package recipe // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/render/render.go b/render/render.go index 8478e2b7..5c6fbe3e 100644 --- a/render/render.go +++ b/render/render.go @@ -2,7 +2,7 @@ package render // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/render/renderer_json.go b/render/renderer_json.go index 6a1c1236..eaddc400 100644 --- a/render/renderer_json.go +++ b/render/renderer_json.go @@ -2,7 +2,7 @@ package render // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/render/renderer_quiet.go b/render/renderer_quiet.go index d0174e70..eb39e574 100644 --- a/render/renderer_quiet.go +++ b/render/renderer_quiet.go @@ -2,7 +2,7 @@ package render // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/render/renderer_tap13.go b/render/renderer_tap13.go index 1d74c766..53391508 100644 --- a/render/renderer_tap13.go +++ b/render/renderer_tap13.go @@ -2,7 +2,7 @@ package render // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/render/renderer_tap14.go b/render/renderer_tap14.go index cb8b1617..25c27b97 100644 --- a/render/renderer_tap14.go +++ b/render/renderer_tap14.go @@ -2,7 +2,7 @@ package render // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/render/renderer_terminal.go b/render/renderer_terminal.go index 6432a546..1b17a096 100644 --- a/render/renderer_terminal.go +++ b/render/renderer_terminal.go @@ -2,7 +2,7 @@ package render // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/render/renderer_xml.go b/render/renderer_xml.go index e2b22599..17349121 100644 --- a/render/renderer_xml.go +++ b/render/renderer_xml.go @@ -2,7 +2,7 @@ package render // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2023 ESSENTIAL KAOS // +// Copyright (c) 2024 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // @@ -76,8 +76,8 @@ func (rr *XMLRenderer) CommandStarted(c *recipe.Command) { for _, variable := range c.Env { rr.data.WriteString(fmt.Sprintf( " \n", - rr.escapeData(strutil.ReadField(variable, 0, false, "=")), - rr.escapeData(strutil.ReadField(variable, 1, false, "=")), + rr.escapeData(strutil.ReadField(variable, 0, false, '=')), + rr.escapeData(strutil.ReadField(variable, 1, false, '=')), )) }