~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: dcoles
  • Date: 2008-04-18 07:37:50 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:742
Libs: lxml requires extra shared objects

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
# Copy trampoline/trampoline to $target/bin.
56
56
# chown and chmod the installed trampoline.
57
57
# Copy www/ to $target.
58
 
# Copy jail/ to jails __staging__ directory (unless --nojail specified).
 
58
# Copy jail/ to jails template directory (unless --nojail specified).
59
59
 
60
60
import os
61
61
import stat
69
69
import getopt
70
70
import hashlib
71
71
import uuid
72
 
import pysvn
73
72
 
74
73
# Import modules from the website is tricky since they're in the www
75
74
# directory.
112
111
    '/lib/libuuid.so.1',
113
112
    '/usr/lib/libapr-1.so.0',
114
113
    '/usr/lib/libaprutil-1.so.0',
115
 
    '/usr/lib/libapt-pkg-libc6.6-6.so.4.5',
116
 
    '/usr/lib/libdb-4.6.so',
 
114
    '/usr/lib/libdb-4.4.so',
117
115
    '/usr/lib/libexpat.so.1',
118
116
    '/usr/lib/libgcrypt.so.11',
119
117
    '/usr/lib/libgnutls.so.13',
123
121
    '/usr/lib/libkrb5.so.3',
124
122
    '/usr/lib/libkrb5support.so.0',
125
123
    '/usr/lib/liblber.so.2',
126
 
    '/usr/lib/liblber-2.4.so.2',
127
124
    '/usr/lib/libldap_r.so.2',
128
 
    '/usr/lib/libldap_r-2.4.so.2',
129
 
    '/usr/lib/libneon.so.27',
 
125
    '/usr/lib/libneon.so.26',
130
126
    '/usr/lib/libpq.so.5',
131
127
    '/usr/lib/libsasl2.so.2',
132
128
    '/usr/lib/libsqlite3.so.0',
179
175
    # Needed by lxml
180
176
    '/usr/lib/libxslt.so.1',
181
177
    '/usr/lib/libexslt.so.0',
182
 
    # Needed by elementtree
183
 
    '/usr/lib/libtidy-0.99.so.0',
184
178
]
185
179
# Symlinks to make within the jail. Src mapped to dst.
186
180
JAIL_LINKS = {
190
184
JAIL_COPYTREES = {
191
185
    '/usr/lib/python%s' % PYTHON_VERSION:
192
186
        'jail/usr/lib/python%s' % PYTHON_VERSION,
193
 
    '/var/lib/python-support/python%s' % PYTHON_VERSION:
194
 
        'jail/var/lib/python-support/python%s' %PYTHON_VERSION,
195
187
    '/usr/share/matplotlib': 'jail/usr/share/matplotlib',
196
188
    '/etc/ld.so.conf.d': 'jail/etc/ld.so.conf.d',
197
189
    '/usr/share/pycentral': 'jail/usr/share/pycentral',
533
525
Copy trampoline/trampoline to $target/bin.
534
526
chown and chmod the installed trampoline.
535
527
Copy www/ to $target.
536
 
Copy jail/ to jails __staging__ directory (unless --nojail specified).
 
528
Copy jail/ to jails template directory (unless --nojail specified).
537
529
Copy subjects/ to subjects directory (unless --nosubjects specified).
538
530
 
539
531
--nojail        Do not copy the jail.
1047
1039
 
1048
1040
    if dry:
1049
1041
        print "Dry run (no actions will be executed\n"
1050
 
    
1051
 
    # Find out the revison number
1052
 
    revnum = get_svn_revision()
1053
 
    print "Building Revision %s"%str(revnum)
1054
 
    if not dry:
1055
 
        vfile = open('BUILD-VERSION','w')
1056
 
        vfile.write(str(revnum) + '\n')
1057
 
        vfile.close()
1058
1042
 
1059
1043
    # Compile the trampoline
1060
1044
    curdir = os.getcwd()
1170
1154
 
1171
1155
    if not nojail:
1172
1156
        # Copy the local jail directory built by the build action
1173
 
        # to the jails __staging__ directory (it will be used to help build
1174
 
        # all the students' jails).
1175
 
        action_copytree('jail', os.path.join(jail_base, '__staging__'), dry)
 
1157
        # to the jails template directory (it will be used as a template
 
1158
        # for all the students' jails).
 
1159
        action_copytree('jail', os.path.join(jail_base, 'template'), dry)
1176
1160
    if not nosubjects:
1177
1161
        # Copy the subjects and exercises directories across
1178
1162
        action_copylist(install_list.list_subjects, subjects_base, dry,
1219
1203
        print >>sys.stderr, "(I need to chown some files)."
1220
1204
        return 1
1221
1205
 
1222
 
    # Update the staging jail directory in case it hasn't been installed
 
1206
    # Update the template jail directory in case it hasn't been installed
1223
1207
    # recently.
1224
 
    action_copytree('jail', os.path.join(jail_base, '__staging__'), dry)
 
1208
    action_copytree('jail', os.path.join(jail_base, 'template'), dry)
1225
1209
 
1226
1210
    # Re-link all the files in all students jails.
1227
1211
    for dir in os.listdir(jail_base):
1228
 
        if dir == '__staging__': continue
 
1212
        if dir == 'template': continue
1229
1213
        # First back up the student's home directory
1230
1214
        temp_home = os.tmpnam()
1231
1215
        action_rename(os.path.join(jail_base, dir, 'home'), temp_home, dry)
1232
1216
        # Delete the student's jail and relink the jail files
1233
 
        action_linktree(os.path.join(jail_base, '__staging__'),
 
1217
        action_linktree(os.path.join(jail_base, 'template'),
1234
1218
            os.path.join(jail_base, dir), dry)
1235
1219
        # Restore the student's home directory
1236
1220
        action_rename(temp_home, os.path.join(jail_base, dir, 'home'), dry)
1443
1427
            del list[i]
1444
1428
        i -= 1
1445
1429
 
1446
 
def get_svn_revision():
1447
 
    """Returns either the current SVN revision of this build, or None"""
1448
 
    try:
1449
 
        svn = pysvn.Client()
1450
 
        entry = svn.info('.')
1451
 
        revnum = entry.revision.number
1452
 
    except pysvn.ClientError, e:
1453
 
        revnum = None
1454
 
    return revnum
1455
 
 
1456
1430
if __name__ == "__main__":
1457
1431
    sys.exit(main())
1458