NewChanges moves .changes file into temporary directory and creates Changes structure
(path string)
| 33 | |
| 34 | // NewChanges moves .changes file into temporary directory and creates Changes structure |
| 35 | func 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 |
| 58 | func (c *Changes) VerifyAndParse(acceptUnsigned, ignoreSignature bool, verifier pgp.Verifier) error { |