summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-12-01 00:59:27 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-12-01 00:59:27 -0500
commitdbf4c9a0f2558d33ae33ace2403294131caa1c3a (patch)
treea9725a38511fe539170605d90df8ddd952a9d008
parent7fb2656fb8966351c11883bcabc3df00f14c5ee2 (diff)
fix infofile()
-rw-r--r--filter.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/filter.go b/filter.go
index 1ff34ac..7312c73 100644
--- a/filter.go
+++ b/filter.go
@@ -5,6 +5,7 @@ import (
"io"
"io/ioutil"
"os"
+ "path"
"os/exec"
"strconv"
"strings"
@@ -38,7 +39,7 @@ func NewFilter(fromRef string, toPfx string) (*Filter, error) {
var err error
ret := &Filter{
fromRef: fromRef,
- toPfx: toPfx,
+ toPfx: strings.TrimRight(toPfx, "/"),
}
ret.refs, err = gitRefs()
@@ -68,7 +69,10 @@ func (f *Filter) newmark() int {
}
func (f *Filter) infofile(name string) string {
- return "info/svn2git2aur/" + name
+ id := strings.Replace(strings.Replace(f.toPfx, "^", "^5E", -1), "/", "^2F", -1)
+ ret := "info/svn2git2aur/" + id + "/" + name
+ _ = os.MkdirAll(path.Dir(ret), 0777)
+ return ret
}
func (f *Filter) pkgbuild2srcinfo(pkgbuildId string) (string, error) {