Commit 81b27414 authored by Mustafa Gezen's avatar Mustafa Gezen
Browse files

fix lookaside patch tree mode, and support numless Source/Patch

parent 097f48e3
......@@ -68,7 +68,7 @@ func lookaside(cfg *srpmprocpb.Cfg, _ *data.ProcessData, md *data.ModeData, patc
}
} else {
if directive.FromPatchTree {
pushF, err := pushTree.Filesystem.OpenFile(filepath.Join("SOURCES", file), os.O_CREATE|os.O_TRUNC|os.O_RDWR, stat.Mode())
pushF, err := pushTree.Filesystem.OpenFile(filepath.Join("SOURCES", filepath.Base(file)), os.O_CREATE|os.O_TRUNC|os.O_RDWR, stat.Mode())
if err != nil {
return errors.New(fmt.Sprintf("COULD_NOT_CREATE_FILE_IN_PUSH_TREE:%s", file))
}
......
......@@ -57,11 +57,13 @@ func sourcePatchOperationInLoop(req *sourcePatchOperationInLoopRequest) error {
break
}
}
sourceNum, err := strconv.Atoi(strings.Split(req.field, req.expectedField)[1])
if err != nil {
return errors.New(fmt.Sprintf("INVALID_%s_NUM", strings.ToUpper(req.expectedField)))
if req.field != req.expectedField {
sourceNum, err := strconv.Atoi(strings.Split(req.field, req.expectedField)[1])
if err != nil {
return errors.New(fmt.Sprintf("INVALID_%s_NUM:%s", strings.ToUpper(req.expectedField), req.field))
}
*req.lastNum = sourceNum
}
*req.lastNum = sourceNum
}
return nil
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment