systemRelativeAttrPath strips any leading "legacyPackages. " prefix from a package's attribute path.
(pkg *devpkg.Package)
| 218 | // systemRelativeAttrPath strips any leading "legacyPackages.<system>" prefix |
| 219 | // from a package's attribute path. |
| 220 | func (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. |
no test coverage detected