MCPcopy Index your code
hub / github.com/jetify-com/devbox / systemRelativeAttrPath

Method systemRelativeAttrPath

internal/shellgen/flake_plan.go:220–230  ·  view source on GitHub ↗

systemRelativeAttrPath strips any leading "legacyPackages. " prefix from a package's attribute path.

(pkg *devpkg.Package)

Source from the content-addressed store, hash-verified

218// systemRelativeAttrPath strips any leading "legacyPackages.<system>" prefix
219// from a package's attribute path.
220func (g *glibcPatchFlake) systemRelativeAttrPath(pkg *devpkg.Package) (string, error) {
221 installable, err := pkg.FlakeInstallable()
222 if err != nil {
223 return "", err
224 }
225 if strings.HasPrefix(installable.AttrPath, "legacyPackages") {
226 // Remove the legacyPackages.<system> prefix.
227 return strings.SplitN(installable.AttrPath, ".", 3)[2], nil
228 }
229 return installable.AttrPath, nil
230}
231
232// inputRelativeAttrPath joins the package's corresponding flake input with its
233// attribute path.

Callers 3

newGlibcPatchFlakeFunction · 0.95
addOutputMethod · 0.95
inputRelativeAttrPathMethod · 0.95

Calls 1

FlakeInstallableMethod · 0.80

Tested by

no test coverage detected