[jhbuild/issue-34] Fix for simple installation



commit 282f9f3a62749de910899e8e5130c758ed01f039
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Tue Sep 24 15:17:58 2019 +0200

    Fix for simple installation
    
    Fallback to python2 when doing a simple install and do not rely
    on global variables
    
    Fixes #34

 Makefile.plain  | 1 +
 jhbuild/main.py | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/Makefile.plain b/Makefile.plain
index 16307816..022e2418 100644
--- a/Makefile.plain
+++ b/Makefile.plain
@@ -24,6 +24,7 @@ install: include-check
        @echo "Creating $(bindir)/jhbuild"
        @mkdir -p $(bindir)
        @sed -e "s,@jhbuilddir@,`pwd`,g" \
+               -e "s,@python@,python2,g" \
                -e "s,USE_CHECKOUT_SRC = False,USE_CHECKOUT_SRC = True," < \
                scripts/jhbuild.in > $(bindir)/jhbuild
        @chmod a+x $(bindir)/jhbuild
diff --git a/jhbuild/main.py b/jhbuild/main.py
index 81a38959..564402b1 100644
--- a/jhbuild/main.py
+++ b/jhbuild/main.py
@@ -47,7 +47,11 @@ def print_help(parser):
     parser.exit()
 
 def main(args):
-    localedir = os.path.join(DATADIR, 'locale')
+    if DATADIR is not None:
+        localedir = os.path.join(DATADIR, 'locale')
+    else:
+        localedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'mo'))
+
     if not os.path.exists(localedir):
         localedir = None
     install_translation(gettext.translation('jhbuild', localedir=localedir, fallback=True))


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