diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-12-01 00:59:27 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-12-01 00:59:27 -0500 |
commit | dbf4c9a0f2558d33ae33ace2403294131caa1c3a (patch) | |
tree | a9725a38511fe539170605d90df8ddd952a9d008 | |
parent | 7fb2656fb8966351c11883bcabc3df00f14c5ee2 (diff) |
fix infofile()
-rw-r--r-- | filter.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) { |