~mark-mims/+junk/mediawiki-nfs-client

« back to all changes in this revision

Viewing changes to formulas/mediawiki/hooks/db-relation-changed

  • Committer: Clint Byrum
  • Date: 2011-03-16 18:40:37 UTC
  • Revision ID: clint@ubuntu.com-20110316184037-7p84g9pbkezvfv6l
mediawiki: handle errors during new index.php code

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
    os.chmod(ofile.name, 0755)
225
225
    ofile.write("<?php header('Location: /mediawiki/');\n")
226
226
    ofile.close()
227
 
    os.unlink("/var/www/index.php")
 
227
    try:
 
228
        os.unlink("/var/www/index.php")
 
229
        print "index.php removed"
 
230
    except OSError:
 
231
        print "index.php not present"
228
232
    os.rename(ofile.name, "/var/www/index.php")
229
233
 
230
234
    # This seems to take precedence
231
 
    os.unlink("/var/www/index.html")
232
 
    
 
235
    try:
 
236
        os.unlink("/var/www/index.html")
 
237
        print "index.html removed"
 
238
    except OSError:
 
239
        print "index.html not present"
233
240
 
234
241
    # Write the adminsettings
235
242
    if change_type == 'modified':