summaryrefslogtreecommitdiffstats
path: root/postinstall
diff options
context:
space:
mode:
authorraylu <raylu@cmu.edu>2011-05-12 06:29:42 -0400
committerraylu <raylu@cmu.edu>2011-05-12 06:29:42 -0400
commit418ca3fc0dbeb46b40b5a1682fff19a37ebdd423 (patch)
treef56038f644a6512053de2268f9ba8c4f042b8d79 /postinstall
parent6f470aaf6b99b7a901f1f57ab2e29e85fc89d386 (diff)
downloadpyc-418ca3fc0dbeb46b40b5a1682fff19a37ebdd423.tar.xz
Make postinstall more robust
Diffstat (limited to 'postinstall')
-rwxr-xr-xpostinstall7
1 files changed, 6 insertions, 1 deletions
diff --git a/postinstall b/postinstall
index 28f8e4e..3132c08 100755
--- a/postinstall
+++ b/postinstall
@@ -10,5 +10,10 @@ admindir = os.path.dirname(django.contrib.admin.__file__)
mediadir = os.path.join(admindir, 'media')
staticlink = os.path.join('static', 'admin')
-if not os.path.islink(staticlink):
+if os.path.exists(staticlink):
+ if not os.path.islink(staticlink):
+ print "Removing", staticlink
+ os.unlink(staticlink)
+ os.symlink(mediadir, staticlink)
+else:
os.symlink(mediadir, staticlink)