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

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: dcoles
  • Date: 2008-05-26 01:44:57 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:755
Added support for an incremental rebuild of all the users jails.
It can be run by `./remakeallusers -i`

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 template directory (unless --nojail specified).
 
58
# Copy jail/ to jails __staging__ directory (unless --nojail specified).
59
59
 
60
60
import os
61
61
import stat
530
530
Copy trampoline/trampoline to $target/bin.
531
531
chown and chmod the installed trampoline.
532
532
Copy www/ to $target.
533
 
Copy jail/ to jails template directory (unless --nojail specified).
 
533
Copy jail/ to jails __staging__ directory (unless --nojail specified).
534
534
Copy subjects/ to subjects directory (unless --nosubjects specified).
535
535
 
536
536
--nojail        Do not copy the jail.
1167
1167
 
1168
1168
    if not nojail:
1169
1169
        # Copy the local jail directory built by the build action
1170
 
        # to the jails template directory (it will be used as a template
1171
 
        # for all the students' jails).
1172
 
        action_copytree('jail', os.path.join(jail_base, 'template'), dry)
 
1170
        # to the jails __staging__ directory (it will be used to help build
 
1171
        # all the students' jails).
 
1172
        action_copytree('jail', os.path.join(jail_base, '__staging__'), dry)
1173
1173
    if not nosubjects:
1174
1174
        # Copy the subjects and exercises directories across
1175
1175
        action_copylist(install_list.list_subjects, subjects_base, dry,
1216
1216
        print >>sys.stderr, "(I need to chown some files)."
1217
1217
        return 1
1218
1218
 
1219
 
    # Update the template jail directory in case it hasn't been installed
 
1219
    # Update the staging jail directory in case it hasn't been installed
1220
1220
    # recently.
1221
 
    action_copytree('jail', os.path.join(jail_base, 'template'), dry)
 
1221
    action_copytree('jail', os.path.join(jail_base, '__staging__'), dry)
1222
1222
 
1223
1223
    # Re-link all the files in all students jails.
1224
1224
    for dir in os.listdir(jail_base):
1225
 
        if dir == 'template': continue
 
1225
        if dir == '__staging__': continue
1226
1226
        # First back up the student's home directory
1227
1227
        temp_home = os.tmpnam()
1228
1228
        action_rename(os.path.join(jail_base, dir, 'home'), temp_home, dry)
1229
1229
        # Delete the student's jail and relink the jail files
1230
 
        action_linktree(os.path.join(jail_base, 'template'),
 
1230
        action_linktree(os.path.join(jail_base, '__staging__'),
1231
1231
            os.path.join(jail_base, dir), dry)
1232
1232
        # Restore the student's home directory
1233
1233
        action_rename(temp_home, os.path.join(jail_base, dir, 'home'), dry)