2 # vi: encoding=utf-8 ts=8 sts=4 sw=4 et
4 from __future__ import print_function
7 sys.path.insert(0, os.environ['HOME']+'/tld-ftp-admin/modules')
9 from common import checkdir
13 print("ERR: not enough parameters given")
14 print("remove.py tree package1 [package2...]")
19 ftpio.connect('remove')
21 if not ftpio.lock(sys.argv[1], True):
22 print("ERR: %s tree already locked" % sys.argv[1])
26 tree=ftptree.FtpTree(sys.argv[1])
27 #tree.do_checkbuild=False
28 pkgs = list(set(sys.argv[2:]))
29 tree.mark4removal(pkgs)
31 except ftptree.SomeError:
32 # In case of problems we need to unlock the tree before exiting
33 ftpio.unlock(sys.argv[1])
36 ftpio.unlock(sys.argv[1])