[projects/pld-ftp-admin] ftpiod: list the current packages in gett
arekm
arekm at pld-linux.org
Sat Oct 24 11:45:38 CEST 2026
commit d71b0a33b65f76ad55c4f272b0cd05f00ddd668d
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Oct 20 18:28:19 2026 +0200
ftpiod: list the current packages in gett
The list was read only when the daemon started.
modules/cmds.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/modules/cmds.py b/modules/cmds.py
index 2ad2971..c3e53bf 100644
--- a/modules/cmds.py
+++ b/modules/cmds.py
@@ -150,21 +150,22 @@ def cmd_logout(con):
write_cookies()
def reloadftptree():
- global srctree, pkglist
+ global srctree
srctree=ftptree.FtpTree(config.value['default_to'], loadall=True)
- pkglist=sorted(srctree.keys())
def cmd_gettree(con):
+ # the tree changes under the daemon: reread the names, but keep loaded packages with their marks
+ srctree.pkgnames=ftptree.FtpTree(config.value['default_to']).pkgnames
buf=''
- for pkgnvr in pkglist:
+ for pkgnvr in sorted(srctree.keys()):
# TODO: show only user's own pkgs
- pkg=srctree[pkgnvr]
+ pkg=srctree.loadedpkgs.get(pkgnvr)
line=pkgnvr
- if pkg.marked4moving:
+ if pkg and pkg.marked4moving:
line=line+'\n1'
else:
line=line+'\n0'
- if pkg.marked4removal:
+ if pkg and pkg.marked4removal:
line=line+'\n1'
else:
line=line+'\n0'
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-ftp-admin.git/commitdiff/e14cb7d4d74f8bdd9368d9645ecaf49593cf6335
More information about the pld-cvs-commit
mailing list