MCPcopy Index your code
hub / github.com/aptly-dev/aptly / PoolDirectory

Method PoolDirectory

deb/package.go:714–735  ·  view source on GitHub ↗

PoolDirectory returns directory in package pool of published repository for this package files

()

Source from the content-addressed store, hash-verified

712
713// PoolDirectory returns directory in package pool of published repository for this package files
714func (p *Package) PoolDirectory() (string, error) {
715 source := p.Source
716 if source == "" {
717 source = p.Name
718 } else if pos := strings.Index(source, "("); pos != -1 {
719 source = strings.TrimSpace(source[:pos])
720 }
721
722 if len(source) < 2 {
723 return "", fmt.Errorf("package source %s too short", source)
724 }
725
726 var subdir string
727 if strings.HasPrefix(source, "lib") {
728 subdir = source[:4]
729 } else {
730 subdir = source[:1]
731
732 }
733
734 return filepath.Join(subdir, source), nil
735}
736
737// PackageDownloadTask is a element of download queue for the package
738type PackageDownloadTask struct {

Callers 4

PublishMethod · 0.80
TestPoolDirectoryMethod · 0.80

Calls 1

HasPrefixMethod · 0.65

Tested by 1

TestPoolDirectoryMethod · 0.64