root/galaxy-central/scripts/dist-scramble.py

リビジョン 2, 1.8 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
1"""
2usage: dist-scramble.py <egg_name> [platform]
3  egg_name - The egg to scramble (as defined in eggs.ini)
4  platform - The platform to scramble on (as defined in
5             dist-eggs.ini).  Leave blank for all.
6             Platform-inspecific eggs ignore this argument.
7"""
8import os, sys, logging
9
10root = logging.getLogger()
11root.setLevel( 10 )
12root.addHandler( logging.StreamHandler( sys.stdout ) )
13
14lib = os.path.abspath( os.path.join( os.path.dirname( __file__ ), '..', 'lib' ) )
15sys.path.append( lib )
16
17from galaxy.eggs.dist import DistScrambleCrate, ScrambleFailure
18
19if len( sys.argv ) > 3 or len( sys.argv ) < 2:
20    print __doc__
21    sys.exit( 1 )
22elif len( sys.argv ) == 3:
23    c = DistScrambleCrate( sys.argv[2] )
24else:
25    c = DistScrambleCrate()
26
27try:
28    eggs = c[sys.argv[1]]
29except:
30    print "error: %s not in eggs.ini" % sys.argv[1]
31    sys.exit( 1 )
32failed = []
33for egg in eggs:
34    try:
35        for dependency in egg.dependencies:
36            print "Checking %s dependency: %s" % ( egg.name, dependency )
37            # this could be in a better data structure...
38            dep = filter( lambda x: x.platform == egg.platform, c[dependency] )[0]
39            dep.resolve()
40    except EggNotFetchable, e:
41        degg = e.eggs[0]
42        print "%s build dependency %s %s %s couldn't be" % ( egg.name, degg.name, degg.version, degg.platform )
43        print "downloaded automatically.  There isn't really a graceful"
44        print "way to handle this when dist-scrambling."
45        failed.append( egg.platform )
46        continue
47    try:
48        egg.scramble()
49    except ScrambleFailure:
50        failed.append( egg.platform )
51if len( failed ):
52    print ""
53    print "Scramble failed to build eggs on the following platforms (more details"
54    print "can be found by reviewing the output above):"
55    print "\n".join( failed )
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。