Skip to content

Commit

Permalink
Merge pull request mozilla-b2g#7449 from ochameau/l10n-win32
Browse files Browse the repository at this point in the history
Bug 828550 - Fail building gaia on windows, r=kaze, a=sicking
  • Loading branch information
fabi1cazenave committed Jan 9, 2013
2 parents f12824e + fad136f commit 4660ba0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 10 additions & 5 deletions build/utils.js
Expand Up @@ -90,13 +90,18 @@ function writeContent(file, content) {
// Return an nsIFile by joining paths given as arguments
// First path has to be an absolute one
function getFile() {
let file = new FileUtils.File(arguments[0]);
if (arguments.length > 1) {
for (let i = 1; i < arguments.length; i++) {
file.append(arguments[i]);
try {
let file = new FileUtils.File(arguments[0]);
if (arguments.length > 1) {
for (let i = 1; i < arguments.length; i++) {
file.append(arguments[i]);
}
}
return file;
} catch(e) {
throw new Error(' -*- build/utils.js: Invalid file path (' +
Array.slice(arguments).join(', ') + ')\n' + e + '\n');
}
return file;
}

function ensureFolderExists(file) {
Expand Down
4 changes: 3 additions & 1 deletion build/webapp-l10n.js
Expand Up @@ -192,7 +192,9 @@ if (GAIA_INLINE_LOCALES) {

// LOCALES_FILE is a relative path by default: shared/resources/languages.json
// -- but it can be an absolute path when doing a multilocale build.
let file = getFile(GAIA_DIR + '/' + LOCALES_FILE);
// LOCALES_FILE is using unix separator, ensure working fine on win32
let abs_path_chunks = [GAIA_DIR].concat(LOCALES_FILE.split('/'));
let file = getFile.apply(null, abs_path_chunks);
if (!file.exists()) {
file = getFile(LOCALES_FILE);
}
Expand Down

0 comments on commit 4660ba0

Please sign in to comment.