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

« back to all changes in this revision

Viewing changes to setup/build.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:
42
42
-O is recommended to cause compilation to be optimised.
43
43
Details:
44
44
Compiles (GCC) trampoline/trampoline.c to trampoline/trampoline.
45
 
Compiles (GCC) timount/timount.c to timount/timount.
46
45
Creates jail with system and student packages installed from MIRROR.
47
46
Copies console/ to a location within the jail.
48
47
Copies OS programs and files to corresponding locations within the jail
54
53
    parser.add_option("-n", "--dry",
55
54
        action="store_true", dest="dry",
56
55
        help="Print out the actions but don't do anything.")
57
 
    parser.add_option("-J", "--norebuildjail",
58
 
        action="store_true", dest="norebuildjail",
59
 
        help="Don't recreate jail/ - just update its IVLE code.")
60
56
    parser.add_option("-m", "--mirror",
61
57
        action="store", dest="apt_mirror",
62
58
        help="Sets the APT mirror used to build the jail.")
63
59
    (options, args) = parser.parse_args(args)
64
60
 
65
61
    # Call the real function
66
 
    __build(options.dry, options.norebuildjail, options.apt_mirror)
 
62
    __build(options.dry, options.apt_mirror)
67
63
 
68
 
def __build(dry=False,norebuildjail=False,apt_mirror=None):
 
64
def __build(dry=False,apt_mirror="http://archive.ubuntu.com/ubuntu/"):
69
65
    # Importing configuration is a little tricky
70
66
    sys.path.append(os.pardir)
71
67
    import install_list
93
89
    action_runprog('make', [], dry)
94
90
    os.chdir(curdir)
95
91
 
96
 
    # Compile timount
97
 
    curdir = os.getcwd()
98
 
    os.chdir('timount')
99
 
    action_runprog('make', [], dry)
100
 
    os.chdir(curdir)
101
 
 
102
 
    if not norebuildjail:
103
 
        # Create the jail and its subdirectories
104
 
        # Note: Other subdirs will be made by copying files
105
 
        if apt_mirror != None:
106
 
            os.environ['MIRROR'] = apt_mirror
107
 
        action_runprog('./buildjail.sh', [], dry)
 
92
    # Create the jail and its subdirectories
 
93
    # Note: Other subdirs will be made by copying files
 
94
    action_runprog('./buildjail.sh', [], dry)
108
95
 
109
96
    # Copy all console and operating system files into the jail
110
97
    action_copylist(install_list.list_scripts, 'jail/opt/ivle', dry)