# HG changeset patch
# User Mike Hommey <mh+mozilla@glandium.org>
# Date 1368609938 -7200
# Node ID 695b1fa7498a03ec90ee6f27dd565b0673e2c7d0
# Parent  35ea60e8e5b5ac3024dd9ee2185c89dd0215d155
Bug 872439 - Fix GRE path used for startup cache precompilation with --with-libxul-sdk

diff --git a/toolkit/mozapps/installer/packager.py b/toolkit/mozapps/installer/packager.py
--- a/toolkit/mozapps/installer/packager.py
+++ b/toolkit/mozapps/installer/packager.py
@@ -346,17 +346,18 @@ def main():
                 continue
             key = JarLog.canonicalize(os.path.join(args.destination, p))
             if key in log:
                 f.preload(log[key])
 
     # Fill startup cache
     if isinstance(formatter, OmniJarFormatter) and launcher.can_launch():
         if buildconfig.substs['LIBXUL_SDK']:
-            gre_path = buildconfig.substs['LIBXUL_DIST']
+            gre_path = mozpack.path.join(buildconfig.substs['LIBXUL_DIST'],
+                                         'bin')
         else:
             gre_path = None
         for base in sorted([[p for p in [mozpack.path.join('bin', b), b]
                             if os.path.exists(os.path.join(args.source, p))][0]
                            for b in sink.packager.get_bases()]):
             if not gre_path:
                 gre_path = base
             base_path = sink.normalize_path(base)
