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

Function NewChanges

deb/changes.go:35–55  ·  view source on GitHub ↗

NewChanges moves .changes file into temporary directory and creates Changes structure

(path string)

Source from the content-addressed store, hash-verified

33
34// NewChanges moves .changes file into temporary directory and creates Changes structure
35func NewChanges(path string) (*Changes, error) {
36 var err error
37
38 c := &Changes{
39 BasePath: filepath.Dir(path),
40 ChangesName: filepath.Base(path),
41 }
42
43 c.TempDir, err = os.MkdirTemp(os.TempDir(), "aptly")
44 if err != nil {
45 return nil, err
46 }
47
48 // copy .changes file into temporary directory
49 err = utils.CopyFile(filepath.Join(c.BasePath, c.ChangesName), filepath.Join(c.TempDir, c.ChangesName))
50 if err != nil {
51 return nil, err
52 }
53
54 return c, nil
55}
56
57// VerifyAndParse does optional signature verification and parses changes files
58func (c *Changes) VerifyAndParse(acceptUnsigned, ignoreSignature bool, verifier pgp.Verifier) error {

Callers 4

TestParseAndVerifyMethod · 0.85
TestPrepareMethod · 0.85
TestPackageQueryMethod · 0.85
ImportChangesFilesFunction · 0.85

Calls 1

CopyFileFunction · 0.92

Tested by 3

TestParseAndVerifyMethod · 0.68
TestPrepareMethod · 0.68
TestPackageQueryMethod · 0.68