[jhbuild] Allow overriding of the built-in triggers directory with JHBUILD_TRIGGERS



commit 7f4b3ff72b6e1b76d109c5f607070d81b97f1fac
Author: Tristan Van Berkom <tristan upstairslabs com>
Date:   Fri Dec 13 02:20:58 2013 +0900

    Allow overriding of the built-in triggers directory with JHBUILD_TRIGGERS
    
    This allows specifying the trigger directory from a customized jhbuildrc:
       os.environ['JHBUILD_TRIGGERS'] = '/path/to/triggers'
    
    This is interesting when creating triggers for a specific target environment
    with a customized jhbuildrc and moduleset.

 jhbuild/frontends/buildscript.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/jhbuild/frontends/buildscript.py b/jhbuild/frontends/buildscript.py
index 9c9f2a3..a0c6013 100644
--- a/jhbuild/frontends/buildscript.py
+++ b/jhbuild/frontends/buildscript.py
@@ -222,7 +222,9 @@ class BuildScript:
     def run_triggers(self, module_name):
         """See triggers/README."""
         assert 'JHBUILD_PREFIX' in os.environ
-        if PKGDATADIR is not None:
+        if os.environ.get('JHBUILD_TRIGGERS') is not None:
+            trigger_path = os.environ.get('JHBUILD_TRIGGERS')
+        elif PKGDATADIR is not None:
             trigger_path = os.path.join(PKGDATADIR, 'triggers')
         else:
             trigger_path = os.path.join(SRCDIR, 'triggers')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]