From 1130fb028dace3c6be7e631339bfb909adb730b2 Mon Sep 17 00:00:00 2001 From: brent saner Date: Thu, 18 Dec 2025 04:54:11 -0500 Subject: [PATCH] v1.15.1 UPDATED: * Dep/go ver bumps * gated some WIP stuff --- {pdsh => .pdsh.wip}/docs.go | 0 {pdsh => .pdsh.wip}/dshgroup/consts.go | 0 {pdsh => .pdsh.wip}/dshgroup/docs.go | 0 {pdsh => .pdsh.wip}/dshgroup/errs.go | 0 .../dshgroup/funcs_dshgrouplister.go | 0 {pdsh => .pdsh.wip}/dshgroup/funcs_dshgrp.go | 0 .../dshgroup/funcs_dshgrp_test.go | 0 .../dshgroup/funcs_dshgrpgenerator.go | 0 .../dshgroup/funcs_ptrnparseerr.go | 0 {pdsh => .pdsh.wip}/dshgroup/types.go | 0 {pdsh => .pdsh.wip}/genders/docs.go | 0 {pdsh => .pdsh.wip}/machines/docs.go | 0 {pdsh => .pdsh.wip}/netgroup/docs.go | 0 {pdsh => .pdsh.wip}/nodeupdown/docs.go | 0 {pdsh => .pdsh.wip}/slurm/docs.go | 0 {pdsh => .pdsh.wip}/torque/docs.go | 0 {pdsh => .pdsh.wip}/types.go | 0 {pdsh => .pdsh.wip}/wcoll/docs.go | 0 TODO | 11 ---- envs/.osenvs.WIP/TODO | 30 ++++++++++ envs/.osenvs.WIP/doc.go | 7 +++ envs/.osenvs.WIP/types.go | 56 +++++++++++++++++++ go.mod | 14 ++--- go.sum | 24 ++++---- 24 files changed, 112 insertions(+), 30 deletions(-) rename {pdsh => .pdsh.wip}/docs.go (100%) rename {pdsh => .pdsh.wip}/dshgroup/consts.go (100%) rename {pdsh => .pdsh.wip}/dshgroup/docs.go (100%) rename {pdsh => .pdsh.wip}/dshgroup/errs.go (100%) rename {pdsh => .pdsh.wip}/dshgroup/funcs_dshgrouplister.go (100%) rename {pdsh => .pdsh.wip}/dshgroup/funcs_dshgrp.go (100%) rename {pdsh => .pdsh.wip}/dshgroup/funcs_dshgrp_test.go (100%) rename {pdsh => .pdsh.wip}/dshgroup/funcs_dshgrpgenerator.go (100%) rename {pdsh => .pdsh.wip}/dshgroup/funcs_ptrnparseerr.go (100%) rename {pdsh => .pdsh.wip}/dshgroup/types.go (100%) rename {pdsh => .pdsh.wip}/genders/docs.go (100%) rename {pdsh => .pdsh.wip}/machines/docs.go (100%) rename {pdsh => .pdsh.wip}/netgroup/docs.go (100%) rename {pdsh => .pdsh.wip}/nodeupdown/docs.go (100%) rename {pdsh => .pdsh.wip}/slurm/docs.go (100%) rename {pdsh => .pdsh.wip}/torque/docs.go (100%) rename {pdsh => .pdsh.wip}/types.go (100%) rename {pdsh => .pdsh.wip}/wcoll/docs.go (100%) create mode 100644 envs/.osenvs.WIP/TODO create mode 100644 envs/.osenvs.WIP/doc.go create mode 100644 envs/.osenvs.WIP/types.go diff --git a/pdsh/docs.go b/.pdsh.wip/docs.go similarity index 100% rename from pdsh/docs.go rename to .pdsh.wip/docs.go diff --git a/pdsh/dshgroup/consts.go b/.pdsh.wip/dshgroup/consts.go similarity index 100% rename from pdsh/dshgroup/consts.go rename to .pdsh.wip/dshgroup/consts.go diff --git a/pdsh/dshgroup/docs.go b/.pdsh.wip/dshgroup/docs.go similarity index 100% rename from pdsh/dshgroup/docs.go rename to .pdsh.wip/dshgroup/docs.go diff --git a/pdsh/dshgroup/errs.go b/.pdsh.wip/dshgroup/errs.go similarity index 100% rename from pdsh/dshgroup/errs.go rename to .pdsh.wip/dshgroup/errs.go diff --git a/pdsh/dshgroup/funcs_dshgrouplister.go b/.pdsh.wip/dshgroup/funcs_dshgrouplister.go similarity index 100% rename from pdsh/dshgroup/funcs_dshgrouplister.go rename to .pdsh.wip/dshgroup/funcs_dshgrouplister.go diff --git a/pdsh/dshgroup/funcs_dshgrp.go b/.pdsh.wip/dshgroup/funcs_dshgrp.go similarity index 100% rename from pdsh/dshgroup/funcs_dshgrp.go rename to .pdsh.wip/dshgroup/funcs_dshgrp.go diff --git a/pdsh/dshgroup/funcs_dshgrp_test.go b/.pdsh.wip/dshgroup/funcs_dshgrp_test.go similarity index 100% rename from pdsh/dshgroup/funcs_dshgrp_test.go rename to .pdsh.wip/dshgroup/funcs_dshgrp_test.go diff --git a/pdsh/dshgroup/funcs_dshgrpgenerator.go b/.pdsh.wip/dshgroup/funcs_dshgrpgenerator.go similarity index 100% rename from pdsh/dshgroup/funcs_dshgrpgenerator.go rename to .pdsh.wip/dshgroup/funcs_dshgrpgenerator.go diff --git a/pdsh/dshgroup/funcs_ptrnparseerr.go b/.pdsh.wip/dshgroup/funcs_ptrnparseerr.go similarity index 100% rename from pdsh/dshgroup/funcs_ptrnparseerr.go rename to .pdsh.wip/dshgroup/funcs_ptrnparseerr.go diff --git a/pdsh/dshgroup/types.go b/.pdsh.wip/dshgroup/types.go similarity index 100% rename from pdsh/dshgroup/types.go rename to .pdsh.wip/dshgroup/types.go diff --git a/pdsh/genders/docs.go b/.pdsh.wip/genders/docs.go similarity index 100% rename from pdsh/genders/docs.go rename to .pdsh.wip/genders/docs.go diff --git a/pdsh/machines/docs.go b/.pdsh.wip/machines/docs.go similarity index 100% rename from pdsh/machines/docs.go rename to .pdsh.wip/machines/docs.go diff --git a/pdsh/netgroup/docs.go b/.pdsh.wip/netgroup/docs.go similarity index 100% rename from pdsh/netgroup/docs.go rename to .pdsh.wip/netgroup/docs.go diff --git a/pdsh/nodeupdown/docs.go b/.pdsh.wip/nodeupdown/docs.go similarity index 100% rename from pdsh/nodeupdown/docs.go rename to .pdsh.wip/nodeupdown/docs.go diff --git a/pdsh/slurm/docs.go b/.pdsh.wip/slurm/docs.go similarity index 100% rename from pdsh/slurm/docs.go rename to .pdsh.wip/slurm/docs.go diff --git a/pdsh/torque/docs.go b/.pdsh.wip/torque/docs.go similarity index 100% rename from pdsh/torque/docs.go rename to .pdsh.wip/torque/docs.go diff --git a/pdsh/types.go b/.pdsh.wip/types.go similarity index 100% rename from pdsh/types.go rename to .pdsh.wip/types.go diff --git a/pdsh/wcoll/docs.go b/.pdsh.wip/wcoll/docs.go similarity index 100% rename from pdsh/wcoll/docs.go rename to .pdsh.wip/wcoll/docs.go diff --git a/TODO b/TODO index fe955b6..14ce516 100644 --- a/TODO +++ b/TODO @@ -12,17 +12,6 @@ - constants/vars for errors - func and struct to return segregated system-level env vars vs. user env vars (mostly usable on windows) (see envs/.TODO.go.UNFINISHED) --- https://www3.ntu.edu.sg/home/ehchua/programming/howto/Environment_Variables.html --- windows: ---- https://docs.microsoft.com/en-us/windows/deployment/usmt/usmt-recognized-environment-variables ---- https://pureinfotech.com/list-environment-variables-windows-10/ ---- https://gist.github.com/RebeccaWhit3/5dad8627b8227142e1bea432db3f8824 ---- https://ss64.com/nt/syntax-variables.html --- linux/XDG: ---- https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html ---- https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html --- macOS: ---- https://ss64.com/osx/syntax-env_vars.html - validator for windows usernames, domains, etc. (for *NIX, https://unix.stackexchange.com/a/435120/284004) -- https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/naming-conventions-for-computer-domain-site-ou diff --git a/envs/.osenvs.WIP/TODO b/envs/.osenvs.WIP/TODO new file mode 100644 index 0000000..4c131fb --- /dev/null +++ b/envs/.osenvs.WIP/TODO @@ -0,0 +1,30 @@ +macOS: +HOME +LOGNAME +OLDPWD +PATH +PWD +SHELL +SHLVL +SSH_CLIENT +SSH_CONNECTION +SSH_TTY +TERM +TMPDIR +USER +_ +e.g. +HOME=/Users/bts +LOGNAME=bts +OLDPWD=/Users/bts +PATH=/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin +PWD=/Users/bts +SHELL=/bin/zsh +SHLVL=1 +SSH_CLIENT=192.168.2.99 39690 22 +SSH_CONNECTION=192.168.2.99 39690 192.168.2.148 22 +SSH_TTY=/dev/ttys000 +TERM=xterm-256color +TMPDIR=/var/folders/qv/bm6dlyd94x5fs6qpkfpj0jsr0000gq/T/ +USER=bts +_=/usr/bin/env diff --git a/envs/.osenvs.WIP/doc.go b/envs/.osenvs.WIP/doc.go new file mode 100644 index 0000000..4103b72 --- /dev/null +++ b/envs/.osenvs.WIP/doc.go @@ -0,0 +1,7 @@ +/* +Package osenvs contains information (and, in some cases, defaults and associated methods) for +[environment variables] ("env vars") as provided by/as part of the OS. + +[environment variables]: https://www3.ntu.edu.sg/home/ehchua/programming/howto/Environment_Variables.html +*/ +package osenvs diff --git a/envs/.osenvs.WIP/types.go b/envs/.osenvs.WIP/types.go new file mode 100644 index 0000000..f84c2a9 --- /dev/null +++ b/envs/.osenvs.WIP/types.go @@ -0,0 +1,56 @@ +package osenvs + +type ( + /* + AppleEnv are default environment variables found in all macOS instances. + + See also the [ss64 article]. + + macOS also has [POSIXEnv] env vars. + + [ss64 article]: https://ss64.com/osx/syntax-env_vars.html + */ + AppleEnv string + /* + MSEnv are default environment variables found in Windows instances. + + These include: + + * [USMT environment variables] + * ONLY the [Environment Variables] for Poweshell + ** Thus no Powershell ["Automatic variables"] or ["Preference variables"] + * standard system environment variables and user environment variables + + See also the [ss64 article] and the [compiled Windows 10 list] and [Windows 10/11 list]. + + [USMT environment variables]: https://docs.microsoft.com/en-us/windows/deployment/usmt/usmt-recognized-environment-variables + [Environment Variables]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_environment_variables?view=powershell-7.5 + ["Automatic variables"]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables + ["Preference variables"]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables + [ss64 article]: https://ss64.com/nt/syntax-variables.html + [compiled Windows 10 list]: https://gist.github.com/RebeccaWhit3/5dad8627b8227142e1bea432db3f8824 + [Windows 10/11 list]: https://pureinfotech.com/list-environment-variables-windows-10/ + */ + MSEnv string + /* + POSIXEnv are environment variables defined by/in [POSIX.1-2024] § [8. Environment Variables]. + + [POSIX.1-2024]: https://pubs.opengroup.org/onlinepubs/9799919799/ + [8. Environment Variables]: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.html + */ + POSIXEnv string + /* + XDGEnv are environment variables defined by the [FreeDesktop] [spec] for the + [XDG Base Directory Specification] § [3 Environment Variables]. + + Generally these are only found/expected on Linux, and only a subset of them at that. + + Linux also has [POSIXEnv] env vars. + + [FreeDesktop]: https://www.freedesktop.org/wiki/ + [spec]: https://specifications.freedesktop.org/ + [XDG Base Directory Specification]: https://specifications.freedesktop.org/basedir/latest/#variables + [3 Environment Variables]: https://specifications.freedesktop.org/basedir/latest/#variables + */ + XDGEnv string +) diff --git a/go.mod b/go.mod index b58ca33..4379fcd 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,17 @@ module r00t2.io/sysutils -go 1.24.5 +go 1.25 require ( github.com/davecgh/go-spew v1.1.1 github.com/djherbis/times v1.6.0 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/shirou/gopsutil/v3 v3.24.5 - github.com/shirou/gopsutil/v4 v4.25.10 - golang.org/x/sync v0.17.0 - golang.org/x/sys v0.37.0 + github.com/shirou/gopsutil/v4 v4.25.11 + golang.org/x/sync v0.19.0 + golang.org/x/sys v0.39.0 honnef.co/go/augeas v0.0.0-20161110001225-ca62e35ed6b8 - r00t2.io/goutils v1.10.3 + r00t2.io/goutils v1.14.0 ) require ( @@ -20,7 +20,7 @@ require ( github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/shoenig/go-m1cpu v0.1.7 // indirect - github.com/tklauser/go-sysconf v0.3.15 // indirect - github.com/tklauser/numcpus v0.10.0 // indirect + github.com/tklauser/go-sysconf v0.3.16 // indirect + github.com/tklauser/numcpus v0.11.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect ) diff --git a/go.sum b/go.sum index 5b50af0..3b3b246 100644 --- a/go.sum +++ b/go.sum @@ -19,31 +19,31 @@ github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= -github.com/shirou/gopsutil/v4 v4.25.10 h1:at8lk/5T1OgtuCp+AwrDofFRjnvosn0nkN2OLQ6g8tA= -github.com/shirou/gopsutil/v4 v4.25.10/go.mod h1:+kSwyC8DRUD9XXEHCAFjK+0nuArFJM0lva+StQAcskM= +github.com/shirou/gopsutil/v4 v4.25.11 h1:X53gB7muL9Gnwwo2evPSE+SfOrltMoR6V3xJAXZILTY= +github.com/shirou/gopsutil/v4 v4.25.11/go.mod h1:EivAfP5x2EhLp2ovdpKSozecVXn1TmuG7SMzs/Wh4PU= github.com/shoenig/go-m1cpu v0.1.7 h1:C76Yd0ObKR82W4vhfjZiCp0HxcSZ8Nqd84v+HZ0qyI0= github.com/shoenig/go-m1cpu v0.1.7/go.mod h1:KkDOw6m3ZJQAPHbrzkZki4hnx+pDRR1Lo+ldA56wD5w= github.com/shoenig/test v1.7.0 h1:eWcHtTXa6QLnBvm0jgEabMRN/uJ4DMV3M8xUGgRkZmk= github.com/shoenig/test v1.7.0/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4= -github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4= -github.com/tklauser/numcpus v0.10.0 h1:18njr6LDBk1zuna922MgdjQuJFjrdppsZG60sHGfjso= -github.com/tklauser/numcpus v0.10.0/go.mod h1:BiTKazU708GQTYF4mB+cmlpT2Is1gLk7XVuEeem8LsQ= +github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA= +github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI= +github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw= +github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= -golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= +golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= -golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= +golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/augeas v0.0.0-20161110001225-ca62e35ed6b8 h1:FW42yWB1sGClqswyHIB68wo0+oPrav1IuQ+Tdy8Qp8E= honnef.co/go/augeas v0.0.0-20161110001225-ca62e35ed6b8/go.mod h1:44w9OfBSQ9l3o59rc2w3AnABtE44bmtNnRMNC7z+oKE= -r00t2.io/goutils v1.10.3 h1:GmEtsM/nrrVWooYJllXDRsgInobEinv2dn5ccU4zGAA= -r00t2.io/goutils v1.10.3/go.mod h1:76AxpXUeL10uFklxRB11kQsrtj2AKiNm8AwG1bNoBCA= +r00t2.io/goutils v1.14.0 h1:mvEiJLrTy/hx7ZX2TzCm/y0be2TcTu822m++qsSQGLc= +r00t2.io/goutils v1.14.0/go.mod h1:68jkIl/QYxEEVmVz8k1a7QI9vAA4faQUIcjSHSbtgHw=