Wrong file/dir owner and permission for installed Chrome OS fonts
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: http://src.chromium.org/svn/trunk/src/build@184986 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
Родитель
526012d7dc
Коммит
f7fe703f61
|
@ -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__':
|
||||
|
|
Загрузка…
Ссылка в новой задаче