summaryrefslogtreecommitdiffstats
path: root/tools/grit
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 16:33:13 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 16:33:13 +0000
commit5688c68aad4f5d3da65e6bcd5ee5702fdf92933d (patch)
tree67b2110229afb2c90d44806c6db858e89608da23 /tools/grit
parent2158764c9e79b59c5db8c06d93b4c644b2fad112 (diff)
downloadchromium_src-5688c68aad4f5d3da65e6bcd5ee5702fdf92933d.zip
chromium_src-5688c68aad4f5d3da65e6bcd5ee5702fdf92933d.tar.gz
chromium_src-5688c68aad4f5d3da65e6bcd5ee5702fdf92933d.tar.bz2
When grit flattens resources, make it include the name of the resource
(the IDR_ value) in the filename so we don't have naming clashes. BUG=69633 Review URL: http://codereview.chromium.org/6910005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83897 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/grit')
-rw-r--r--tools/grit/grit/format/rc.py8
-rw-r--r--tools/grit/grit/node/include.py6
2 files changed, 7 insertions, 7 deletions
diff --git a/tools/grit/grit/format/rc.py b/tools/grit/grit/format/rc.py
index f963fc6..d2ffd58 100644
--- a/tools/grit/grit/format/rc.py
+++ b/tools/grit/grit/format/rc.py
@@ -1,5 +1,5 @@
#!/usr/bin/python2.4
-# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -425,11 +425,7 @@ class RcInclude(interface.ItemFormatter):
# if needed (e.g. if it is an HTML file include).
filename = os.path.abspath(item.FileForLanguage(lang, output_dir))
if self.flatten_html:
- # TODO(akalin): Flatten to a subdirectory of output_dir, lest we
- # run into bugs like http://crbug.com/69633.
- item.Flatten(output_dir)
- # The flattened file is in the output dir.
- filename = os.path.basename(filename)
+ filename = item.Flatten(output_dir)
elif self.filenameWithoutPath:
filename = os.path.basename(filename)
elif self.relative_path_:
diff --git a/tools/grit/grit/node/include.py b/tools/grit/grit/node/include.py
index 7cfa45e..b073bc7 100644
--- a/tools/grit/grit/node/include.py
+++ b/tools/grit/grit/node/include.py
@@ -93,8 +93,11 @@ class IncludeNode(base.Node):
return id, data
def Flatten(self, output_dir):
+ '''Rewrite file references to be base64 encoded data URLs. The new file
+ will be written to output_dir and the name of the new file is returned.'''
filename = self.FilenameToOpen()
- flat_filename = os.path.join(output_dir, os.path.split(filename)[1])
+ flat_filename = os.path.join(output_dir,
+ self.attrs['name'] + '_' + os.path.basename(filename))
if self._last_flat_filename == flat_filename:
return
@@ -104,6 +107,7 @@ class IncludeNode(base.Node):
outfile.close()
self._last_flat_filename = flat_filename
+ return os.path.basename(flat_filename)
def GetHtmlResourceFilenames(self):