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

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

Issue 12314144: Wrong file/dir owner and permission for installed Chrome OS fonts (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 178612 Created 7 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: build/linux/install-chromeos-fonts.py
diff --git a/build/linux/install-chromeos-fonts.py b/build/linux/install-chromeos-fonts.py
index bb5f3c927cb03b327bc0ed2505a05663719a6c66..98c3a570d139f2a21c21bf0e08c9f9c4278898fd 100755
--- a/build/linux/install-chromeos-fonts.py
+++ b/build/linux/install-chromeos-fonts.py
@@ -39,7 +39,7 @@ def main(args):
url = "%s/%s/%s" % (URL_PREFIX, URL_DIR, URL_FILE)
- stamp = os.path.join(dest_dir, ".stamp")
+ stamp = os.path.join(dest_dir, ".stamp02")
if os.path.exists(stamp):
with open(stamp) as s:
if s.read() == url:
@@ -48,12 +48,14 @@ def main(args):
if os.path.isdir(dest_dir):
shutil.rmtree(dest_dir)
- os.mkdir(dest_dir);
+ os.mkdir(dest_dir)
+ os.chmod(dest_dir, 0755)
print "Installing Chrome OS fonts to %s." % dest_dir
tarball = os.path.join(dest_dir, URL_FILE)
subprocess.check_call(['curl', '-L', url, '-o', tarball])
- subprocess.check_call(['tar', 'xf', tarball, '-C', dest_dir])
+ 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")
@@ -65,6 +67,12 @@ def main(args):
with open(stamp, 'w') as s:
s.write(url)
+ for base, dirs, files in os.walk(dest_dir):
+ for dir in dirs:
+ os.chmod(os.path.join(base, dir), 0755)
+ for file in files:
+ os.chmod(os.path.join(base, file), 0644)
+
return 0
if __name__ == '__main__':
« 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