small pixel drawing of a pufferfish zoa

Rethink os_release implementation
Jes Olson j3s@c3f.net
Sat, 01 Oct 2022 15:33:32 -0500
commit

2324a23f1c9047bfe211dfa9a331ac1a98bc9c54

parent

fc9845422d3c58f437daaff29fdf9f8b98553d36

2 files changed, 11 insertions(+), 9 deletions(-)

jump to
M buildbuild

@@ -5,4 +5,6 @@ sudo cp zoa /usr/local/bin/

if [ "$(hostname)" = "nostromo" ]; then scp zoa j3s.sh:/var/www/trash.j3s.sh/zoa + GOOS=openbsd CGO_ENABLED=0 go build + scp zoa j3s.sh:/var/www/trash.j3s.sh/zoa-openbsd fi
M env/env.goenv/env.go

@@ -66,17 +66,17 @@ // and are useful for identifying specific Linux distros, or their versions.

// // if you rely on these variables, I highly suggest checking for their // existence with test -z before utilizing them. there be no standards here. + env = expand.ListEnviron(path, // normie shit + uname_os, uname_hostname, uname_release, uname_arch) // uname-derivated env vars - os_release, err := getOSRelease() - if err != nil { - return env, err - } - osReleaseID := envString("OS_RELEASE_ID", os_release.ID) - osReleaseVersionID := envString("OS_RELEASE_VERSION_ID", os_release.VersionID) + // os_release, err := getOSRelease() + // if err != nil { + // return env, err + // } else { + // env = expand.ListEnviron(env.Get, envString("OS_RELEASE_ID", os_release.ID)) + // env += envString("OS_RELEASE_VERSION_ID", os_release.VersionID) + // } - env = expand.ListEnviron(path, // normie shit - uname_os, uname_hostname, uname_release, uname_arch, // uname-derivated env vars - osReleaseID, osReleaseVersionID) // /etc/os-release return env, nil }