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

Method Add

deb/local.go:143–157  ·  view source on GitHub ↗

Add appends new repo to collection and saves it

(repo *LocalRepo)

Source from the content-addressed store, hash-verified

141
142// Add appends new repo to collection and saves it
143func (collection *LocalRepoCollection) Add(repo *LocalRepo) error {
144 _, err := collection.ByName(repo.Name)
145
146 if err == nil {
147 return fmt.Errorf("local repo with name %s already exists", repo.Name)
148 }
149
150 err = collection.Update(repo)
151 if err != nil {
152 return err
153 }
154
155 collection.cache[repo.UUID] = repo
156 return nil
157}
158
159// Update stores updated information about repo in DB
160func (collection *LocalRepoCollection) Update(repo *LocalRepo) error {

Callers

nothing calls this directly

Calls 2

ByNameMethod · 0.95
UpdateMethod · 0.95

Tested by

no test coverage detected