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

Unified Diff: build/linux/install-chromeos-fonts.py

Issue 1449563004: Add Roboto fonts and update Noto fonts in install-chromeos-fonts.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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: build/linux/install-chromeos-fonts.py
diff --git a/build/linux/install-chromeos-fonts.py b/build/linux/install-chromeos-fonts.py
index a24adc920ce10a575d9c4c4e560e13bdef9e9723..460f10dbe14719f41ae6fa724c8b8250bf110fed 100755
--- a/build/linux/install-chromeos-fonts.py
+++ b/build/linux/install-chromeos-fonts.py
@@ -12,10 +12,21 @@ import shutil
import subprocess
import sys
-# Taken from the media-fonts/notofonts ebuild in chromiumos-overlay.
-VERSION = '20140815'
-URL = ('https://commondatastorage.googleapis.com/chromeos-localmirror/'
- 'distfiles/notofonts-%s.tar.bz2') % (VERSION)
+URL_TEMPLATE = ('https://commondatastorage.googleapis.com/chromeos-localmirror/'
+ 'distfiles/%(name)s-%(version)s.tar.bz2')
+
+# Taken from the media-fonts/<name> ebuilds in chromiumos-overlay.
+SOURCES = [
+ {
+ 'name': 'notofonts',
+ 'version': '20150706'
+ }, {
+ 'name': 'robotofonts',
+ 'version': '20150625'
+ }
+]
+
+URLS = sorted([URL_TEMPLATE % d for d in SOURCES])
FONTS_DIR = '/usr/local/share/fonts'
def main(args):
@@ -36,7 +47,7 @@ def main(args):
stamp = os.path.join(dest_dir, ".stamp02")
if os.path.exists(stamp):
with open(stamp) as s:
- if s.read() == URL:
+ if s.read() == '\n'.join(URLS):
print "Chrome OS fonts already up-to-date in %s." % dest_dir
return 0
@@ -46,11 +57,12 @@ def main(args):
os.chmod(dest_dir, 0755)
print "Installing Chrome OS fonts to %s." % dest_dir
- tarball = os.path.join(dest_dir, os.path.basename(URL))
- subprocess.check_call(['curl', '-L', URL, '-o', tarball])
- subprocess.check_call(['tar', '--no-same-owner', '--no-same-permissions',
- '-xf', tarball, '-C', dest_dir])
- os.remove(tarball)
+ for url in URLS:
+ tarball = os.path.join(dest_dir, os.path.basename(url))
+ subprocess.check_call(['curl', '-L', url, '-o', tarball])
+ subprocess.check_call(['tar', '--no-same-owner', '--no-same-permissions',
+ '-xf', tarball, '-C', dest_dir])
+ os.remove(tarball)
readme = os.path.join(dest_dir, "README")
with open(readme, 'w') as s:
@@ -59,7 +71,7 @@ def main(args):
s.write("Script: %s\n" % __file__)
with open(stamp, 'w') as s:
- s.write(URL)
+ s.write('\n'.join(URLS))
for base, dirs, files in os.walk(dest_dir):
for dir in dirs:
« 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