pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

gotop: sync with upstream changes.



Module Name:	pkgsrc-wip
Committed By:	Santhosh Raju <fox%NetBSD.org@localhost>
Pushed By:	fox
Date:		Sun May 10 09:51:51 2026 +0200
Changeset:	dd6ca0979d06888895ac52df84226a394ea31b3b

Modified Files:
	gotop/Makefile
	gotop/distinfo
Added Files:
	gotop/patches/patch-logging_logging__dup2.go
	gotop/patches/patch-widgets_proc__netbsd.go

Log Message:
gotop: sync with upstream changes.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=dd6ca0979d06888895ac52df84226a394ea31b3b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 gotop/Makefile                               |  4 +-
 gotop/distinfo                               |  8 +--
 gotop/patches/patch-logging_logging__dup2.go | 12 +++++
 gotop/patches/patch-widgets_proc__netbsd.go  | 80 ++++++++++++++++++++++++++++
 4 files changed, 99 insertions(+), 5 deletions(-)

diffs:
diff --git a/gotop/Makefile b/gotop/Makefile
index 3d05c18d92..8de34df29e 100644
--- a/gotop/Makefile
+++ b/gotop/Makefile
@@ -1,10 +1,10 @@
 # $NetBSD$
 
 DISTNAME=	gotop-4.2.0
-MASTER_SITES=	${MASTER_SITE_GITHUB:=fraggerfox/}
+MASTER_SITES=	${MASTER_SITE_GITHUB:=xxxserxxx/}
 CATEGORIES=	sysutils
 DIST_SUBDIR=    ${PKGBASE}
-GITHUB_TAG=	42e8669ece7e2259ec0055544765a1872e9ac975
+GITHUB_TAG=	2872dab02cffc1dcc621b87a0a0f1dc4dac2ec6e
 
 MAINTAINER=	fox%NetBSD.org@localhost
 HOMEPAGE=	https://github.com/xxxserxxx/gotop
diff --git a/gotop/distinfo b/gotop/distinfo
index f2df7553d3..18d89dc760 100644
--- a/gotop/distinfo
+++ b/gotop/distinfo
@@ -453,9 +453,9 @@ Size (gotop/gopkg.in_yaml.v3_@v_v3.0.1.mod) = 95 bytes
 BLAKE2s (gotop/gopkg.in_yaml.v3_@v_v3.0.1.zip) = 2e80fa896e65b1ae160400012c71aeac70e22a31cac82ec4921c85a93d65774c
 SHA512 (gotop/gopkg.in_yaml.v3_@v_v3.0.1.zip) = d57b0d42c71ad6503415e42979b51b0dc7f6344072c728ab2e3d4bab88da7b7d775e7f261868909f990f6b44aed6c533966c97bbe333a0acd65fc8bac9d1d4ff
 Size (gotop/gopkg.in_yaml.v3_@v_v3.0.1.zip) = 104623 bytes
-BLAKE2s (gotop/gotop-4.2.0-42e8669ece7e2259ec0055544765a1872e9ac975.tar.gz) = b5da0b8e7d75cd5e9d6214d47d0d81da3478b1c030bacc30cd6116bba8add793
-SHA512 (gotop/gotop-4.2.0-42e8669ece7e2259ec0055544765a1872e9ac975.tar.gz) = 2e24062b7c9b12955eadf24a8a5143e4e9cf7b2c6406f1532dc49921bc92eb79aed211df72cac6ecb54908f62e18fac7dce76ef8b6ae08e2d7a18f80d9c0917e
-Size (gotop/gotop-4.2.0-42e8669ece7e2259ec0055544765a1872e9ac975.tar.gz) = 3360407 bytes
+BLAKE2s (gotop/gotop-4.2.0-2872dab02cffc1dcc621b87a0a0f1dc4dac2ec6e.tar.gz) = 9c1ceefcf4272c77ecfca90f8ef1f709af88dde3ed7ea2d0b5c6c59a53121df5
+SHA512 (gotop/gotop-4.2.0-2872dab02cffc1dcc621b87a0a0f1dc4dac2ec6e.tar.gz) = a2e444b2b0fa9d35ad3301372465953eae5dea01b36226a3ac434559d6bf2af47f609b495d52fea0d4399720b779958a178f678aa07bf96cb3d32c4a42dea39e
+Size (gotop/gotop-4.2.0-2872dab02cffc1dcc621b87a0a0f1dc4dac2ec6e.tar.gz) = 3360080 bytes
 BLAKE2s (gotop/howett.net_plist_@v_v0.0.0-20181124034731-591f970eefbb.mod) = e05ad6b2f9fd946987d8eaa4242f362ac780501f329c613823246f7d743357d4
 SHA512 (gotop/howett.net_plist_@v_v0.0.0-20181124034731-591f970eefbb.mod) = d21a325b837cb099226a68404f6976318a7f0b8af68c023b1eb85436bfc9dd9c877c9ffba87d0f27d5e9aac606121688c069989a0c2f3ba6d2895baa0759d022
 Size (gotop/howett.net_plist_@v_v0.0.0-20181124034731-591f970eefbb.mod) = 222 bytes
@@ -465,3 +465,5 @@ Size (gotop/howett.net_plist_@v_v1.0.0.mod) = 218 bytes
 BLAKE2s (gotop/howett.net_plist_@v_v1.0.0.zip) = 6c0b133ce84d8994a7c188e83ce7bae86228b60829ec29211d1a8f1a446cb945
 SHA512 (gotop/howett.net_plist_@v_v1.0.0.zip) = 7d63e5489b2b007736952dd57855fce61e8bbb38599f45d56d846ca23cb65e2db3070a2af39647c4d02f228511c2d44338904e2e83cb156df6f5aefdfa6e1aaf
 Size (gotop/howett.net_plist_@v_v1.0.0.zip) = 71680 bytes
+SHA1 (patch-logging_logging__dup2.go) = 66c00d1bcabefb6cc4e75b7ae5241c4ea4037703
+SHA1 (patch-widgets_proc__netbsd.go) = 0e41c69b4a82a8fe7944c7a8b0350bd407d041c1
diff --git a/gotop/patches/patch-logging_logging__dup2.go b/gotop/patches/patch-logging_logging__dup2.go
new file mode 100644
index 0000000000..5bb8bec5f6
--- /dev/null
+++ b/gotop/patches/patch-logging_logging__dup2.go
@@ -0,0 +1,12 @@
+$NetBSD$
+
+Add support for NetBSD.
+
+--- logging/logging_dup2.go.orig	2026-05-06 15:39:51.000000000 +0000
++++ logging/logging_dup2.go
+@@ -1,4 +1,4 @@
+-// +build linux,!arm64,!riscv64 openbsd,!arm64 freebsd darwin
++// +build linux,!arm64,!riscv64 openbsd,!arm64 freebsd darwin netbsd
+ 
+ package logging
+ 
diff --git a/gotop/patches/patch-widgets_proc__netbsd.go b/gotop/patches/patch-widgets_proc__netbsd.go
new file mode 100644
index 0000000000..e0dd863605
--- /dev/null
+++ b/gotop/patches/patch-widgets_proc__netbsd.go
@@ -0,0 +1,80 @@
+$NetBSD$
+
+Add support for NetBSD.
+
+--- widgets/proc_netbsd.go.orig	2026-05-07 03:46:12.914271125 +0000
++++ widgets/proc_netbsd.go
+@@ -0,0 +1,73 @@
++// +build netbsd
++
++package widgets
++
++import (
++	"fmt"
++	"log"
++	"os/exec"
++	"strconv"
++	"strings"
++
++	"github.com/xxxserxxx/gotop/v4/utils"
++)
++
++const (
++	// Define column widths for ps output used in Procs()
++	five  = "12345"
++	ten   = five + five
++	fifty = ten + ten + ten + ten + ten
++)
++
++func getProcs() ([]Proc, error) {
++	// NetBSD ps does not support comma-separated keywords in a single -o argument:
++	// it treats everything after the first '=' as the column header, so commas are
++	// included in the header rather than parsed as keyword separators.
++	// Use separate -o flags instead to get all five columns.
++	//
++	// Column layout with these headers (0-indexed):
++	//   [0:10]   pid  (10 chars, right-justified)
++	//   [11:61]  comm (50 chars, left-justified)
++	//   [62:67]  pcpu (5 chars, right-justified)
++	//   [68:73]  pmem (5 chars, right-justified)
++	//   [74:]    args
++	output, err := exec.Command("ps", "-caxo", "pid="+ten,
++		"-o", "comm="+fifty,
++		"-o", "pcpu="+five,
++		"-o", "pmem="+five,
++		"-o", "args").Output()
++	if err != nil {
++		return nil, fmt.Errorf("%s", tr.Value("widget.proc.err.ps", err.Error()))
++	}
++
++	// converts to []string and removes the header
++	linesOfProcStrings := strings.Split(strings.TrimSpace(string(output)), "\n")[1:]
++	procs := []Proc{}
++	for _, line := range linesOfProcStrings {
++		if len(line) < 74 {
++			continue
++		}
++		pid, err := strconv.Atoi(strings.TrimSpace(line[0:10]))
++		if err != nil {
++			log.Println(tr.Value("widget.proc.err.pidconv", err.Error(), line))
++		}
++		cpu, err := strconv.ParseFloat(utils.ConvertLocalizedString(strings.TrimSpace(line[62:67])), 64)
++		if err != nil {
++			log.Println(tr.Value("widget.proc.err.cpuconv", err.Error(), line))
++		}
++		mem, err := strconv.ParseFloat(utils.ConvertLocalizedString(strings.TrimSpace(line[68:73])), 64)
++		if err != nil {
++			log.Println(tr.Value("widget.proc.err.memconv", err.Error(), line))
++		}
++		proc := Proc{
++			Pid:         pid,
++			CommandName: strings.TrimSpace(line[11:61]),
++			CPU:         cpu,
++			Mem:         mem,
++			FullCommand: strings.TrimSpace(line[74:]),
++		}
++		procs = append(procs, proc)
++	}
++
++	return procs, nil
++}


Home | Main Index | Thread Index | Old Index