[projects/pld-ftp-admin] Correctly unwrap list of lists
baggins
baggins at pld-linux.org
Sat Feb 7 17:43:55 CET 2026
commit 6d58c5aced008b0cd567532bfd881bd5242f3622
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sat Feb 7 17:43:40 2026 +0100
Correctly unwrap list of lists
wwwbin/clean-dups.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/wwwbin/clean-dups.py b/wwwbin/clean-dups.py
index 9398d22..da96848 100755
--- a/wwwbin/clean-dups.py
+++ b/wwwbin/clean-dups.py
@@ -103,6 +103,12 @@ def compare(f1, f2):
def find_old(files):
return sorted(files, key=functools.cmp_to_key(compare))[1:]
+def find_dupes(dupes):
+ pkgs = []
+ for old in dupes:
+ pkgs.extend(find_old(old))
+ return pkgs
+
files = {}
dupes = {}
@@ -145,9 +151,10 @@ if not ftpio.lock(ftp_tree, True):
try:
tree=ftptree.FtpTree(ftp_tree)
#tree.do_checkbuild=False
- list(find_old(old) for old in dupes.values())
+ pkgs = find_dupes(dupes.values())
+ for pkg in pkgs:
+ print(f"removing: {pkg}")
tree.mark4removal(pkgs)
- print(f"removing: {pkg}") for pkg in pkgs
tree.removepkgs()
except ftptree.SomeError:
# In case of problems we need to unlock the tree before exiting
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-ftp-admin.git/commitdiff/6d58c5aced008b0cd567532bfd881bd5242f3622
More information about the pld-cvs-commit
mailing list