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

Method Add

deb/remote.go:930–944  ·  view source on GitHub ↗

Add appends new repo to collection and saves it

(repo *RemoteRepo)

Source from the content-addressed store, hash-verified

928
929// Add appends new repo to collection and saves it
930func (collection *RemoteRepoCollection) Add(repo *RemoteRepo) error {
931 _, err := collection.ByName(repo.Name)
932
933 if err == nil {
934 return fmt.Errorf("mirror with name %s already exists", repo.Name)
935 }
936
937 err = collection.Update(repo)
938 if err != nil {
939 return err
940 }
941
942 collection.cache[repo.UUID] = repo
943 return nil
944}
945
946// Update stores updated information about repo in DB
947func (collection *RemoteRepoCollection) Update(repo *RemoteRepo) error {

Callers 1

Calls 2

ByNameMethod · 0.95
UpdateMethod · 0.95

Tested by

no test coverage detected