diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-11-24 00:08:36 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-11-24 00:08:36 -0500 |
commit | e1f5f66b99c953bae3b2f2a4e032c2e227083f44 (patch) | |
tree | 18b318e0ec37d5939f3fb575fcfdf31f9b0b0a79 /filter.go | |
parent | e2353adb6369b9ce298d0ff6611967e86b256087 (diff) |
include .SRCINFO files
Diffstat (limited to 'filter.go')
-rw-r--r-- | filter.go | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -218,13 +218,26 @@ func (f *Filter) Run() error { }} } + filename := strings.TrimPrefix(string(cmdt.Path), branchname+"/") outcommit := f.curCommitOut[branch_ref] outcommit.fileactions = append(outcommit.fileactions, libfastimport.FileModify{ Mode: cmdt.Mode, - Path: textproto.Path(strings.TrimPrefix(string(cmdt.Path), branchname+"/")), + Path: textproto.Path(filename), DataRef: cmdt.DataRef, }) + if filename == "PKGBUILD" { + srcinfo, err := f.pkgbuild2srcinfo(cmdt.DataRef) + if err != nil { + return err + } + outcommit.fileactions = append(outcommit.fileactions, + libfastimport.FileModify{ + Mode: cmdt.Mode, + Path: textproto.Path(".SRCINFO"), + DataRef: srcinfo, + }) + } f.curCommitOut[branch_ref] = outcommit case libfastimport.FileDelete: branchname := filename2branchname(string(cmdt.Path)) @@ -258,11 +271,18 @@ func (f *Filter) Run() error { }} } + filename := strings.TrimPrefix(string(cmdt.Path), branchname+"/") outcommit := f.curCommitOut[branch_ref] outcommit.fileactions = append(outcommit.fileactions, libfastimport.FileDelete{ - Path: textproto.Path(strings.TrimPrefix(string(cmdt.Path), branchname+"/")), + Path: textproto.Path(filename), }) + if filename == "PKGBUILD" { + outcommit.fileactions = append(outcommit.fileactions, + libfastimport.FileDelete{ + Path: textproto.Path(".SRCINFO"), + }) + } f.curCommitOut[branch_ref] = outcommit } } |