summaryrefslogtreecommitdiff
path: root/filter.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-24 00:08:36 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-24 00:08:36 -0500
commite1f5f66b99c953bae3b2f2a4e032c2e227083f44 (patch)
tree18b318e0ec37d5939f3fb575fcfdf31f9b0b0a79 /filter.go
parente2353adb6369b9ce298d0ff6611967e86b256087 (diff)
include .SRCINFO files
Diffstat (limited to 'filter.go')
-rw-r--r--filter.go24
1 files changed, 22 insertions, 2 deletions
diff --git a/filter.go b/filter.go
index 1410f09..6855271 100644
--- a/filter.go
+++ b/filter.go
@@ -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
}
}