From f56d33c5c503979982838697d2758f25337bcc7c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 23 Oct 2007 06:22:00 +0000 Subject: [PATCH] - something todo Changed files: bin/pfa-signpkg -> 1.1 --- bin/pfa-signpkg | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 bin/pfa-signpkg diff --git a/bin/pfa-signpkg b/bin/pfa-signpkg new file mode 100644 index 0000000..ae49101 --- /dev/null +++ b/bin/pfa-signpkg @@ -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]) + -- 2.44.0