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

« back to all changes in this revision

Viewing changes to bin/ivle-buildjail

  • Committer: William Grant
  • Date: 2009-02-25 23:04:11 UTC
  • Revision ID: grantw@unimelb.edu.au-20090225230411-lbdyl32ir0m3d59b
Make all of the services executable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    help='''Apply any package updates in the jail.''')
44
44
parser.add_option("-m", "--mirror",
45
45
    action="store", dest="apt_mirror",
46
 
    help="Sets the apt mirror.", default="http://archive.ubuntu.com/ubuntu")
 
46
    help="Sets the apt mirror used when recreating the jail.")
47
47
(options, args) = parser.parse_args(sys.argv)
48
48
 
49
49
if os.geteuid() != 0:
55
55
    sys.exit(1)
56
56
 
57
57
if options.recreate:
58
 
    options.upgrade = True
59
 
 
60
58
    # Create the jail and its subdirectories
61
59
    # Note: Other subdirs will be made by copying files
62
60
    if options.apt_mirror is not None:
66
64
    ivle.jailbuilder.debian.debootstrap_create_jail(conf['jail']['suite'],
67
65
              build_path, mirror=options.apt_mirror)
68
66
 
69
 
    ivle.jailbuilder.debian.apt_update_cache(build_path)
70
 
    ivle.jailbuilder.debian.apt_install(build_path,
71
 
                        ['python2.5', 'python-cjson', 'python-svn'])
72
 
 
73
 
    ivle.jailbuilder.debian.apt_clean(build_path)
74
 
 
75
 
if options.upgrade:
76
 
    # Run apt-get update, apt-get upgrade and apt-get clean.
77
 
    ivle.jailbuilder.debian.mangle_sources_list(build_path, clobber=True)
78
 
    ivle.jailbuilder.debian.mangle_sources_list(build_path, lines=[
79
 
            'deb %s %s%s %s' % (options.apt_mirror, conf['jail']['suite'],
80
 
                                pocket, ' '.join(['main', 'universe']))
81
 
            for pocket in ('', '-updates', '-security')])
82
 
 
83
67
    # Add any extra site apt sources.
84
68
    if conf['jail']['extra_sources']:
85
69
        ivle.jailbuilder.debian.mangle_sources_list(build_path,
91
75
                                            conf['jail']['extra_keys'])
92
76
 
93
77
    ivle.jailbuilder.debian.apt_update_cache(build_path)
94
 
    ivle.jailbuilder.debian.apt_upgrade(build_path)
 
78
    ivle.jailbuilder.debian.apt_install(build_path,
 
79
                        ['python2.5', 'python-cjson', 'python-svn'])
95
80
 
96
81
    # Install any extra site packages.
97
82
    if conf['jail']['extra_packages']:
100
85
 
101
86
    ivle.jailbuilder.debian.apt_clean(build_path)
102
87
 
 
88
if options.upgrade:
 
89
    # Run apt-get update, apt-get upgrade and apt-get clean.
 
90
    ivle.jailbuilder.debian.apt_update_cache(build_path)
 
91
    ivle.jailbuilder.debian.apt_upgrade(build_path)
 
92
    ivle.jailbuilder.debian.apt_clean(build_path)
 
93
 
103
94
if conf['jail']['devmode']:
104
95
    # Copy all console and operating system files into the jail
105
96
    services_path = os.path.join(ivle.conf.share_path, 'services')