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

Method Update

deb/package_collection.go:205–217  ·  view source on GitHub ↗

Update adds or updates information about package in DB

(p *Package)

Source from the content-addressed store, hash-verified

203
204// Update adds or updates information about package in DB
205func (collection *PackageCollection) Update(p *Package) error {
206 transaction, err := collection.db.OpenTransaction()
207 if err != nil {
208 return err
209 }
210 defer transaction.Discard()
211
212 if err = collection.UpdateInTransaction(p, transaction); err != nil {
213 return err
214 }
215
216 return transaction.Commit()
217}
218
219// UpdateInTransaction updates/creates package info in the context of the outer transaction
220func (collection *PackageCollection) UpdateInTransaction(p *Package, transaction database.Transaction) error {

Callers 6

TestDiffMethod · 0.95
TestDiffCompactsAtEndMethod · 0.95
TestMergeMethod · 0.95
ByKeyMethod · 0.95

Calls 4

UpdateInTransactionMethod · 0.95
OpenTransactionMethod · 0.65
DiscardMethod · 0.65
CommitMethod · 0.65

Tested by 5

TestDiffMethod · 0.76
TestDiffCompactsAtEndMethod · 0.76
TestMergeMethod · 0.76