summaryrefslogtreecommitdiff
path: root/indra/viewer_components/updater/scripts/darwin/update_install.py
diff options
context:
space:
mode:
authorAura Linden <aura@lindenlab.com>2013-12-17 00:13:07 -0800
committerAura Linden <aura@lindenlab.com>2013-12-17 00:13:07 -0800
commit1219fe0e1b27e4468e0ee2f0f65e79b894296022 (patch)
treeaaf206a79d3fe39a3e2cca6c479b4f97f28b0a8f /indra/viewer_components/updater/scripts/darwin/update_install.py
parentddd6b8f91baa4ce408682925e12c4a58b8139b78 (diff)
parent6f34508aa9408266bfde366aa4e0cb6518ed45b8 (diff)
Mac Fullscreen fix for MAINT-3288 and MAINT-3135
Diffstat (limited to 'indra/viewer_components/updater/scripts/darwin/update_install.py')
-rwxr-xr-xindra/viewer_components/updater/scripts/darwin/update_install.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/viewer_components/updater/scripts/darwin/update_install.py b/indra/viewer_components/updater/scripts/darwin/update_install.py
index 10d507c9ef..08f4f0ebb9 100755
--- a/indra/viewer_components/updater/scripts/darwin/update_install.py
+++ b/indra/viewer_components/updater/scripts/darwin/update_install.py
@@ -199,6 +199,11 @@ def main(dmgfile, markerfile, markertext):
# prepare for other cleanup
with Janitor(LOGF) as janitor:
+ # Under some circumstances, this script seems to be invoked with a
+ # nonexistent pathname. Check for that.
+ if not os.path.isfile(dmgfile):
+ fail(dmgfile + " has been deleted")
+
# Try to derive the name of the running viewer app bundle from our
# own pathname. (Hopefully the old viewer won't copy this script
# to a temp dir before running!)
@@ -376,6 +381,13 @@ def main(dmgfile, markerfile, markertext):
log(' '.join(command))
subprocess.check_call(command, stdout=LOGF, stderr=subprocess.STDOUT)
+ # If all the above succeeded, delete the .dmg file. We don't do this
+ # as a janitor.later() operation because we only want to do it if we
+ # get this far successfully. Note that this is out of the scope of the
+ # Janitor: we must detach the .dmg before removing it!
+ log("rm " + dmgfile)
+ os.remove(dmgfile)
+
except Exception, err:
# Because we carefully set sys.excepthook -- and even modify it to log
# the problem once we have our log file open -- you might think we