diff options
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 } } |