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

« back to all changes in this revision

Viewing changes to setup/install.py

  • Committer: Matt Giuca
  • Date: 2009-04-28 11:19:03 UTC
  • Revision ID: matt.giuca@gmail.com-20090428111903-murkoqeljahrp2d8
usrmgt-server: Removed all references to ivle.conf. Now uses the config
    object.
    (I created a global variable, config, just for the outermost functions to
    use. All of the other functions still use an argument version of config,
    for testing purposes).

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.")
45
48
    parser.add_option("--root",
46
49
        action="store", dest="rootdir",
47
50
        help="Install into a different root directory.",
73
76
    # Call the real function
74
77
    return __install(prefix=options.prefix,
75
78
                     python_site_packages=options.python_site_packages,
76
 
                     dry=options.dry, rootdir=options.rootdir)
 
79
                     dry=options.dry, rootdir=options.rootdir,
 
80
                     nosvnrevno=options.nosvnrevno)
77
81
 
78
 
def __install(prefix, python_site_packages, dry=False, rootdir=None):
 
82
def __install(prefix, python_site_packages, dry=False, rootdir=None,
 
83
              nosvnrevno=False):
79
84
    install_list = util.InstallList()
80
85
 
81
86
    # We need to apply make_install_path with the rootdir to an awful lot of
124
129
    # Copy the lib directory (using the list)
125
130
    util.action_copylist(install_list.list_ivle_lib, python_site_packages, dry)
126
131
 
 
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
 
127
153
    return 0
128
154