pld-ftp-admin: scripts/sign.py (NEW) - something todo

glen glen at pld-linux.org
Tue Oct 23 08:22:05 CEST 2007


Author: glen                         Date: Tue Oct 23 06:22:05 2007 GMT
Module: pld-ftp-admin                 Tag: HEAD
---- Log message:
- something todo

---- Files affected:
pld-ftp-admin/scripts:
   sign.py (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: pld-ftp-admin/scripts/sign.py
diff -u /dev/null pld-ftp-admin/scripts/sign.py:1.1
--- /dev/null	Tue Oct 23 08:22:05 2007
+++ pld-ftp-admin/scripts/sign.py	Tue Oct 23 08:22:00 2007
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# vi: encoding=utf-8 ts=8 sts=4 sw=4 et
+
+import sys, os
+sys.path.insert(0, os.environ['HOME']+'/pld-ftp-admin/modules')
+import ftptree
+from common import checkdir
+import ftpio
+
+if len(sys.argv) < 3:
+    print "ERR: not enough parameters given"
+    print "sign.py tree package1 [package2...]"
+    sys.exit(1)
+
+checkdir(sys.argv[1])
+
+ftpio.connect('sign')
+
+if not ftpio.lock(sys.argv[1], True):
+    print "ERR: %s tree already locked" % sys.argv[1]
+    sys.exit(1)
+
+# TODO: implement signpkg() from:
+# http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-ftp-admin/shell/bashrc
+
+try:
+    tree=ftptree.FtpTree(sys.argv[1])
+#    tree.mark4removal(sys.argv[2:])
+#    tree.removepkgs()
+except ftptree.SomeError:
+    # In case of problems we need to unlock the tree before exiting
+    ftpio.unlock(sys.argv[1])
+    sys.exit(1)
+
+ftpio.unlock(sys.argv[1])
+
================================================================


More information about the pld-cvs-commit mailing list