InputAddressedPaths is the input-addressed path in /nix/store It is also the key in the BinaryCache for this package
()
| 575 | // InputAddressedPaths is the input-addressed path in /nix/store |
| 576 | // It is also the key in the BinaryCache for this package |
| 577 | func (p *Package) InputAddressedPaths() ([]string, error) { |
| 578 | if inCache, err := p.IsInBinaryCache(); err != nil { |
| 579 | return nil, err |
| 580 | } else if !inCache { |
| 581 | return nil, |
| 582 | errors.Errorf("Package %q cannot be fetched from binary cache store", p.Raw) |
| 583 | } |
| 584 | |
| 585 | entry, err := p.lockfile.Resolve(p.LockfileKey()) |
| 586 | if err != nil { |
| 587 | return nil, err |
| 588 | } |
| 589 | |
| 590 | sysInfo := entry.Systems[nix.System()] |
| 591 | outputs := sysInfo.DefaultOutputs() |
| 592 | |
| 593 | paths := []string{} |
| 594 | for _, output := range outputs { |
| 595 | p, err := p.InputAddressedPathForOutput(output.Name) |
| 596 | if err != nil { |
| 597 | return nil, err |
| 598 | } |
| 599 | paths = append(paths, p) |
| 600 | } |
| 601 | return paths, nil |
| 602 | } |
| 603 | |
| 604 | func (p *Package) InputAddressedPathForOutput(output string) (string, error) { |
| 605 | if inCache, err := p.IsInBinaryCache(); err != nil { |
no test coverage detected