Fix the issue that nothing is ever written to tmpfs location when the

tmpfs is absolute path.

The test case of absolute path is below:
[root@rockylinux86 ~]# srpmproc --version 8 --upstream-prefix file:///root/rocky --storage-addr file:///tmp/srpmproc-cache --source-rpm sed --tmpfs-mode /root/rocky/rpms/sed
[root@rockylinux86 ~]# ls /root/rocky/rpms/sed/
r8  r8-beta  r8s

The test case of relative path is below:
[root@rockylinux86 ~]# pwd
/root
[root@rockylinux86 ~]# srpmproc --version 8 --upstream-prefix file:///root/rocky --storage-addr file:///tmp/srpmproc-cache --source-rpm sed --tmpfs-mode ./rocky/rpms/sed
[root@rockylinux86 ~]# ls /root/rocky/rpms/sed/
r8  r8-beta  r8s

Signed-off-by: jarod.w <wl.jarod@gmail.com>
This commit is contained in:
jarod.w 2022-09-11 17:29:03 +08:00
parent 1c2091a489
commit d7ed1c7a7f

View File

@ -193,7 +193,7 @@ func NewProcessData(req *ProcessDataRequest) (*data.ProcessData, error) {
fsCreator := func(branch string) (billy.Filesystem, error) { fsCreator := func(branch string) (billy.Filesystem, error) {
if req.TmpFsMode != "" { if req.TmpFsMode != "" {
return osfs.New("."), nil return osfs.New(""), nil
} }
return memfs.New(), nil return memfs.New(), nil
} }