This is an automated email from the ASF dual-hosted git repository. msciabarra pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/openserverless-cli.git
commit 32175b07b7bbbfbe16b933a224f3b623f285daa5 Author: Michele Sciabarra <[email protected]> AuthorDate: Wed Jul 31 19:17:26 2024 +0200 update tools and various fixes --- .gitignore | 13 ------------- _patches/README.md | 8 ++++---- _patches/builtin_extra.go | 2 +- _patches/patch-sh.sh | 2 +- _patches/patch-task.sh | 2 +- _patches/sh | 2 +- _patches/task | Bin 17159510 -> 0 bytes go.mod | 6 ++---- go.sum | 12 ++++-------- main.go | 2 ++ preflight.go | 7 +++++-- prereq.go | 2 +- 12 files changed, 22 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 1289731..922493a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,19 +21,7 @@ .task/ attic/ _* -bin/nuv -bin/nuv.exe -bin/windows/wix -bin/*/amd64/* -bin/*/arm64/* -*-build-* -*.deb -*.rpm -*.msi -*.pkg .latestcheck -bin/unzip.exe -bin/*/LICENSE .test_fail_then_succeed cookie.txt actions.zip @@ -50,5 +38,4 @@ _patch/wsk _patch/openwhisk-wskdeploy _patch/openwhisk-cli tests/prereq/olaris/bin - dist/ diff --git a/_patches/README.md b/_patches/README.md index 300f656..f02d061 100644 --- a/_patches/README.md +++ b/_patches/README.md @@ -31,19 +31,19 @@ This is the procedure we followed to build the patched versions of: then add remote upstream to the original repos to fetch tags then git fetch --all -3. execute the patch scripts in order +3. execute the patch scripts in order (if you change them remember to increase version numbers) bash patch-sh.sh bash patch-task.sh bash patch-wskdeploy.sh bash patch-wsk.sh -4. regenerate the go.mod/go.sum in top level +4. regenerate the go.mod/go.sum in top level (using the latest versions if you changed them!) cd .. rm go.mod go.sum go mod init github.com/apache/openserverless-cli go get github.com/sciabarracom/[email protected] -go get github.com/sciabarracom/task/v3/cmd/[email protected] +go get github.com/sciabarracom/task/v3/cmd/[email protected] go mod tidy -bo build +go build diff --git a/_patches/builtin_extra.go b/_patches/builtin_extra.go index e68e48e..b871539 100644 --- a/_patches/builtin_extra.go +++ b/_patches/builtin_extra.go @@ -55,7 +55,7 @@ func (r *Runner) builtinCode(ctx context.Context, pos syntax.Pos, name string, a } if isTools(name) { - args = append([]string{"ops", "-" + name}, args...) + args = append([]string{os.Getenv("OPS_CMD"), "-" + name}, args...) fmt.Printf("%v\n", args) r.exitShell(ctx, 1) r.exec(ctx, args) diff --git a/_patches/patch-sh.sh b/_patches/patch-sh.sh index 26aa544..e5e8f52 100644 --- a/_patches/patch-sh.sh +++ b/_patches/patch-sh.sh @@ -4,7 +4,7 @@ cd "$(dirname $0)" go clean -cache -modcache -testcache HERE=$PWD STAG="v3.8.0" -DTAG="v3.8.1" +DTAG="v3.8.2" cd sh git checkout "$STAG" -B openserverless cp $HERE/builtin_extra.go interp/builtin_extra.go diff --git a/_patches/patch-task.sh b/_patches/patch-task.sh index 66718f2..8d5c790 100644 --- a/_patches/patch-task.sh +++ b/_patches/patch-task.sh @@ -4,7 +4,7 @@ cd "$(dirname $0)" HERE=$PWD SHVER=$(git ls-remote https://github.com/sciabarracom/sh | awk '/refs\/heads\/openserverless/{print $1}') STAG="v3.38.0" -DTAG="v3.38.7" +DTAG="v3.38.9" cd taskfile go clean -cache -modcache git checkout "$STAG" -B openserverless diff --git a/_patches/sh b/_patches/sh index da753fd..3af9e5f 160000 --- a/_patches/sh +++ b/_patches/sh @@ -1 +1 @@ -Subproject commit da753fd27b1ff147f5c8f1dae46676ad5a062ee2 +Subproject commit 3af9e5f9bb79a26fe345550d714a4d6c6f63c0e7 diff --git a/_patches/task b/_patches/task deleted file mode 100755 index c5c1815..0000000 Binary files a/_patches/task and /dev/null differ diff --git a/go.mod b/go.mod index f670934..7f9448a 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/apache/openserverless-cli go 1.22.5 -retract v1.2.0-openserverless - require ( github.com/Masterminds/semver v1.5.0 github.com/apache/openwhisk-client-go v0.0.0-20210311185314-87edc2364717 @@ -22,7 +20,7 @@ require ( github.com/nuvolaris/jj v0.0.0-20231020143327-10b90948a5d2 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c github.com/sciabarracom/openwhisk-cli v1.2.1 - github.com/sciabarracom/task/v3 v3.38.7 + github.com/sciabarracom/task/v3 v3.38.9 github.com/stretchr/testify v1.9.0 github.com/zalando/go-keyring v0.2.5 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 @@ -85,7 +83,7 @@ require ( github.com/rivo/uniseg v0.4.7 // indirect github.com/sajari/fuzzy v1.0.0 // indirect github.com/sciabarracom/openwhisk-wskdeploy v1.2.1 // indirect - github.com/sciabarracom/sh/v3 v3.8.1 // indirect + github.com/sciabarracom/sh/v3 v3.8.2 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/skeema/knownhosts v1.2.2 // indirect github.com/spf13/cobra v1.1.3 // indirect diff --git a/go.sum b/go.sum index 2eb29ca..a0fddf2 100644 --- a/go.sum +++ b/go.sum @@ -343,14 +343,10 @@ github.com/sciabarracom/openwhisk-cli v1.2.1 h1:XVEAidwhmoOpvjKkqcIfGzLQwe850K5E github.com/sciabarracom/openwhisk-cli v1.2.1/go.mod h1:KIF6FPfQ6d2mNSEFP7oiz49iHxjDCeFTnCS7XwHAlUI= github.com/sciabarracom/openwhisk-wskdeploy v1.2.1 h1:t5hgca9OFEO39t4OqIxcWybYRjyBW7jDhg54eLar29U= github.com/sciabarracom/openwhisk-wskdeploy v1.2.1/go.mod h1:bWjrIOIAzt8AcPqiJ0mWEecUxXbT4bY4ysMlJO6/q78= -github.com/sciabarracom/sh/v3 v3.8.1 h1:DQXhDNnbcGbeMtaTFbGa8OlmZZxxfBcwI8u8oS2gSyg= -github.com/sciabarracom/sh/v3 v3.8.1/go.mod h1:CeMVr3PRLhlUrS+VPLTp8dS5/6xNzmmX0h/WVHRR6DA= -github.com/sciabarracom/task/v3 v3.38.5 h1:n3MoGltcwTtuG3R4tlPX9V0DmFYa55ESDItNiJIpiYk= -github.com/sciabarracom/task/v3 v3.38.5/go.mod h1:KOSMNSJm4CBpVzAXUlkgEPgbDp9kQoL9nNm/B6DvcW0= -github.com/sciabarracom/task/v3 v3.38.6 h1:vNVqq/EUDkCbt4TUvk4LWtpD4wE0G4mveWMBb8QUieU= -github.com/sciabarracom/task/v3 v3.38.6/go.mod h1:KOSMNSJm4CBpVzAXUlkgEPgbDp9kQoL9nNm/B6DvcW0= -github.com/sciabarracom/task/v3 v3.38.7 h1:cWN+wE5zDW/U5VLoj/D9PFNHqgGodM+5XtY8av5hZso= -github.com/sciabarracom/task/v3 v3.38.7/go.mod h1:KOSMNSJm4CBpVzAXUlkgEPgbDp9kQoL9nNm/B6DvcW0= +github.com/sciabarracom/sh/v3 v3.8.2 h1:ZAdlsq2d1UnvdbnOgENhZ/bTqKdwEM89ftX7kokVFnI= +github.com/sciabarracom/sh/v3 v3.8.2/go.mod h1:CeMVr3PRLhlUrS+VPLTp8dS5/6xNzmmX0h/WVHRR6DA= +github.com/sciabarracom/task/v3 v3.38.9 h1:LozhBEsGQGYKJCAhOE+0s22IF92DATMNDU/RMzpbSCw= +github.com/sciabarracom/task/v3 v3.38.9/go.mod h1:V88FdSzukQ90H9nzqexBsmBRXpoEpJGsVPMoOnkAsWc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= diff --git a/main.go b/main.go index 3c892da..d9a7ba2 100644 --- a/main.go +++ b/main.go @@ -102,6 +102,8 @@ func info() { fmt.Println("NUV_PWD:", os.Getenv("NUV_PWD")) fmt.Println("NUV_OLARIS:", os.Getenv("NUV_OLARIS")) fmt.Println("NUV_ROOT_PLUGIN:", os.Getenv("NUV_ROOT_PLUGIN")) + //fmt.Println("OPS_TOOLS:", os.Getenv("OPS_TOOLS")) + //fmt.Println("OPS_COREUTILS:", os.Getenv("OPS_COREUTILS")) } // not available in taskfiles diff --git a/preflight.go b/preflight.go index e82daf7..522e757 100644 --- a/preflight.go +++ b/preflight.go @@ -45,8 +45,11 @@ func preflightChecks() error { preflight.check(checkInstalled("curl")) preflight.check(checkInstalled("ssh")) - // preflight.check(checkInstalled("grep")) - + if getOS() != "windows" { + preflight.check(checkInstalled("grep")) + preflight.check(checkInstalled("xz")) + preflight.check(checkInstalled("gunzip")) + } return preflight.err } diff --git a/prereq.go b/prereq.go index 2918090..6d13c3b 100644 --- a/prereq.go +++ b/prereq.go @@ -199,7 +199,7 @@ func downloadPrereq(name string, task PrereqTask) error { // fixing the name for windows adding .exe name = addExeExt(name) if !exists(bindir, name) { - return fmt.Errorf("failed to download %s %s", name, version) + return fmt.Errorf("failed to download %s version %s", name, version) } }
