- 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:
Marshall Greenblatt
2011-10-25 16:36:38 +00:00
parent 7a91ff899f
commit df921942ea
4 changed files with 94 additions and 23 deletions

View File

@ -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