From 94b793b51f47273a0b19e108e4fcf9532b19a37b Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Mon, 6 Apr 2020 11:15:09 -0500 Subject: Include the log file path in the help text. --- cmd/gotop/main.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index 52da589..fc2ac7a 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -81,10 +81,6 @@ Options: --print-paths List out the paths that gotop will look for gotop.conf, layouts, color schemes, and extensions --print-keys Show the keyboard bindings -Colorschemes and layouts that are not built-in are searched for (in order) in: -%s -The first path in this list is always the cwd. - Built-in layouts: default minimal @@ -99,7 +95,14 @@ Colorschemes: solarized16-light monokai vice -`, strings.Join(cpaths, ", ")) + +Colorschemes and layouts that are not built-in are searched for (in order) in: +%s +The first path in this list is always the cwd. + +Log files are stored in %s + +`, strings.Join(cpaths, ", "), filepath.Join(conf.ConfigDir.QueryCacheFolder().Path, logging.LOGFILE)) var err error conf.Colorscheme, err = colorschemes.FromName(conf.ConfigDir, "default") -- cgit v1.2.3 From 7a89a5b26c0ac09ec466c8bba12b7562458e3e7b Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Thu, 9 Apr 2020 13:50:51 -0500 Subject: Update changelog for release --- CHANGELOG.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 853ca62..e1c1432 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 > - **Fixed**: for any bug fixes. > - **Security**: in case of vulnerabilities. -## [3.6.0] - ??? +## PENDING (NOT RELEASED 3.6) ### Added @@ -28,13 +28,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - configdir, logdir, and logfile options in the config file are no longer used. gotop looks for a configuration file, layouts, and colorschemes in the following order: command-line; `pwd`; user-home, and finally a system-wide path. The paths depend on the OS and whether XDG is in use. -## [3.5.1] - ?? +## [3.5.1] - 2020-04-09 + +This is a bug fix release. ### Fixed -- Removes verbose debugging unintentionally left in the code. -- kitchensink referenced by, but not included in binary is now included. +- Removes verbose debugging unintentionally left in the code (#85) +- kitchensink referenced by, but not included in binary is now included (#72) - Safety check prevents uninitialized colorscheme registry use +- Trying to use a non-installed plugin should fail, not silently continue (#77) + +### Changed + +- Improved documentation about installing layouts and colorschemes ## [3.5.0] - 2020-03-06 -- cgit v1.2.3 From 721a587abcb30fd11b9a0a2590524c110adc725c Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Thu, 16 Apr 2020 08:14:13 -0500 Subject: Switch away from Go Plugin API for the time being. --- CHANGELOG.md | 3 +++ cmd/gotop/main.go | 49 ------------------------------------------------- docs/releasing.md | 20 +++++++++++--------- widgets/batterygauge.go | 1 + 4 files changed, 15 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1c1432..d4a1554 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,10 +19,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Adds support for system-wide configurations. This improves support for package maintainers. - Help function to print key bindings +- Help prints locations of config files (color schemes & layouts) +- Help prints location of logs ### Changed - Log files stored in \$XDG_CACHE_HOME; DATA, CONFIG, CACHE, and RUNTIME are the only directories specified by the FreeDesktop spec. +- Extensions are now built with a build tool; this is an interim solution until issues with the Go plugin API are resolved. ### Removed diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index fc2ac7a..4888f07 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -8,7 +8,6 @@ import ( "os" "os/signal" "path/filepath" - "plugin" "strconv" "strings" "syscall" @@ -463,12 +462,6 @@ func run() int { } ly := layout.ParseLayout(lstream) - err = loadExtensions(conf) - if err != nil { - stderrLogger.Print(err) - return 1 - } - if conf.Test { return runTests(conf) } @@ -546,48 +539,6 @@ func getLayout(conf gotop.Config) (io.Reader, error) { } } -func loadExtensions(conf gotop.Config) error { - var hasError bool - for _, ex := range conf.Extensions { - exf := ex + ".so" - fn := exf - folder := conf.ConfigDir.QueryFolderContainsFile(fn) - if folder == nil { - paths := make([]string, 0) - for _, d := range conf.ConfigDir.QueryFolders(configdir.Existing) { - paths = append(paths, d.Path) - } - log.Printf("unable find extension %s in %s", fn, strings.Join(paths, ", ")) - hasError = true - continue - } - fp := filepath.Join(folder.Path, fn) - p, err := plugin.Open(fp) - if err != nil { - hasError = true - log.Printf(err.Error()) - continue - } - init, err := p.Lookup("Init") - if err != nil { - hasError = true - log.Printf(err.Error()) - continue - } - initFunc, ok := init.(func()) - if !ok { - hasError = true - log.Printf(err.Error()) - continue - } - initFunc() - } - if hasError { - return fmt.Errorf("error initializing plugins") - } - return nil -} - func runTests(conf gotop.Config) int { fmt.Printf("PASS") return 0 diff --git a/docs/releasing.md b/docs/releasing.md index d77b6dd..e87e4de 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -6,8 +6,10 @@ Current steps for a release: 3. Tag 4. Push everything 5. When the github workflows complete, finish the draft release and publish. -6. After the [Homebrew](https://github.com/xxxserxxx/homebrew-gotop) and [AUR](https://github.com/xxxserxxx/gotop-linux] projects are done, check out gotop-linux and run `aurpublish aur` and `aurpublish aur-bin` - +6. Wait for the [Homebrew](https://github.com/xxxserxxx/homebrew-gotop) and [AUR](https://github.com/xxxserxxx/gotop-linux] projects to finish building. + 1. check out gotop-linux and run `aurpublish aur` and `aurpublish aur-bin` + 2. update the hashes in the Nix package (see below), test build, push a pull request + 3. notify Homebrew Homebrew is automatically updated. The AUR project still needs secret credentials to aurpublish to the AUR repository, so the final publish step is @@ -18,14 +20,14 @@ Oh, what a tangled web. Nix adds new and interesting complexities to the release. +0. Download the gotop src package; run sha256 on it to get the hash 1. cd to the nixpkgs directory -2. docker run -it --rm --mount type=bind,source="\$(pwd)",target=/mnt nixos/nix sh -3. cd /mnt -4. nix-prefetch-url --unpack https://github.com/xxxserxxx/gotop/archive/v3.3.2.tar.gz -5. Copy the sha256 -6. Update the version and hash in nixpkgs/pkgs/tools/system/gotop/default.nix -8. In docker, install & run vgo2nix to update deps.nix -7. nix-build -A gotop +2. Update the sha256 hash in `pkgs/tools/system/gotop/default.nix` +2. `docker run -it --rm --mount type=bind,source="\$(pwd)",target=/mnt nixos/nix sh` +3. `cd /mnt` +8. install & run vgo2nix to update deps.nix +7. `nix-build -A gotop` +8. When it fails, copy the hash and update the For plugin development: diff --git a/widgets/batterygauge.go b/widgets/batterygauge.go index 534c1cf..d447713 100644 --- a/widgets/batterygauge.go +++ b/widgets/batterygauge.go @@ -12,6 +12,7 @@ import ( . "github.com/xxxserxxx/gotop/v3/termui" ) +// FIXME 3.5.1 is 0% always type BatteryGauge struct { *Gauge metric prometheus.Gauge -- cgit v1.2.3