MCPcopy Create free account
hub / github.com/coder/envbuilder / libraryDirectoryPath

Function libraryDirectoryPath

internal/ebutil/libs.go:28–37  ·  view source on GitHub ↗

libraryDirectoryPath returns the library directory. It returns a multiarch directory if the distribution is Debian or a derivative. Based on https://github.com/NVIDIA/libnvidia-container/blob/v1.15.0/src/nvc_container.c#L152-L165

(m mounter)

Source from the content-addressed store, hash-verified

26//
27// Based on https://github.com/NVIDIA/libnvidia-container/blob/v1.15.0/src/nvc_container.c#L152-L165
28func libraryDirectoryPath(m mounter) (string, error) {
29 // Debian and its derivatives use a multiarch directory scheme.
30 if _, err := m.Stat(debianVersionFile); err != nil && !errors.Is(err, os.ErrNotExist) {
31 return "", fmt.Errorf("check if debian: %w", err)
32 } else if err == nil {
33 return usrLibMultiarchDir, nil
34 }
35
36 return usrLibDir, nil
37}
38
39// libraryDirectorySymlinks returns a mapping of each library (basename) with a
40// list of their symlinks (basename). Libraries with no symlinks do not appear

Callers 1

tempRemountFunction · 0.85

Calls 1

StatMethod · 0.65

Tested by

no test coverage detected