]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blame - bin/pfa-rmpkg
- fixed a bug in remove.py and did some rearrangements in ftptree.py, since
[projects/pld-ftp-admin.git] / bin / pfa-rmpkg
CommitLineData
14085d11
MM
1#!/usr/bin/env python
2# vi: encoding=utf-8 ts=8 sts=4 sw=4 et
3
6ebc8df7 4import sys, os
14085d11 5sys.path.insert(0, os.environ['HOME']+'/pld-ftp-admin/modules')
67b5bf38 6import ftptree
6ebc8df7 7from common import checkdir
0a108b7f 8import ftpio
14085d11
MM
9
10if len(sys.argv) < 3:
749b120d 11 print "ERR: not enough parameters given"
14085d11
MM
12 print "remove.py tree package1 [package2...]"
13 sys.exit(1)
14
6ebc8df7 15checkdir(sys.argv[1])
14085d11 16
0a108b7f 17ftpio.connect('remove')
14085d11 18
0a108b7f 19if not ftpio.lock(sys.argv[1], True):
749b120d 20 print "ERR: %s tree already locked" % sys.argv[1]
0a108b7f
MM
21 sys.exit(1)
22
23try:
67b5bf38 24 tree=ftptree.FtpTree(sys.argv[1])
0a108b7f
MM
25 tree.mark4removal(sys.argv[2:])
26 tree.removepkgs()
27except ftptree.SomeError:
28 # In case of problems we need to unlock the tree before exiting
29 ftpio.unlock(sys.argv[1])
30 sys.exit(1)
31
32ftpio.unlock(sys.argv[1])
14085d11 33
This page took 0.07614 seconds and 4 git commands to generate.