mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
remove the path of the tarfile
This commit is contained in:
parent
7de8417fb2
commit
5901cb9993
1 changed files with 4 additions and 1 deletions
|
@ -1988,7 +1988,10 @@ class TarBackupMethod(BackupMethod):
|
||||||
|
|
||||||
def copy(self, file, target):
|
def copy(self, file, target):
|
||||||
tar = tarfile.open(self._archive_file, "r:gz")
|
tar = tarfile.open(self._archive_file, "r:gz")
|
||||||
tar.extract(file, path=target)
|
file_to_extract = tar.getmember(file)
|
||||||
|
# Remove the path
|
||||||
|
file_to_extract.name = os.path.basename(file_to_extract.name)
|
||||||
|
tar.extract(file_to_extract, path=target)
|
||||||
tar.close()
|
tar.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue