]>
Commit | Line | Data |
---|---|---|
df78f748 MM |
1 | #!/usr/bin/env python |
2 | # vi: encoding=utf-8 ts=8 sts=4 sw=4 et | |
3 | ||
4 | import sys, os | |
5 | sys.path.insert(0, os.environ['HOME']+'/pld-ftp-admin/modules') | |
6 | from common import checkdir | |
796b7867 | 7 | from config import ftp_dir,all_ftp_archs |
df78f748 MM |
8 | import ftpio |
9 | ||
10 | if len(sys.argv) < 2: | |
11 | print "Not enough parameters given" | |
12 | print "gen-indexes.py tree [tree2...]" | |
13 | sys.exit(1) | |
14 | ||
15 | trees=sys.argv[1:] | |
16 | ||
17 | for tree in trees: | |
18 | checkdir(tree) | |
19 | ||
20 | ftpio.connect('gen-indexes') | |
21 | ||
22 | locked=[] | |
23 | ||
24 | for tree in trees: | |
25 | if ftpio.lock(tree, True): | |
26 | locked.append(tree) | |
27 | else: | |
28 | print "%s tree already locked" % tree | |
29 | for i in locked: | |
30 | ftpio.unlock(i) | |
31 | sys.exit(1) | |
32 | ||
33 | home=os.environ['HOME'] | |
34 | ||
35 | for tree in trees: | |
36 | print '-------------------------- %s --------------------------' % tree | |
796b7867 | 37 | for arch in all_ftp_archs: |
df78f748 | 38 | print 'ARCHITECTURE: %s' % arch |
88a312c9 | 39 | os.system('%s.stat/bin/poldek --cachedir=%s/tmp/poldek --conf %s.stat/etc/poldek.conf -s %s%s/%s/RPMS/ --mkidxz --mkidx-type pdir' % |
df78f748 MM |
40 | (ftp_dir,home,ftp_dir,ftp_dir,tree,arch)) |
41 | ||
42 | for tree in trees: | |
43 | ftpio.unlock(tree) | |
44 |