MCPcopy Create free account
hub / github.com/aptly-dev/aptly / LinkFromPool

Method LinkFromPool

deb/package.go:689–711  ·  view source on GitHub ↗

LinkFromPool links package file from pool to dist's pool location

(publishedStorage aptly.PublishedStorage, packagePool aptly.PackagePool,
	prefix, relPath string, force bool)

Source from the content-addressed store, hash-verified

687
688// LinkFromPool links package file from pool to dist's pool location
689func (p *Package) LinkFromPool(publishedStorage aptly.PublishedStorage, packagePool aptly.PackagePool,
690 prefix, relPath string, force bool) error {
691
692 for i, f := range p.Files() {
693 sourcePoolPath, err := f.GetPoolPath(packagePool)
694 if err != nil {
695 return err
696 }
697
698 err = publishedStorage.LinkFromPool(prefix, relPath, f.Filename, packagePool, sourcePoolPath, f.Checksums, force)
699 if err != nil {
700 return err
701 }
702
703 if p.IsSource {
704 p.Extra()["Directory"] = relPath
705 } else {
706 p.Files()[i].downloadPath = relPath
707 }
708 }
709
710 return nil
711}
712
713// PoolDirectory returns directory in package pool of published repository for this package files
714func (p *Package) PoolDirectory() (string, error) {

Callers

nothing calls this directly

Calls 4

FilesMethod · 0.95
ExtraMethod · 0.95
GetPoolPathMethod · 0.80
LinkFromPoolMethod · 0.65

Tested by

no test coverage detected