From d0738215217a2ff55fc68a2ade6073a24060e69e Mon Sep 17 00:00:00 2001 From: wangyueliang Date: Mon, 1 Apr 2024 20:26:31 +0800 Subject: [PATCH] Backport: Use prompts to modify to NestOS [origInfo] backport from v0.13.0.x c9bdfd58b03b1145cc288273ca871152a9ebb308 --- cmd/clean.go | 4 ++-- cmd/coreos-assembler.go | 6 +++++- cmd/update-variant.go | 2 +- mantle/cmd/kola/devshell.go | 2 +- mantle/cmd/plume/cosa2stream.go | 2 +- src/cmd-build | 4 ++-- src/cmd-build-fast | 4 ++-- src/cmd-buildextend-metal | 4 ++-- src/cmd-fetch | 4 ++-- src/cmd-init | 4 ++-- src/cmd-offline-update | 4 ++-- src/cmd-prune | 2 +- src/cmd-shell | 2 +- 13 files changed, 24 insertions(+), 20 deletions(-) diff --git a/cmd/clean.go b/cmd/clean.go index 7d5e7045..8a1ea9ef 100644 --- a/cmd/clean.go +++ b/cmd/clean.go @@ -9,8 +9,8 @@ import ( ) func runClean(argv []string) error { - const cleanUsage = `Usage: coreos-assembler clean --help -coreos-assembler clean [--all] + const cleanUsage = `Usage: nestos-assembler clean --help +nestos-assembler clean [--all] Delete all build artifacts. Use --all to also clean the cache/ directory. ` diff --git a/cmd/coreos-assembler.go b/cmd/coreos-assembler.go index 02eb892b..73f60ee7 100644 --- a/cmd/coreos-assembler.go +++ b/cmd/coreos-assembler.go @@ -53,12 +53,16 @@ func printCommands(title string, cmds []string) { } func printUsage() { - fmt.Println("Usage: coreos-assembler CMD ...") + fmt.Println("Usage: nestos-assembler CMD ...") printCommands("Build commands", buildCommands) printCommands("Advanced build commands", advancedBuildCommands) printCommands("Platform builds", buildextendCommands) printCommands("Utility commands", utilityCommands) printCommands("Other commands", otherCommands) + + fmt.Printf("\nNotice:\n") + fmt.Printf(" For bug reports, please submit an issue at [nestos-assembler](https://gitee.com/openeuler/nestos-assembler).") + fmt.Printf(" This software is a fork of [coreos-assembler](https://github.com/coreos/coreos-assembler), licensed under the [Apache-2.0 License](https://www.apache.org/licenses/LICENSE-2.0).\n") } func contains(slice []string, str string) bool { diff --git a/cmd/update-variant.go b/cmd/update-variant.go index 9ec4affb..c08e3e9f 100644 --- a/cmd/update-variant.go +++ b/cmd/update-variant.go @@ -7,7 +7,7 @@ import ( ) func runUpdateVariant(argv []string) error { - const updateVariantUsage = `Usage: coreos-assembler update-variant --help + const updateVariantUsage = `Usage: nestos-assembler update-variant --help Update symlinks for manifests in the config repo to use the specified version for the given variant. diff --git a/mantle/cmd/kola/devshell.go b/mantle/cmd/kola/devshell.go index 3966203a..e50b9958 100644 --- a/mantle/cmd/kola/devshell.go +++ b/mantle/cmd/kola/devshell.go @@ -38,7 +38,7 @@ import ( "golang.org/x/term" ) -const devshellHostname = "cosa-devsh" +const devshellHostname = "nosa-devsh" func stripControlCharacters(s string) string { s = strings.ToValidUTF8(s, "") diff --git a/mantle/cmd/plume/cosa2stream.go b/mantle/cmd/plume/cosa2stream.go index 8e35ea62..0caf5a23 100644 --- a/mantle/cmd/plume/cosa2stream.go +++ b/mantle/cmd/plume/cosa2stream.go @@ -134,7 +134,7 @@ func runCosaBuildToStream(cmd *cobra.Command, args []string) error { cosaArgs = append(cosaArgs, "--url="+arg) cosaArgs = append(cosaArgs, "--stream-name="+streamName) cosaArgs = append(cosaArgs, "--output="+releaseTmpf.Name()) - c := exec.Command("cosa", cosaArgs...) + c := exec.Command("nosa", cosaArgs...) c.Stderr = os.Stderr if err := c.Run(); err != nil { return err diff --git a/src/cmd-build b/src/cmd-build index 27a40a09..f1249240 100755 --- a/src/cmd-build +++ b/src/cmd-build @@ -7,8 +7,8 @@ dn=$(dirname "$0") print_help() { cat 1>&2 <<'EOF' -Usage: coreos-assembler build --help - coreos-assembler build [OPTIONS]... [TARGET]... +Usage: nestos-assembler build --help + nestos-assembler build [OPTIONS]... [TARGET]... Build bootable container (ostree) and image base artifacts from previously fetched packages. Accepted TARGET arguments: diff --git a/src/cmd-build-fast b/src/cmd-build-fast index 2cc8fcbc..de5b4a0a 100755 --- a/src/cmd-build-fast +++ b/src/cmd-build-fast @@ -19,7 +19,7 @@ dn=$(dirname "$0") print_help() { cat 1>&2 <<'EOF' -Usage: coreos-assembler build-fast [--undeploy] +Usage: nestos-assembler build-fast [--undeploy] EOF } @@ -63,7 +63,7 @@ if test -e .git; then # shellcheck disable=SC2016 fatal 'This command requires inheriting from a previous full OS build. Use e.g. `export COSA_DIR=/path/to/fcos` that has a previous -run of `cosa build`.' +run of `nosa build`.' fi projectdir=$(pwd) cd "${COSA_DIR}" diff --git a/src/cmd-buildextend-metal b/src/cmd-buildextend-metal index 990210bf..48af73c7 100755 --- a/src/cmd-buildextend-metal +++ b/src/cmd-buildextend-metal @@ -26,8 +26,8 @@ esac print_help() { cat 1>&2 <&2 <<'EOF' -Usage: coreos-assembler fetch --help - coreos-assembler fetch [OPTIONS]... +Usage: nestos-assembler fetch --help + nestos-assembler fetch [OPTIONS]... Fetch and import the latest packages. diff --git a/src/cmd-init b/src/cmd-init index d3d58667..9d9c38b2 100755 --- a/src/cmd-init +++ b/src/cmd-init @@ -16,8 +16,8 @@ VARIANT="" print_help() { cat 1>&2 <<'EOF' -Usage: coreos-assembler init --help - coreos-assembler init [--force] [--transient] [--branch BRANCH] +Usage: nestos-assembler init --help + nestos-assembler init [--force] [--transient] [--branch BRANCH] [--commit COMMIT] [-V/--variant VARIANT] [--yumrepos GITREPO] [--yumrepos-branch BRANCH] GITCONFIG [SUBDIR] diff --git a/src/cmd-offline-update b/src/cmd-offline-update index 146b3616..373d70d7 100755 --- a/src/cmd-offline-update +++ b/src/cmd-offline-update @@ -21,8 +21,8 @@ dn=$(dirname "$0") print_help() { cat 1>&2 <