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

« back to all changes in this revision

Viewing changes to setup/install.py

  • Committer: dcoles
  • Date: 2008-07-03 04:20:54 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:803
Setup: Modularised setup.py so it is now no longer over 1000 lines. This should 
allow us to get in there and tidy up each module much easier. Also removed 
updatejails since this functionality seems to be duplicated with remakeuser.py 
and remakealluser.py scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
Create target install directory ($target).
41
41
Create $target/bin.
42
42
Copy trampoline/trampoline to $target/bin.
43
 
Copy timount/timount to $target/bin.
44
43
chown and chmod the installed trampoline.
45
44
Copy www/ to $target.
46
 
Copy jail/ to jail_system directory (unless --nojail specified).
 
45
Copy jail/ to jails __staging__ directory (unless --nojail specified).
47
46
Copy subjects/ to subjects directory (unless --nosubjects specified).
48
47
"""
49
48
 
54
53
        help="Print out the actions but don't do anything.")
55
54
    parser.add_option("-J", "--nojail",
56
55
        action="store_true", dest="nojail",
57
 
        help="Don't copy jail/ to jail_system directory")
 
56
        help="Don't copy jail/ to jail __staging__ directory")
58
57
    parser.add_option("-S", "--nosubjects",
59
58
        action="store_true", dest="nosubjects",
60
59
        help="Don't copy subject/ to subjects directory.")
65
64
 
66
65
def __install(dry=False,nojail=False,nosubjects=False):
67
66
    # Importing configuration is a little tricky
68
 
    sys.path.append('lib')
 
67
    sys.path.append(os.path.join(os.pardir, 'lib'))
 
68
    sys.path.append(os.pardir)
69
69
    import conf.conf
70
70
    import install_list
71
71
 
72
72
    # Pull the required varibles out of the config
73
73
    ivle_install_dir = conf.conf.ivle_install_dir
74
74
    jail_base = conf.conf.jail_base
75
 
    jail_system = conf.conf.jail_system
76
75
    subjects_base = conf.conf.subjects_base
77
76
    exercises_base = conf.conf.exercises_base
78
77
 
95
94
    # chown trampoline to root and set setuid bit
96
95
    action_chown_setuid(tramppath, dry)
97
96
 
98
 
    timountpath = os.path.join(ivle_install_dir, 'bin/timount')
99
 
    action_copyfile('timount/timount', timountpath, dry)
100
 
 
101
97
    # Create a scripts directory to put the usrmgt-server in.
102
98
    action_mkdir(os.path.join(ivle_install_dir, 'scripts'), dry)
103
99
    usrmgtpath = os.path.join(ivle_install_dir, 'scripts/usrmgt-server')
118
114
 
119
115
    if not nojail:
120
116
        # Copy the local jail directory built by the build action
121
 
        # to the jail_system directory (it will be used to help build
 
117
        # to the jails __staging__ directory (it will be used to help build
122
118
        # all the students' jails).
123
 
        action_copytree('jail', jail_system, dry)
 
119
        action_copytree('jail', os.path.join(jail_base, '__staging__'), dry)
124
120
    if not nosubjects:
125
121
        # Copy the subjects and exercises directories across
126
122
        action_copylist(install_list.list_subjects, subjects_base, dry,
166
162
            print "IO error(%s): %s" % (errno, strerror)
167
163
            sys.exit(1)
168
164
 
169
 
        os.system("svn status -v . >> %s" % ivle_revision_record_file)
 
165
        os.system("svn status -v .. >> %s" % ivle_revision_record_file)
170
166
 
171
167
    print "Wrote IVLE code revision status to %s" % ivle_revision_record_file
172
168