0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-01-31 21:22:27 +00:00
termux-packages/packages/teleport-tsh/metadata_linux.go.patch
Kevin Williams 0348af9d34 upgpkg(main/teleport-tsh): 15.0.0
Signed-off-by: Kevin Williams <admin@utermux.dev>
2024-02-04 11:36:54 +08:00

57 lines
1.5 KiB
Diff

--- teleport-15.0.0/lib/inventory/metadata/metadata_linux.go
+++ teleport-15.0.0 .mod/lib/inventory/metadata/metadata_linux.go
@@ -21,45 +21,19 @@
package metadata
-// #include <gnu/libc-version.h>
-import "C"
-
import (
- "fmt"
- "strings"
+ "runtime"
+ log "github.com/sirupsen/logrus"
)
-// fetchOSVersion combines the content of '/etc/os-release' to be e.g.
-// "ubuntu 22.04".
+// fetchOSVersion returns "" if not on linux and not on darwin.
func (c *fetchConfig) fetchOSVersion() string {
- // TODO(codingllama): Leverage lib/linux.ParseOSRelease here?
- filename := "/etc/os-release"
- out, err := c.read(filename)
- if err != nil {
- return ""
- }
-
- id := "linux"
- versionID := "(unknown)"
- for _, line := range strings.Split(strings.TrimSpace(out), "\n") {
- key, value, found := strings.Cut(line, "=")
- if !found {
- continue
- }
-
- switch key {
- case "ID":
- id = strings.Trim(value, `"`)
- case "VERSION_ID":
- versionID = strings.Trim(value, `"`)
- }
- }
-
- return fmt.Sprintf("%s %s", id, versionID)
+ log.Warningf("fetchOSVersion is not implemented for %s", runtime.GOOS)
+ return ""
}
-// fetchGlibcVersion returns the glibc version string as returned by
-// gnu_get_libc_version.
+// fetchGlibcVersion returns "" if not on linux and not on darwin.
func (c *fetchConfig) fetchGlibcVersion() string {
- return C.GoString(C.gnu_get_libc_version())
+ log.Warningf("fetchGlibcVersion is not implemented for %s", runtime.GOOS)
+ return ""
}