43
43
parser.add_option("--no-compile",
44
44
action="store_true", dest="nocompile",
45
45
help="Don't byte-compile .py files.")
46
parser.add_option("-t", "--trampoline-uids",
47
action="store", dest="tuids", default="33",
48
help="Comma-separated list of UIDs allowed to use trampoline. "
46
50
(options, args) = parser.parse_args(args)
48
52
# Call the real function
49
return __build(options.dry, options.nocompile)
53
return __build(options.dry, options.nocompile, options.tuids)
51
def __build(dry=False, no_compile=None):
55
def __build(dry=False, no_compile=None, tuids=None):
52
56
install_list = util.InstallList()
55
59
print "Dry run (no actions will be executed)\n"
61
# Create trampoline configuration.
62
conf_hfile = os.path.join(os.getcwd(), "bin/trampoline/conf.h")
63
conf_h = open(conf_hfile, "w")
65
conf_h.write("""/* IVLE Configuration File
67
* Administrator settings required by trampoline.
68
* Note: trampoline will have to be rebuilt in order for changes to this file
72
#define IVLE_AUFS_JAILS
74
/* Which user IDs are allowed to run the trampoline.
75
* This list should be limited to the web server user.
76
* (Note that root is an implicit member of this list).
78
static const int allowed_uids[] = { %s };
57
82
# Compile the trampoline
58
83
curdir = os.getcwd()
59
84
os.chdir('bin/trampoline')