mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-12-04 18:36:26 +00:00
fix lookaside patch tree mode, and support numless Source/Patch
This commit is contained in:
parent
097f48e399
commit
81b27414d2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user