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

« back to all changes in this revision

Viewing changes to setup/install.py

  • Committer: Matt Giuca
  • Date: 2009-12-01 04:27:58 UTC
  • mfrom: (1164.2.46 sphinx-docs)
  • Revision ID: matt.giuca@gmail.com-20091201042758-wuxd9bdec00c283i
Merged sphinx-docs branch. This adds Sphinx documentation for the entire IVLE system (for system administrators and developers), and removes all of our random old document files (all either irrelevant, or moved into the Sphinx docs nicely). Currently incomplete, but ready to merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    parser.add_option("-n", "--dry",
43
43
        action="store_true", dest="dry",
44
44
        help="Print out the actions but don't do anything.")
45
 
    parser.add_option("-R", "--nosvnrevno",
46
 
        action="store_true", dest="nosvnrevno",
47
 
        help="Don't write out the Subversion revision to the share directory.")
48
45
    parser.add_option("--root",
49
46
        action="store", dest="rootdir",
50
47
        help="Install into a different root directory.",
76
73
    # Call the real function
77
74
    return __install(prefix=options.prefix,
78
75
                     python_site_packages=options.python_site_packages,
79
 
                     dry=options.dry, rootdir=options.rootdir,
80
 
                     nosvnrevno=options.nosvnrevno)
 
76
                     dry=options.dry, rootdir=options.rootdir)
81
77
 
82
 
def __install(prefix, python_site_packages, dry=False, rootdir=None,
83
 
              nosvnrevno=False):
 
78
def __install(prefix, python_site_packages, dry=False, rootdir=None):
84
79
    install_list = util.InstallList()
85
80
 
86
81
    # We need to apply make_install_path with the rootdir to an awful lot of
129
124
    # Copy the lib directory (using the list)
130
125
    util.action_copylist(install_list.list_ivle_lib, python_site_packages, dry)
131
126
 
132
 
    if not nosvnrevno:
133
 
        # Create the ivle working revision record file
134
 
        ivle_revision_file = os.path.join(share_path, 'revision.txt')
135
 
        if not dry:
136
 
            try:
137
 
                conf = open(ivle_revision_file, "w")
138
 
 
139
 
                conf.write("""# SVN revision r%s
140
 
# Source tree location: %s
141
 
# Modified files:
142
 
""" % (util.get_svn_revision(), os.getcwd()))
143
 
 
144
 
                conf.close()
145
 
            except IOError, (errno, strerror):
146
 
                print "IO error(%s): %s" % (errno, strerror)
147
 
                sys.exit(1)
148
 
 
149
 
            os.system("svn status . >> %s" % ivle_revision_file)
150
 
 
151
 
        print "Wrote IVLE code revision status to %s" % ivle_revision_file
152
 
 
153
127
    return 0
154
128