fix: prevent abs cache paths

This commit is contained in:
Yannik Schmidt
2024-05-11 20:12:47 +02:00
parent d3daf96ff0
commit 47396817ce
2 changed files with 3 additions and 1 deletions

View File

@@ -173,6 +173,8 @@ class FTP(DataBackend):
fullpath = fullpath.replace("\\", "/")
local_file = os.path.join(cache_dir, os.path.basename(path))
# print("Cachedir:", cache_dir, os.path.basename(path), local_file)
if not os.path.isfile(local_file):
ftp = self._connect()
ftp.sendcmd('TYPE I')

View File

@@ -17,7 +17,7 @@ class Software:
self.backend = backend
print("Software Directory:", self.directory)
self.cache_dir = backend.cache_dir or os.path.join("cache", self.directory)
self.cache_dir = backend.cache_dir or os.path.join("cache", self.directory.lstrip("/").lstrip("\\"))
# return None instead of the object if yaml failed #
try: