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

Method Add

deb/publish.go:1328–1342  ·  view source on GitHub ↗

Add appends new repo to collection and saves it

(repo *PublishedRepo)

Source from the content-addressed store, hash-verified

1326
1327// Add appends new repo to collection and saves it
1328func (collection *PublishedRepoCollection) Add(repo *PublishedRepo) error {
1329 collection.loadList()
1330
1331 if collection.CheckDuplicate(repo) != nil {
1332 return fmt.Errorf("published repo with storage/prefix/distribution %s/%s/%s already exists", repo.Storage, repo.Prefix, repo.Distribution)
1333 }
1334
1335 err := collection.Update(repo)
1336 if err != nil {
1337 return err
1338 }
1339
1340 collection.list = append(collection.list, repo)
1341 return nil
1342}
1343
1344// CheckDuplicate verifies that there's no published repo with the same name
1345func (collection *PublishedRepoCollection) CheckDuplicate(repo *PublishedRepo) *PublishedRepo {

Callers

nothing calls this directly

Calls 3

loadListMethod · 0.95
CheckDuplicateMethod · 0.95
UpdateMethod · 0.95

Tested by

no test coverage detected