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

Method LoadComplete

deb/publish.go:1408–1448  ·  view source on GitHub ↗

LoadComplete loads complete information on the sources of the repo *and* their packages

(repo *PublishedRepo, collectionFactory *CollectionFactory)

Source from the content-addressed store, hash-verified

1406
1407// LoadComplete loads complete information on the sources of the repo *and* their packages
1408func (collection *PublishedRepoCollection) LoadComplete(repo *PublishedRepo, collectionFactory *CollectionFactory) (err error) {
1409 _ = collection.LoadShallow(repo, collectionFactory)
1410
1411 if repo.SourceKind == SourceSnapshot {
1412 for _, item := range repo.sourceItems {
1413 err = collectionFactory.SnapshotCollection().LoadComplete(item.snapshot)
1414 if err != nil {
1415 return
1416 }
1417 }
1418 } else if repo.SourceKind == SourceLocalRepo {
1419 for component, item := range repo.sourceItems {
1420 err = collectionFactory.LocalRepoCollection().LoadComplete(item.localRepo)
1421 if err != nil {
1422 return
1423 }
1424
1425 var encoded []byte
1426 encoded, err = collection.db.Get(repo.RefKey(component))
1427 if err != nil {
1428 // < 0.6 saving w/o component name
1429 if err == database.ErrNotFound && len(repo.Sources) == 1 {
1430 encoded, err = collection.db.Get(repo.RefKey(""))
1431 }
1432
1433 if err != nil {
1434 return
1435 }
1436 }
1437
1438 err = item.packageRefs.Decode(encoded)
1439 if err != nil {
1440 return
1441 }
1442 }
1443 } else {
1444 panic("unknown SourceKind")
1445 }
1446
1447 return
1448}
1449
1450// ByStoragePrefixDistribution looks up repository by storage, prefix & distribution
1451func (collection *PublishedRepoCollection) ByStoragePrefixDistribution(storage, prefix, distribution string) (*PublishedRepo, error) {

Callers 4

TestLoadPre0_6Method · 0.95
RemoveMethod · 0.95
UpdateMethod · 0.45

Calls 6

LoadShallowMethod · 0.95
SnapshotCollectionMethod · 0.80
LocalRepoCollectionMethod · 0.80
GetMethod · 0.65
RefKeyMethod · 0.45
DecodeMethod · 0.45

Tested by 1

TestLoadPre0_6Method · 0.76