[pitivi] Fix in_devel method



commit 3c4475a03827de4587020b409861e259fb19201e
Author: Dmitrii Petukhov <dimart sp gmail com>
Date:   Tue Mar 15 14:21:41 2016 +0300

    Fix in_devel method
    
    This commit adds an env variable "PITIVI_DEVELOPMENT" to control whether
    Pitivi is in developer mode.
    
    Fixes https://phabricator.freedesktop.org/T7350
    
    Differential Revision: https://phabricator.freedesktop.org/D828

 bin/pitivi-git-environment.sh |    2 ++
 bin/pitivi-git-prebuilt-env   |    4 ++--
 bin/pitivi.in                 |    3 +--
 build/xdg-app/enter_env       |    1 +
 pitivi/configure.py.in        |    3 +--
 5 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/bin/pitivi-git-environment.sh b/bin/pitivi-git-environment.sh
index 1df809c..a35a594 100755
--- a/bin/pitivi-git-environment.sh
+++ b/bin/pitivi-git-environment.sh
@@ -31,6 +31,8 @@ PYGOBJECT_RELEASE_TAG="3.8.0"
 GOBJECT_INTROSPECTION_MINIMUM_VERSION="1.34.2"
 GOBJECT_INTROSPECTION_RELEASE_TAG="GOBJECT_INTROSPECTION_$(echo $GOBJECT_INTROSPECTION_MINIMUM_VERSION | tr 
'.' '_')"
 
+# If you want to run the development version of Pitivi:
+export PITIVI_DEVELOPMENT=1
 
 #
 # Everything below this line shouldn't be edited!
diff --git a/bin/pitivi-git-prebuilt-env b/bin/pitivi-git-prebuilt-env
index 1584990..147e7aa 100755
--- a/bin/pitivi-git-prebuilt-env
+++ b/bin/pitivi-git-prebuilt-env
@@ -143,8 +143,8 @@ class Bundle:
 
 def enter_dev_environment(prefix):
     printf("Entering development environment...")
-    os.system("APP_IMAGE_TEST=1 APPDIR=%s %s" % (prefix,
-                                                 os.path.join(prefix, "./AppRun")))
+    os.system("APP_IMAGE_TEST=1 PITIVI_DEVELOPMENT=1 APPDIR=%s %s"
+        % (prefix, os.path.join(prefix, "./AppRun")))
 
 if __name__ == "__main__":
     parser = argparse.ArgumentParser()
diff --git a/bin/pitivi.in b/bin/pitivi.in
index 6d94d87..8484c25 100644
--- a/bin/pitivi.in
+++ b/bin/pitivi.in
@@ -63,8 +63,7 @@ def jump_through_hoops():
 
 # Check if we're in development or installed version and set paths properly
 def _in_devel():
-    root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-    return os.path.exists(os.path.join(root_dir, '.git'))
+    return os.environ.get("PITIVI_DEVELOPMENT", "0") != "0"
 
 
 def _add_pitivi_path():
diff --git a/build/xdg-app/enter_env b/build/xdg-app/enter_env
index c364de3..9d36ca1 100755
--- a/build/xdg-app/enter_env
+++ b/build/xdg-app/enter_env
@@ -9,6 +9,7 @@ function generate_path_and_completion_calls {
 RCFILE=$GITREPO/.bashrc
 cp ~/.bashrc $RCFILE
 echo "export PS1=[ptv]\ \$PS1" >> $RCFILE
+echo "export PITIVI_DEVELOPMENT=1" >> $RCFILE
 generate_path_and_completion_calls >> $RCFILE
 
 
diff --git a/pitivi/configure.py.in b/pitivi/configure.py.in
index e2ec898..c987e8e 100644
--- a/pitivi/configure.py.in
+++ b/pitivi/configure.py.in
@@ -35,8 +35,7 @@ def in_devel():
     """
     Returns whether the app is run from a git checkout.
     """
-    rd = _get_root_dir()
-    return os.path.exists(os.path.join(rd, '.git'))
+    return os.environ.get("PITIVI_DEVELOPMENT", "0") != "0"
 
 if "APPDIR" in os.environ:
     basedir = os.environ["APPDIR"]


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