Skip to content

Commit

Permalink
Wrong file/dir owner and permission for installed Chrome OS fonts
Browse files Browse the repository at this point in the history
The install script sets owner to root and adjust dir/file permissions to 0755 and 0644 respectively.

BUG=178612
TEST=manual; inspect dir/file owner and permissions in
/usr/local/share/fonts/chromeos.


Review URL: https://chromiumcodereview.appspot.com/12314144

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184986 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
[email protected] committed Feb 27, 2013
1 parent ccb8850 commit bcbaa11
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions build/linux/install-chromeos-fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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")
Expand All @@ -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__':
Expand Down

0 comments on commit bcbaa11

Please sign in to comment.