]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blob - bin/pfa-genindex
- add 'separate_noarch' config option (on for Th and off for Ac)
[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,all_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 for tree in trees:
36     print '-------------------------- %s --------------------------' % tree
37     for arch in all_ftp_archs:
38         print 'ARCHITECTURE: %s' % arch
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' %
40                 (ftp_dir,home,ftp_dir,ftp_dir,tree,arch))
41
42 for tree in trees:
43     ftpio.unlock(tree)
44
This page took 0.050221 seconds and 3 git commands to generate.