Bug 1560340 - Only add confvars.sh as a dependency to config.status when it exists...
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 20 Jun 2019 18:43:25 +0000 (18:43 +0000)
committerMike Hommey <glandium@debian.org>
Wed, 1 Jul 2020 00:08:58 +0000 (01:08 +0100)
Differential Revision: https://phabricator.services.mozilla.com/D35447

Gbp-Pq: Topic fixes
Gbp-Pq: Name Bug-1560340-Only-add-confvars.sh-as-a-dependency-to-.patch

moz.configure

index 2484ad553645678c8b825904a59bea87d0959ed0..8cbc4f28a3ac06bcb27e9cd6af49e0444d48f76f 100755 (executable)
@@ -640,20 +640,22 @@ include('js/sub.configure', when=compile_environment & toolkit)
 @depends(check_build_environment, build_project)
 @imports('__sandbox__')
 @imports('glob')
+@imports(_from='os.path', _import='exists')
 def config_status_deps(build_env, build_project):
 
     topsrcdir = build_env.topsrcdir
     topobjdir = build_env.topobjdir
 
-    if not build_env.topobjdir.endswith('js/src'):
-        extra_deps = [
-            os.path.join(topsrcdir, build_project, 'confvars.sh'),
-            os.path.join(topobjdir, '.mozconfig.json'),
-        ]
+    if not topobjdir.endswith('js/src'):
+        extra_deps = [os.path.join(topobjdir, '.mozconfig.json')]
     else:
         # mozconfig changes may impact js configure.
         extra_deps = [os.path.join(topobjdir[:-7], '.mozconfig.json')]
 
+    confvars = os.path.join(topsrcdir, build_project, 'confvars.sh')
+    if exists(confvars):
+        extra_deps.append(confvars)
+
     return list(__sandbox__._all_paths) + extra_deps + [
         os.path.join(topsrcdir, 'CLOBBER'),
         os.path.join(topsrcdir, 'configure'),