From acaa05c2caebd572db80114b96c16577c1237462 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 31 Aug 2020 19:09:28 +0200 Subject: [PATCH] Fix a small issue where there would be duplicated entries in backup_list --- src/yunohost/backup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index 57f86ab10..3102022d2 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -2158,7 +2158,10 @@ def backup_list(with_info=False, human_readable=False): """ # Get local archives sorted according to last modification time - archives = sorted(glob("%s/*.tar.gz" % ARCHIVES_PATH) + glob("%s/*.tar" % ARCHIVES_PATH), key=lambda x: os.path.getctime(x)) + # (we do a realpath() to resolve symlinks) + archives = glob("%s/*.tar.gz" % ARCHIVES_PATH) + glob("%s/*.tar" % ARCHIVES_PATH) + archives = set([os.path.realpath(archive) for archive in archives]) + archives = sorted(archives, key=lambda x: os.path.getctime(x)) # Extract only filename without the extension def remove_extension(f): if f.endswith(".tar.gz"):