]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blob - bin/pfa-genindex
6e6e42911189f0676a380271be1aa31887fae783
[projects/pld-ftp-admin.git] / bin / pfa-genindex
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
7 from config import ftp_dir,ftp_archs
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 ftp_archs.append('noarch')
36
37 for tree in trees:
38     print '-------------------------- %s --------------------------' % tree
39     for arch in ftp_archs:
40         print 'ARCHITECTURE: %s' % arch
41         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' %
42                 (ftp_dir,home,ftp_dir,ftp_dir,tree,arch))
43
44 for tree in trees:
45     ftpio.unlock(tree)
46
This page took 0.039257 seconds and 2 git commands to generate.