mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Restore original file permissions after patching a file (issue #387).
- Add the ability to selectively apply patches based on the presence of an environment variable (issue #388). - Add a patch to disable scrollbar bounce and scrollbar overlay on Lion based on the presence of the CEF_SPI_BUILD environment variable (issue #364). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@339 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -20,7 +20,9 @@ __version__ = "8.12-1"
|
||||
|
||||
import copy
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from stat import *
|
||||
# cStringIO doesn't support unicode in 2.5
|
||||
from StringIO import StringIO
|
||||
from logging import debug, info, warning
|
||||
@ -500,6 +502,9 @@ def patch_stream(instream, hunks):
|
||||
|
||||
|
||||
def patch_hunks(srcname, tgtname, hunks):
|
||||
# get the current file mode
|
||||
mode = os.stat(srcname)[ST_MODE]
|
||||
|
||||
src = open(srcname, "rb")
|
||||
tgt = open(tgtname, "wb")
|
||||
|
||||
@ -509,6 +514,10 @@ def patch_hunks(srcname, tgtname, hunks):
|
||||
|
||||
tgt.close()
|
||||
src.close()
|
||||
|
||||
# restore the file mode
|
||||
os.chmod(tgtname, mode)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user