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).
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',
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).
539
531
--nojail Do not copy the jail.
1049
1041
print "Dry run (no actions will be executed\n"
1051
# Find out the revison number
1052
revnum = get_svn_revision()
1053
print "Building Revision %s"%str(revnum)
1055
vfile = open('BUILD-VERSION','w')
1056
vfile.write(str(revnum) + '\n')
1059
1043
# Compile the trampoline
1060
1044
curdir = os.getcwd()
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)."
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
1224
action_copytree('jail', os.path.join(jail_base, '__staging__'), dry)
1208
action_copytree('jail', os.path.join(jail_base, 'template'), dry)
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)
1446
def get_svn_revision():
1447
"""Returns either the current SVN revision of this build, or None"""
1449
svn = pysvn.Client()
1450
entry = svn.info('.')
1451
revnum = entry.revision.number
1452
except pysvn.ClientError, e:
1456
1430
if __name__ == "__main__":
1457
1431
sys.exit(main())