summaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@digia.com>2013-07-24 16:20:55 +0200
committerZeno Albisser <zeno.albisser@digia.com>2013-07-24 20:32:08 +0200
commit0a5caa2c82cd39fecaeb6390423fea4f972a6013 (patch)
tree0f489b58d6ac87b30b90669fd26971733ba4eedd /patches
parent3f3c3d8c3e656a0f303a93bb9d32251d554a9ef3 (diff)
Add patch for grit after updating Chromium.
Change-Id: I9e197aafd3dd342ba965ac27ae3b2543cd377bf3 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'patches')
-rw-r--r--patches/0001-GRIT-Allow-grd-files-outside-of-chromium-source-dir.patch46
-rwxr-xr-xpatches/patch-chromium.sh4
2 files changed, 50 insertions, 0 deletions
diff --git a/patches/0001-GRIT-Allow-grd-files-outside-of-chromium-source-dir.patch b/patches/0001-GRIT-Allow-grd-files-outside-of-chromium-source-dir.patch
new file mode 100644
index 000000000..a195d5674
--- /dev/null
+++ b/patches/0001-GRIT-Allow-grd-files-outside-of-chromium-source-dir.patch
@@ -0,0 +1,46 @@
+From c95babeeea70a71aaabca18924e2471fbb065b84 Mon Sep 17 00:00:00 2001
+From: Zeno Albisser <zeno.albisser@digia.com>
+Date: Wed, 24 Jul 2013 15:54:50 +0200
+Subject: [PATCH] GRIT: Allow grd files outside of chromium source dir.
+
+When replacing substrings with values from a dictionary,
+the replacements should not be truncated to the length of src_root_dir.
+
+If the basename does not exist as a key in the resource_ids file,
+then fall back to an absolute path.
+
+The precedence is like:
+file in chromium > file basename > absolute file name.
+
+THIS SHOULD BE UPSTREAMABLE.
+---
+ grit/node/misc.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/grit/node/misc.py b/grit/node/misc.py
+index 734c57a..33848b2 100755
+--- a/grit/node/misc.py
++++ b/grit/node/misc.py
+@@ -49,7 +49,7 @@ def _ReadFirstIdsFromFile(filename, defines):
+ def ReplaceVariable(matchobj):
+ for key, value in defines.iteritems():
+ if matchobj.group(1) == key:
+- value = os.path.abspath(value)[len(src_root_dir) + 1:]
++ value = os.path.abspath(value)
+ return value
+ return ''
+
+@@ -427,6 +427,10 @@ class GritNode(base.Node):
+ abs_filename = os.path.abspath(filename_or_stream)
+ if abs_filename[:len(src_root_dir)] != src_root_dir:
+ filename = os.path.basename(filename_or_stream)
++ # If the file is not within src_root_dir and the basename is not
++ # found as a key, fall back to using the absolute file name.
++ if not filename in first_ids:
++ filename = abs_filename
+ else:
+ filename = abs_filename[len(src_root_dir) + 1:]
+ filename = filename.replace('\\', '/')
+--
+1.8.0.1
+
diff --git a/patches/patch-chromium.sh b/patches/patch-chromium.sh
index 0ffe6860f..4843a8441 100755
--- a/patches/patch-chromium.sh
+++ b/patches/patch-chromium.sh
@@ -78,3 +78,7 @@ echo "Entering $PWD"
git am $PATCH_DIR/0001-GYP-Fix-build-with-toplevel-dir.patch
git am $PATCH_DIR/0001-Add-support-for-libc-to-xcode_emulation.py.patch
+
+cd $CHROMIUM_SRC_DIR/tools/grit
+git am $PATCH_DIR/0001-GRIT-Allow-grd-files-outside-of-chromium-source-dir.patch
+