Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Unified Diff: download_firefox_nightly.py

Issue 942783002: Simplifying Firefox download script, fixing bugs, disabling on win/mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webrtc/webrtc.DEPS/
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: download_firefox_nightly.py
===================================================================
--- download_firefox_nightly.py (revision 294082)
+++ download_firefox_nightly.py (working copy)
@@ -24,6 +24,7 @@
sys.path.append(os.path.join(THIRD_PARTY_DIR, 'mozinfo'))
from mozdownload import scraper
+import utils
def _Touch(a_file):
@@ -58,7 +59,7 @@
def _FindFallbackFirefoxBuild(target_dir):
firefox_archives = _GetFirefoxArchivesSortedOnModifiedDate(target_dir)
if not firefox_archives:
- return None
+ return None, None
newest_build = firefox_archives[0]
build_age_seconds = time.time() - os.path.getmtime(newest_build)
@@ -101,33 +102,13 @@
def _ExtractArchive(firefox_archive, target_dir):
- # TODO(phoglund): implement on win/mac. See http://crbug.com/454303.
- if sys.platform == 'darwin':
- print "Disabled on mac..."
- return 0
- volume = '/Volumes/Nightly'
- firefox_executable = '%s/FirefoxNightly.app' % target_dir
-
- # Unmount any previous downloads.
- subprocess.call(['hdiutil', 'detach', volume])
-
- subprocess.check_call(['hdiutil', 'attach', firefox_archive])
- shutil.copytree('%s/FirefoxNightly.app' % volume, firefox_executable)
- subprocess.check_call(['hdiutil', 'detach', volume])
- elif sys.platform == 'linux2':
+ if utils.GetPlatform() is 'linux':
tar_archive = tarfile.open(firefox_archive, 'r:bz2')
tar_archive.extractall(path=target_dir)
- elif sys.platform == 'win32':
- print "Disabled on win..."
- return 0
- zip_archive = zipfile.ZipFile(firefox_archive)
- zip_archive.extractall(path=target_dir)
else:
- print >> sys.stderr, 'Unsupported platform: %s' % sys.platform
- return 1
+ raise Exception('Unsupported platform: %s' % sys.platform)
print 'Extracted %s' % firefox_archive
- return 0
def main():
@@ -146,6 +127,10 @@
if not options.target_dir:
parser.error('You must specify the target directory.')
+ if utils.GetPlatform() is not 'linux':
+ print 'This script is only supported on Linux for now.'
+ return
+
target_dir = options.target_dir
if not os.path.isdir(target_dir):
os.mkdir(target_dir)
@@ -152,7 +137,7 @@
firefox_archive = _MaybeDownload(target_dir, options.force)
if firefox_archive:
- return _ExtractArchive(firefox_archive, target_dir)
+ _ExtractArchive(firefox_archive, target_dir)
if options.clean_old_firefox_archives:
_CleanOldFirefoxArchives(target_dir)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698